Commit 370dc895 authored by lanbaoming's avatar lanbaoming

2024-06-21提交

parent 22776506
package cn.iocoder.yudao.framework.toolkit;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ZTestMapper extends BaseMapper<zTest> {
}
......@@ -6271,7 +6271,9 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
OrderConsigneeDO orderConsigneeDO =
orderConsigneeService.getOne(new LambdaQueryWrapper<OrderConsigneeDO>().eq(OrderConsigneeDO::getOrderId, orderDO.getOrderId()).orderByDesc(OrderConsigneeDO::getId).last("limit 1"));
// 更新所属客户经理(业务员)
if (Objects.isNull(orderDO.getParentOrderId()) || orderDO.getParentOrderId() == 0 || orderDO.getSplitSeparateOrder()) {
if (Objects.isNull(orderDO.getParentOrderId()) ||
orderDO.getParentOrderId() == 0 ||
orderDO.getSplitSeparateOrder()) {
// 拆单子订单不执行客户经理分配规则,以原单为主
if (Objects.nonNull(orderDO.getCustomerId()) && orderDO.getCustomerId() > 0) {
addOrderCustomerService(orderDO,
......@@ -6279,8 +6281,14 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
orderDO.getCustomerId()) ? 1 : 2);
}
}
orderBusinessService.costCalculation(userId, orderDO, orderConsignorDO.getCustomerId(), orderConsigneeDO.getCustomerId(),
orderConsignorDO.getCustomerContactsId(), orderConsigneeDO.getCustomerContactsId(), orderItemDOList, 15);
orderBusinessService.costCalculation(userId,
orderDO,
orderConsignorDO.getCustomerId(),
orderConsigneeDO.getCustomerId(),
orderConsignorDO.getCustomerContactsId(),
orderConsigneeDO.getCustomerContactsId(),
orderItemDOList, 15);
}
@Override
......@@ -6297,8 +6305,14 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
addOrderCustomerService(orderDO, Objects.equals(orderConsignorDO.getCustomerId(), orderDO.getCustomerId()) ? 1 : 2);
}
}
orderBusinessService.costCalculation(userId, orderDO, orderConsignorDO.getCustomerId(), orderConsigneeDO.getCustomerId(),
orderConsignorDO.getCustomerContactsId(), orderConsigneeDO.getCustomerContactsId(), orderItemDOList, 10);
orderBusinessService.costCalculation(userId,
orderDO,
orderConsignorDO.getCustomerId(),
orderConsigneeDO.getCustomerId(),
orderConsignorDO.getCustomerContactsId(),
orderConsigneeDO.getCustomerContactsId(),
orderItemDOList,
10);
}
@Override
......
......@@ -353,9 +353,12 @@ public class OrderSpecialNeedServiceImpl extends AbstractService<OrderSpecialNee
@Override
@Transactional(rollbackFor = Exception.class)
public void buildSpecialReceivable(Long orderId, int type) {
List<OrderSpecialNeedDO> orderSpecialNeedDOS = orderSpecialNeedMapper.selectList(OrderSpecialNeedDO::getOrderId, orderId);
List<OrderSpecialNeedDO> orderSpecialNeedDOS =
orderSpecialNeedMapper.selectList(OrderSpecialNeedDO::getOrderId,
orderId);
if (CollectionUtil.isNotEmpty(orderSpecialNeedDOS)) {
orderSpecialNeedDOS.stream().filter(item -> item.getTransFee().compareTo(BigDecimal.ZERO) == 1).forEach(item -> build(item, type));
orderSpecialNeedDOS.stream().filter(
item -> item.getTransFee().compareTo(BigDecimal.ZERO) == 1).forEach(item -> build(item, type));
}
}
......
......@@ -1074,9 +1074,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
@Override
@Transactional(rollbackFor = Exception.class)
public boolean finishWarehouseIn(OrderWarehouseInFinishReqVO finishReqVO) {
String msg = "完成入仓";
Long orderId = finishReqVO.getOrderId();
OrderDO orderDO = orderService.getById(orderId);
if (orderDO == null) {
......@@ -1283,6 +1281,7 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
boolean firstRucang = orderDO.getRucangTime() == null;
if (firstRucang) {
//在下面的函数中弯沉费用计算 lanbm 2024-06-20 添加注释
orderService.finishOrderWarehouseIn(orderDO.getOrderId());
} else {
orderService.finishOrderWarehouseInUpdate(orderDO.getOrderId());
......
......@@ -138,7 +138,11 @@ public class OrderCommissionPayableJob implements JobHandler {
return "";
}
private void addCommissionPayable(CommissionPayableDO commissionPayable, OrderItemDO orderItemDO, OrderDO orderDO, Integer feeType, BigDecimal amount) {
private void addCommissionPayable(CommissionPayableDO commissionPayable,
OrderItemDO orderItemDO,
OrderDO orderDO,
Integer feeType,
BigDecimal amount) {
commissionPayable.setOrderId(orderItemDO.getOrderId());
commissionPayable.setOrderNo(orderItemDO.getOrderNo());
commissionPayable.setPayableNo(orderDO.getContainerNumber());
......@@ -168,7 +172,8 @@ public class OrderCommissionPayableJob implements JobHandler {
commissionPayable.setTotalAmount(amount.multiply(orderItemDO.getChargeVolume()).setScale(2, RoundingMode.HALF_UP));
} else if (StringUtils.equals("kg", unitDO.getFuhao())) {
// 重量
commissionPayable.setTotalAmount(amount.multiply(orderItemDO.getChargeWeight()).setScale(2, RoundingMode.HALF_UP));
commissionPayable.setTotalAmount(
amount.multiply(orderItemDO.getChargeWeight()).setScale(2, RoundingMode.HALF_UP));
} else if (StringUtils.equals("a", unitDO.getFuhao())) {
// 数量
commissionPayable.setTotalAmount(amount.multiply(orderItemDO.getChargeQuantity()).setScale(2, RoundingMode.HALF_UP));
......
package cn.iocoder.yudao.framework.toolkit;
package cn.iocoder.yudao.module.product.dal.dataobject.coupon;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
@TableName("z_test")
@Data
public class zTest {
public class zTest3 {
private Long id;
private String testname;
......
......@@ -67,6 +67,7 @@ public class BasePrice extends BaseDO {
* 全包价金额单位
*/
private Long allPriceUnit;
/**
* 全包价体积单位
*/
......
package cn.iocoder.yudao.module.product.dal.mysql.coupon;
import cn.iocoder.yudao.framework.mybatis.core.mapper.AbstractMapper;
import cn.iocoder.yudao.module.product.dal.dataobject.coupon.zTest3;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ZTestMapper3 extends AbstractMapper<zTest3> {
}
......@@ -81,6 +81,7 @@ public class ProdCostDto {
*/
private Long freightVolume;
//返回给前端页面的清关价
@ApiModelProperty(value = "商品清关费单价(成交)")
private BigDecimal oneClearanceFee;
......
......@@ -58,9 +58,15 @@ public class ProductPriceStepServiceImpl extends AbstractService<ProductPriceSte
);
}
//获取阶梯价
@Override
public BasePrice getProductPriceStep(Long productPriceId, BigDecimal num, Integer priceType) {
List<ProductPriceStepDO> list = this.list(new LambdaQueryWrapperX<ProductPriceStepDO>()
public BasePrice getProductPriceStep(Long productPriceId,
BigDecimal num,
Integer priceType) {
//0-运费,1-全包价, 2-清关费
List<ProductPriceStepDO> list = this.list(
new LambdaQueryWrapperX<ProductPriceStepDO>()
.eq(ProductPriceStepDO::getProductPriceId, productPriceId)
.eq(ProductPriceStepDO::getPriceType, priceType)
.eq(ProductPriceStepDO::getDeleted, 0)
......@@ -72,7 +78,10 @@ public class ProductPriceStepServiceImpl extends AbstractService<ProductPriceSte
if (CollectionUtil.isEmpty(list)){
productPriceEmptyType = 1;
}else {
ProductPriceStepDO priceStepDO = list.stream().filter(priceStep -> priceStep.getStartNum().compareTo(num) <= 0 && priceStep.getEndNum().compareTo(num) >= 0).findFirst().orElse(null);
ProductPriceStepDO priceStepDO =
list.stream().filter(priceStep ->
priceStep.getStartNum().compareTo(num) <= 0 &&
priceStep.getEndNum().compareTo(num) >= 0).findFirst().orElse(null);
basePrice = new BasePrice();
if (Objects.isNull(priceStepDO)){
productPriceEmptyType = 2;
......
......@@ -2,11 +2,13 @@ package cn.iocoder.yudao.module.product.controller.admin.prod;
import cn.hutool.core.collection.CollectionUtil;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
import cn.iocoder.yudao.module.product.component.ProdCostCalculation;
import cn.iocoder.yudao.module.product.dto.CalculationCostResultDto;
import cn.iocoder.yudao.module.product.param.ConditionParam;
import cn.iocoder.yudao.module.product.param.ProdConditionParam;
import cn.iocoder.yudao.module.product.service.coupon.CouponService;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -44,11 +46,20 @@ public class ProdLinePriceController {
public CommonResult<CalculationCostResultDto> calculationProdCost(
@RequestBody ConditionParam param) {
//lanbm 2024-06-20 记录的参数日志
//String listToString = JSON.toJSONString(param);
//JsonUtils.SaveLog(listToString);
if (CollectionUtil.isEmpty(param.getProdConditionParamList())) {
return error(ORDER_ITEM_PROD_NOT_EXISTS);
}
// 前端实时计价时需要将订单的固定价格参数进行格式化,转为未定价,否则不会去查询当前实时价格
param.setProdConditionParamList(param.getProdConditionParamList().stream().peek(it -> it.setIsPriced(false)).collect(Collectors.toList()));
param.setProdConditionParamList(
param.getProdConditionParamList().stream().
peek(it -> it.setIsPriced(false)).
collect(Collectors.toList()));
//获取价格信息 lanbm 2024-06-20 添加注释
List<ProdConditionParam> prodConditionParams =
prodCostCalculation.obtainProdLineOnePrice(
param.getProdConditionParamList(),
......@@ -59,6 +70,7 @@ public class ProdLinePriceController {
param.getLineId(),
param.getChannelId(),
false);
CalculationCostResultDto dto =
prodCostCalculation.calculationProdCost(prodConditionParams,
"",
......
......@@ -63,7 +63,9 @@ public class ReceivableController {
@GetMapping("/getReceivableListByOrderId")
@ApiOperation("根据订单ID获得应收款列表")
@ApiImplicitParam(name = "id", value = "订单ID", required = true, example = "1024", dataTypeClass = Long.class)
public CommonResult<List<ReceivableBackVO>> getReceivableListByOrderId(@RequestParam("id") Long id) {
public CommonResult<List<ReceivableBackVO>> getReceivableListByOrderId(
@RequestParam("id") Long id) {
//lanbm 2024-06-20 添加注释
return success(receivableService.getReceivableListByOrderId(id));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment