Commit 90290cf4 authored by lanbaoming's avatar lanbaoming

Merge branch 'dev'

# Conflicts:
#	yudao-module-order/yudao-module-order-core/src/main/java/cn/iocoder/yudao/module/order/service/order/impl/OrderBusinessServiceImpl.java
parents f46ce85e 4859b972
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> {
}
package cn.iocoder.yudao.framework.toolkit;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
@TableName("z_test")
@Data
public class zTest {
private Long id;
private String testname;
private Date createdate;
}
......@@ -24,7 +24,12 @@ public class BmpShipmentBatchAddPriceListener extends BpmProcessInstanceResultEv
@Override
protected void onEvent(BpmProcessInstanceResultEvent event) {
log.info("---------------------批量加价审核回调-----------------------{},{}", event.getBusinessKey(), event.getResult());
boxApprovalService.updateBoxApproveResult(WorkFlowEmus.SHIPMENT_BATCH_ADD_PRICE.getKey(), event.getBusinessKey(), event.getResult());
log.info("---------------------批量加价审核回调-----------------------{},{}",
event.getBusinessKey(), event.getResult());
//lanbm 2024-06-18 改为空运和海运都有此逻辑点
//运费,清关费,币种,单位都要和元订单一致才能生效
boxApprovalService.updateBoxApproveResult(
WorkFlowEmus.SHIPMENT_BATCH_ADD_PRICE.getKey(),
event.getBusinessKey(), event.getResult());
}
}
......@@ -406,7 +406,7 @@ public class CustomerController {
@GetMapping("/get-wait-for-distribution")
@ApiOperation("获得待分配客户列表")
// @PreAuthorize("@ss.hasPermission('ecw:customer:query')")
//@PreAuthorize("@ss.hasPermission('ecw:customer:query')")
public CommonResult<PageResult<CustomerRespVO>> getWaitForDistributionList(@Valid CustomerPageReqDTO customerPageReqVO, PageVO page) {
//lanbm 2024-05-26 添加注释
PageResult<CustomerDO> pageResult =
......
......@@ -140,7 +140,7 @@ public class RegionController {
@GetMapping("/getListTree")
@ApiOperation("获得区域设置列表")
// @PreAuthorize("@ss.hasPermission('ecw:region:query')")
//@PreAuthorize("@ss.hasPermission('ecw:region:query')")
public CommonResult<List<RegionRespVO>> listTree(RegionListReqVO reqVO) {
List<RegionDO> list = regionService.getSimpleDepts(reqVO);
list.sort(Comparator.comparing(RegionDO::getSort));
......@@ -173,8 +173,10 @@ public class RegionController {
@GetMapping("/getTradeCityList")
@ApiOperation("获得始发、目的城市列表")
// @PreAuthorize("@ss.hasPermission('ecw:region:query')")
public CommonResult<List<RegionRespVO>> getTradeCityList(TradeRegionListReqVO reqVO) {
//@PreAuthorize("@ss.hasPermission('ecw:region:query')")
public CommonResult<List<RegionRespVO>> getTradeCityList(
TradeRegionListReqVO reqVO) {
if (Objects.nonNull(reqVO.getChannelId())){
// 如果有渠道信息,则查询可出目的地国家下的目的地城市
QueryChannelInfoEvent channelInfoEvent = new QueryChannelInfoEvent();
......
......@@ -1275,10 +1275,10 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (Objects.nonNull(oldCustomerService)) {
// 如果这里的旧客户经理id不为null,说明此客户属于移交新客户经理,但是新客户经理还未接收,业绩算老客户经理的
order.setSalesmanId(oldCustomerService);
} else if((customerDO.getIsInOpenSea() && Objects.nonNull(customerDO.getEnterOpenSeaTime())) || !customerDO.getIsCustomerServiceConfirmed()) { //客户还在公海上,和待接收的,不做业绩归属分配,归公司
} else if ((customerDO.getIsInOpenSea() && Objects.nonNull(customerDO.getEnterOpenSeaTime())) || !customerDO.getIsCustomerServiceConfirmed()) { //客户还在公海上,和待接收的,不做业绩归属分配,归公司
order.setSalesmanId(0L);
order.setCustomerId(0L);
}else {
} else {
addOrderSalesmanCustomerService(createReqVO, order);
}
AdminUserRespDTO adminUserRespDTO = adminUserApi.getUser(order.getSalesmanId());
......@@ -2112,7 +2112,8 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (Objects.nonNull(orderApprovalDO) && orderApprovalDO.getStatus() == 1) {
throw exception(YOUR_APPLY_PENDING);
}
if (Objects.equals(vo.getStatus(), OrderStatusEnum.DRAFT.getValue()) || Objects.equals(vo.getStatus(), OrderStatusEnum.ORDER_PLACED.getValue()) || Objects.equals(vo.getStatus(), OrderStatusEnum.WAREHOUSING.getValue())) {
if (Objects.equals(vo.getStatus(), OrderStatusEnum.DRAFT.getValue())
|| Objects.equals(vo.getStatus(), OrderStatusEnum.ORDER_PLACED.getValue()) || Objects.equals(vo.getStatus(), OrderStatusEnum.WAREHOUSING.getValue())) {
// 是草稿、已下单、入仓中状态 直接修改
this.updateOrder(updateReqVO, memberUserDO);
......@@ -2220,8 +2221,10 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
if (Objects.nonNull(consigneeContactsDO)) {
this.compareConsigneeInfo(updateReqVO, consigneeContactsDO, orderConsigneeBackVO, applyInfoList, vo, dictDataRespDTO);
}
if (vo.getIsCharge() || orderConsignorBackVO.getIsCharge() || orderConsigneeBackVO.getIsCharge()) {
// TODO 收发货人有变动,则可能业绩归属有变动, 此变动不放入审批详情,是根据收发货人的变动来实时调整业绩归属
if (vo.getIsCharge() || orderConsignorBackVO.getIsCharge() ||
orderConsigneeBackVO.getIsCharge()) {
// TODO 收发货人有变动,则可能业绩归属有变动, 此变动不放入审批详情,
// 是根据收发货人的变动来实时调整业绩归属
// 获取最早入仓时间,当入仓时间大于三天,则不允许再修改当前客户归属
OrderWarehouseInDO warehouseInDO = orderWarehouseInMapper.selectOne(new LambdaQueryWrapper<OrderWarehouseInDO>()
.eq(OrderWarehouseInDO::getOrderId, vo.getOrderId())
......@@ -2852,8 +2855,9 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
private void comparePerformanceAttribution(OrderBackVO
vo, List<ApplyInfoVO> applyInfoList, OrderConsignorBackVO orderConsignorBackVO,
private void comparePerformanceAttribution(OrderBackVO vo,
List<ApplyInfoVO> applyInfoList,
OrderConsignorBackVO orderConsignorBackVO,
OrderConsigneeBackVO orderConsigneeBackVO) {
// TODO 客户归属变动时记录日志
if (!Objects.equals(vo.getStatus(), OrderStatusEnum.DRAFT.getValue())) {
......@@ -2873,16 +2877,19 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
}
} else {
if (vo.getIsCargoControl()) {
if (!Objects.equals(vo.getCustomerId(), orderConsignorBackVO.getCustomerId())) {
if (!Objects.equals(vo.getCustomerId(),
orderConsignorBackVO.getCustomerId())) {
// 控货订单归属发货人
customerType = 1;
CustomerDO orgCustomerDO = customerService.getCustomer(vo.getCustomerId());
CustomerDO newCustomerDO = customerService.getCustomer(orderConsignorBackVO.getCustomerId());
infoVO = new ApplyInfoVO();
infoVO.setName("订单客户归属变动/Change in customer ownership for orders");
infoVO.setOrgValue(Objects.nonNull(orgCustomerDO) ? ((StringUtils.isNotBlank(orgCustomerDO.getName()) ? orgCustomerDO.getName() : "无") + "/" + (StringUtils.isNotBlank(orgCustomerDO.getNameEn()) ? orgCustomerDO.getNameEn() : "empty")) : "无/not have");
infoVO.setNewValue(Objects.nonNull(newCustomerDO) ? ((StringUtils.isNotBlank(newCustomerDO.getName()) ? newCustomerDO.getName() : "无") + "/" + (StringUtils.isNotBlank(newCustomerDO.getNameEn()) ? newCustomerDO.getNameEn() : "empty")) : "无/not have");
vo.setCustomerId(orderConsignorBackVO.getCustomerId());
infoVO.setName("新规则,控货订单客户归属不变动/Change in customer ownership for orders");
//lanbm 2024-06-18 出掉控货改变业绩归属的逻辑点
//infoVO.setOrgValue(Objects.nonNull(orgCustomerDO) ? ((StringUtils.isNotBlank(orgCustomerDO.getName()) ? orgCustomerDO.getName() : "无") + "/" + (StringUtils.isNotBlank(orgCustomerDO.getNameEn()) ? orgCustomerDO.getNameEn() : "empty")) : "无/not have");
//infoVO.setNewValue(Objects.nonNull(newCustomerDO) ? ((StringUtils.isNotBlank(newCustomerDO.getName()) ? newCustomerDO.getName() : "无") + "/" + (StringUtils.isNotBlank(newCustomerDO.getNameEn()) ? newCustomerDO.getNameEn() : "empty")) : "无/not have");
//vo.setCustomerId(orderConsignorBackVO.getCustomerId());
return;
}
} else {
// 非控货订单 + 付款人为发货人 归属发货人, 其他归属收货人
......@@ -3465,7 +3472,9 @@ public class OrderServiceImpl extends AbstractService<OrderMapper, OrderDO> impl
//
// }
// 更新所属客户经理(业务员)
if (!OrderStatusEnum.DRAFT.getValue().equals(updateObj.getStatus()) && Objects.nonNull(updateObj.getCustomerId()) && updateObj.getCustomerId() > 0) {
if (!OrderStatusEnum.DRAFT.getValue().equals(updateObj.getStatus())
&& Objects.nonNull(updateObj.getCustomerId()) &&
updateObj.getCustomerId() > 0) {
addOrderCustomerService(updateObj, customerType);
}
}
......
......@@ -342,7 +342,8 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
// 判断是否有未处理的审核单
throwProcessingApproval(orderDO);
this.validateProdAttrAccess(createReqVO.getProdId(), orderDO.getOrderNo());
this.validateProdAttrAccess(createReqVO.getProdId(),
orderDO.getOrderNo());
validateWarehouseInItem(orderDO,
......@@ -381,7 +382,10 @@ public class OrderWarehouseInServiceImpl extends AbstractService<OrderWarehouseI
orderService.orderInWarehouse(orderWarehouseInVO);
// 更新订单状态 - 入库中
orderService.updateStatus(orderId, orderDO.getOrderNo(), OrderStatusEnum.WAREHOUSING.getValue(), null, OrderWarehouseInStatusEnum.warehousing.getValue(), null, null, null, false);
orderService.updateStatus(orderId, orderDO.getOrderNo(),
OrderStatusEnum.WAREHOUSING.getValue(),
null,
OrderWarehouseInStatusEnum.warehousing.getValue(), null, null, null, false);
// 纪录操作日志
if (createReqVO.getIsAddOrderOperateLog()) {
......
......@@ -1219,9 +1219,7 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
//查询产品价格信息 lanbm 2024-05-31 添加注释
List<ProductPriceDO> priceList =
getProductPriceList(productPriceIdList);
List<ProductPriceDO> needHandleList = new ArrayList<>();
Date now = new Date();
for (ProductPriceDO productPriceDO : priceList) {
......@@ -1229,21 +1227,26 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
Date validateEndDate = productPriceDO.getValidateEndDate();
boolean hasPrice = false;
if (productPriceDO.getPriceType() == 0) {
//运费和清关价
BigDecimal transportPrice = productPriceDO.getTransportPrice();
hasPrice = transportPrice != null &&
transportPrice.floatValue() > 0;
} else if (productPriceDO.getPriceType() == 1) {
//全包价
BigDecimal allPrice = productPriceDO.getAllPrice();
hasPrice = allPrice != null && allPrice.floatValue() > 0;
if (productPriceDO.getPriceType() != null) {
if (productPriceDO.getPriceType() == 0) {
//运费和清关价
BigDecimal transportPrice = productPriceDO.getTransportPrice();
hasPrice = transportPrice != null &&
transportPrice.floatValue() > 0;
} else if (productPriceDO.getPriceType() == 1) {
//全包价
BigDecimal allPrice = productPriceDO.getAllPrice();
hasPrice = allPrice != null && allPrice.floatValue() > 0;
}
}
//lanbm 2024-06-06 处理单询价问题添加的逻辑点。
if (productPriceDO.getNeedOrderInquiry() == 1) {
hasPrice = true;
if (productPriceDO.getNeedOrderInquiry() != null) {
if (productPriceDO.getNeedOrderInquiry() == 1) {
hasPrice = true;
}
}
//没有价格信息不继续后面的处理
......@@ -3403,10 +3406,15 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
@Override
@Transactional(rollbackFor = Exception.class)
public void copyPriceByProductIds(CopyProductPriceDto dto) {
List<Long> ids = Arrays.stream(dto.getProductPriceIds().split(StrUtil.COMMA)).map(Long::parseLong).collect(Collectors.toList());
List<Long> ids = Arrays.stream(dto.getProductPriceIds().
split(StrUtil.COMMA)).map(Long::parseLong).collect(Collectors.toList());
//列出要复制的商品价格
List<ProductPriceDO> productPriceDOList = this.productPriceMapper.selectList(new LambdaQueryWrapper<ProductPriceDO>().in(ProductPriceDO::getId, ids));
List<ProductPriceDO> productPriceDOList =
this.productPriceMapper.selectList(
new LambdaQueryWrapper<ProductPriceDO>().
in(ProductPriceDO::getId, ids));
if (productPriceDOList.size() > 0) {
productPriceDOList.forEach(price -> {
......@@ -3568,7 +3576,8 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
//ProductDO productDO = checkUpdateStatus(lineChannelList, createReqVO.getProductId());
ProductDO productDO = productService.getProduct(createReqVO.getProductId());
WarehouseLineSearchVO searchVO = new WarehouseLineSearchVO();
List<WarehouseLineDO> warehouseLineList = warehouseService.openedRouterList(searchVO);
List<WarehouseLineDO> warehouseLineList =
warehouseService.openedRouterList(searchVO);
List<ProductDO> productList = Collections.singletonList(productDO);
//商品线路保存在redis。更新成功后移除
......@@ -3576,7 +3585,10 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
createReqVO.setSync(true);
createReqVO.setBatch(false);
copyPriceUpdateAir(createReqVO, warehouseLineList, productList, price);
copyPriceUpdateAir(createReqVO,
warehouseLineList,
productList,
price);
});
}
......@@ -3704,7 +3716,8 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
log.info("路线处理耗时:" + (t2 - t1));
deleteKey(idList, lineChannelList);
handleOrderException(productPriceIdList, createReqVO.isSync());
handleOrderException(productPriceIdList,
createReqVO.isSync());
}
private void copyClearAndSavePriceStepList(List<Long> productPriceIdList, List<ProductPriceStepDO> stepList, Map<Long, String> priceTransportTypeMap, boolean batchUpdate) {
......
......@@ -73,10 +73,12 @@
AND FIND_IN_SET(#{params.attrId}, ep.attr_id)
</if>
<!--运输方式-->
<if test="params.transportType != null and params.transportType != ''">
and ewl.transport_type = #{params.transportType}
</if>
<!--出货渠道-->
<if test="params.shippingChannelId != null">
and epp.shipping_channel_id = #{params.shippingChannelId}
</if>
......@@ -93,6 +95,7 @@
and epp.need_pay = #{params.needPay}
</if>
<!--价格类型 0是运费加清关费,1是全包价-->
<if test="params.priceType != null">
and epp.price_type = #{params.priceType}
</if>
......@@ -414,4 +417,4 @@
</select>
</mapper>
\ No newline at end of file
</mapper>
......@@ -62,14 +62,16 @@ public class ProductPriceController {
@ApiOperation("创建路线产品")
@PreAuthorize("@ss.hasPermission('ecw:product-price:create')")
@Idempotent(timeout = 5)
public CommonResult<Long> createProductPrice(@Valid @RequestBody ProductPriceCreateReqVO createReqVO) {
public CommonResult<Long> createProductPrice(
@Valid @RequestBody ProductPriceCreateReqVO createReqVO) {
return success(productPriceService.singleCreate(createReqVO));
}
@PostMapping("/createAir")
@ApiOperation("创建路线产品空运")
@Idempotent(timeout = 5)
public CommonResult<Long> createProductPriceAir(@Valid @RequestBody ProductPriceAirCreateReqVO createReqVO) {
public CommonResult<Long> createProductPriceAir(
@Valid @RequestBody ProductPriceAirCreateReqVO createReqVO) {
return success(productPriceService.singleCreateAir(createReqVO));
}
......@@ -97,7 +99,8 @@ public class ProductPriceController {
@PutMapping("/updateAir")
@ApiOperation("更新空运路线产品")
@Idempotent(timeout = 5)
public CommonResult<Boolean> updateProductPriceAir(@Valid @RequestBody ProductPriceAirUpdateReqVO productPriceAirUpdateReqVO) {
public CommonResult<Boolean> updateProductPriceAir(
@Valid @RequestBody ProductPriceAirUpdateReqVO productPriceAirUpdateReqVO) {
productPriceService.updateProductPriceAir(productPriceAirUpdateReqVO);
return success(true);
}
......@@ -210,7 +213,8 @@ public class ProductPriceController {
@ApiOperation("批量拉黑")
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)
// @PreAuthorize("@ss.hasPermission('ecw:product-price:batchBlock')")
public CommonResult<Boolean> batchBlock(@RequestParam("ids") Collection<Long> ids) {
public CommonResult<Boolean> batchBlock(
@RequestParam("ids") Collection<Long> ids) {
productPriceService.batchBlock(ids);
return success(true);
}
......@@ -218,9 +222,14 @@ public class ProductPriceController {
@GetMapping("/page")
@ApiOperation("获得路线产品分页")
@PreAuthorize("@ss.hasPermission('ecw:product-price:query')")
public CommonResult<PageResult<ProductPriceRespVO>> getProductPricePage(@Valid ProductPricePageReqVO pageVO) {
PageResult<ProductPriceDO> pageResult = productPriceService.getProductPricePage(pageVO);
PageResult<ProductPriceRespVO> respPageResult = ProductPriceConvert.INSTANCE.convertPage(pageResult);
public CommonResult<PageResult<ProductPriceRespVO>> getProductPricePage(
@Valid ProductPricePageReqVO pageVO) {
PageResult<ProductPriceDO> pageResult =
productPriceService.getProductPricePage(pageVO);
PageResult<ProductPriceRespVO> respPageResult =
ProductPriceConvert.INSTANCE.convertPage(pageResult);
productPriceService.matchLineAndProduct(respPageResult.getList());
return success(respPageResult);
}
......@@ -284,6 +293,7 @@ public class ProductPriceController {
/**
* 从商品列表中某一商品进入复制价格
* @param dto
* lanbm 2024-06-19 添加注释
*/
@ApiOperation("从商品列表中某一商品进入复制价格")
@PostMapping("/copyPriceByProductIds")
......
......@@ -49,6 +49,7 @@ import cn.iocoder.yudao.module.member.api.user.dto.UserRespDTO;
import cn.iocoder.yudao.module.order.convert.orderLocation.OrderLocationConvert;
import cn.iocoder.yudao.module.order.dal.dataobject.approval.OrderApprovalDO;
import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO;
import cn.iocoder.yudao.module.order.dal.dataobject.order.zTest;
import cn.iocoder.yudao.module.order.dal.dataobject.orderCargoControl.OrderCargoControlDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderConsignee.OrderConsigneeDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderConsignor.OrderConsignorDO;
......@@ -56,6 +57,7 @@ import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderLocation.OrderLocationDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderSplit.OrderSplitDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderSplitItem.OrderSplitItemDO;
import cn.iocoder.yudao.module.order.dal.mysql.order.ZTestMapper2;
import cn.iocoder.yudao.module.order.dal.mysql.orderSplitItem.OrderSplitItemMapper;
import cn.iocoder.yudao.module.order.dto.ContainerNumberSummaryDto;
import cn.iocoder.yudao.module.order.dto.OrderRemindExceptionDto;
......@@ -234,6 +236,9 @@ import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.DEPT_NOT_F
@Slf4j
public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements BoxService {
@Resource
private ZTestMapper2 zTestMapper2;
@Resource
private BoxMapper boxMapper;
......@@ -2550,7 +2555,7 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
long orderExitNum = boxOrderExitService.count(
new LambdaQueryWrapper<BoxOrderExitDO>()
.eq(BoxOrderExitDO::getShipmentId, shipmentId)
.eq(BoxOrderExitDO::getShipmentId, shipmentId)
);
boxBackVO.setOrderExitNum(orderExitNum);
}
......@@ -3453,33 +3458,36 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
.map(BoxAbnormalDO::getShipmentId)
.collect(Collectors.toList());
List<BoxDO> boxList = getBoxList(shipmentIdList);
Map<Long, BoxDO> boxMap = boxList.stream()
.collect(Collectors.toMap(BoxDO::getId, v -> v));
for (BoxAbnormalDO abnormalDO : abnormalList) {
String notifyUsers = abnormalDO.getNotifyUsers();
if (notifyUsers == null) continue;
Long shipmentId = abnormalDO.getShipmentId();
Integer opStep = abnormalDO.getOpStep();
BoxDO boxDO = boxMap.get(shipmentId);
String transportType = boxDO.getTransportType();
if (CollectionUtil.isNotEmpty(transportTypeList)) {
if (!transportTypeList.contains(transportType)) continue;
}
if (CollectionUtil.isNotEmpty(boxList)) {
Map<Long, BoxDO> boxMap = boxList.stream()
.collect(Collectors.toMap(BoxDO::getId, v -> v));
for (BoxAbnormalDO abnormalDO : abnormalList) {
String notifyUsers = abnormalDO.getNotifyUsers();
if (notifyUsers == null) continue;
Long shipmentId = abnormalDO.getShipmentId();
Integer opStep = abnormalDO.getOpStep();
BoxDO boxDO = boxMap.get(shipmentId);
String transportType = boxDO.getTransportType();
if (CollectionUtil.isNotEmpty(transportTypeList)) {
if (!transportTypeList.contains(transportType)) continue;
}
String[] userArray = notifyUsers.split(",");
NoticeTypeEnum typeEnum = null;
if (opStep.equals(AbnormalStepEnum.CUSTOMS.getStep())) {
typeEnum = NoticeTypeEnum.ABNORMAL_CUSTOMS;
} else if (opStep.equals(AbnormalStepEnum.SHIPPING.getStep())) {
typeEnum = NoticeTypeEnum.ABNORMAL_SHIPPING;
} else if (opStep.equals(AbnormalStepEnum.ARRIVAL.getStep())) {
typeEnum = NoticeTypeEnum.ABNORMAL_ARRIVAL;
}
Date noticeTime = abnormalDO.getAbnEndTime();
for (String userId : userArray) {
if (!userId.equals(loginUserId.toString())) continue;
noticeList.add(addNotice(typeEnum, boxDO, noticeTime));
String[] userArray = notifyUsers.split(",");
NoticeTypeEnum typeEnum = null;
if (opStep.equals(AbnormalStepEnum.CUSTOMS.getStep())) {
typeEnum = NoticeTypeEnum.ABNORMAL_CUSTOMS;
} else if (opStep.equals(AbnormalStepEnum.SHIPPING.getStep())) {
typeEnum = NoticeTypeEnum.ABNORMAL_SHIPPING;
} else if (opStep.equals(AbnormalStepEnum.ARRIVAL.getStep())) {
typeEnum = NoticeTypeEnum.ABNORMAL_ARRIVAL;
}
Date noticeTime = abnormalDO.getAbnEndTime();
for (String userId : userArray) {
if (!userId.equals(loginUserId.toString())) continue;
noticeList.add(addNotice(typeEnum, boxDO, noticeTime));
}
}
}
}
......@@ -4948,10 +4956,21 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
if (StringUtils.isEmpty(details)) {
throw new ServiceException(500, "加价详情不能为空");
}
BoxOrderMarkUpVO boxOrderMarkUpVO = JSON.parseObject(details, BoxOrderMarkUpVO.class);
orderBusinessService.handleAirOrderBatchMarkup(boxOrderMarkUpVO.getOrderIds(), boxOrderMarkUpVO.getFreightFee(),
boxOrderMarkUpVO.getFreightCurrencyId(), boxOrderMarkUpVO.getFreightUnitId(),
boxOrderMarkUpVO.getClearanceFee(), boxOrderMarkUpVO.getClearanceCurrencyId(),
BoxOrderMarkUpVO boxOrderMarkUpVO =
JSON.parseObject(details, BoxOrderMarkUpVO.class);
zTest z=new zTest();
z.setTestname("开始调用 handleAirOrderBatchMarkup");
z.setCreatedate(new Date());
zTestMapper2.insert(z);
orderBusinessService.handleAirOrderBatchMarkup(
boxOrderMarkUpVO.getOrderIds(),
boxOrderMarkUpVO.getFreightFee(),
boxOrderMarkUpVO.getFreightCurrencyId(),
boxOrderMarkUpVO.getFreightUnitId(),
boxOrderMarkUpVO.getClearanceFee(),
boxOrderMarkUpVO.getClearanceCurrencyId(),
boxOrderMarkUpVO.getClearanceUnitId());
}
......@@ -4970,7 +4989,8 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
@Override
public void checkIsInClearance(Long shipmentId, Long orderId) {
BoxClearanceOrderDO clearanceOrderDO = boxClearanceOrderService.getOne(new LambdaQueryWrapper<BoxClearanceOrderDO>()
BoxClearanceOrderDO clearanceOrderDO =
boxClearanceOrderService.getOne(new LambdaQueryWrapper<BoxClearanceOrderDO>()
.eq(BoxClearanceOrderDO::getShipmentId, shipmentId)
.eq(BoxClearanceOrderDO::getOrderId, orderId)
);
......@@ -4998,20 +5018,28 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
@Override
public void checkOrderPayStatus(Collection<Long> orderIds) {
if (CollectionUtil.isEmpty(orderIds)) return;
List<ReceivableDO> receivableList = receivableService.getOrderPayList(orderIds);
List<OrderDO> orderList = orderQueryService.getOrderList(orderIds);
List<ReceivableDO> receivableList =
receivableService.getOrderPayList(orderIds);
List<OrderDO> orderList =
orderQueryService.getOrderList(orderIds);
Map<Long, OrderDO> orderMap = orderList.stream()
.collect(Collectors.toMap(OrderDO::getOrderId, v -> v));
List<String> payOrderNoList = new ArrayList<>();
if (CollectionUtil.isNotEmpty(receivableList)) {
Map<Long, List<ReceivableDO>> receivableMap = receivableList.stream()
.collect(Collectors.groupingBy(ReceivableDO::getOrderId));
for (Map.Entry<Long, List<ReceivableDO>> entry : receivableMap.entrySet()) {
for (Map.Entry<Long,
List<ReceivableDO>> entry : receivableMap.entrySet()) {
Long orderId = entry.getKey();
OrderDO orderDO = orderMap.get(orderId);
payOrderNoList.add(orderDO.getOrderNo());
}
throw new ServiceException(500, Joiner.on(",").join(payOrderNoList) + "已预付核销,不允许修改价格");
throw new ServiceException(500,
Joiner.on(",").join(payOrderNoList) + "已预付核销,不允许修改价格");
}
}
......
......@@ -15,8 +15,10 @@ import cn.iocoder.yudao.module.bpm.resp.TaskResp;
import cn.iocoder.yudao.module.ecw.service.internalMessage.InternalMessageService;
import cn.iocoder.yudao.module.ecw.vo.internalMessage.InternalMessageCreateReqVO;
import cn.iocoder.yudao.module.order.dal.dataobject.order.OrderDO;
import cn.iocoder.yudao.module.order.dal.dataobject.order.zTest;
import cn.iocoder.yudao.module.order.dal.dataobject.orderItem.OrderItemDO;
import cn.iocoder.yudao.module.order.dal.dataobject.orderSplitItem.OrderSplitItemDO;
import cn.iocoder.yudao.module.order.dal.mysql.order.ZTestMapper2;
import cn.iocoder.yudao.module.order.enums.*;
import cn.iocoder.yudao.module.order.service.targetLog.TargetLogService;
import cn.iocoder.yudao.module.order.vo.order.CostVO;
......@@ -74,6 +76,9 @@ import static cn.iocoder.yudao.module.shipment.enums.ErrorCodeConstants.*;
@Validated
public class BoxApprovalServiceImpl extends AbstractService<BoxApprovalMapper, BoxApprovalDO> implements BoxApprovalService {
@Resource
private ZTestMapper2 zTestMapper2;
@Resource
private BoxApprovalMapper boxApprovalMapper;
@Resource
......@@ -604,10 +609,14 @@ public class BoxApprovalServiceImpl extends AbstractService<BoxApprovalMapper, B
@Override
@Transactional(rollbackFor = Exception.class)
public void updateBoxApproveResult(String flowKey, String id, int result) {
public void updateBoxApproveResult(String flowKey,
String id,
int result) {
BoxApprovalDO boxApprovalDO = boxApprovalMapper.selectById(id);
TaskResp taskResp = bpmCreateServiceFactory.getLastTaskByProcessInstanceId(boxApprovalDO.getBpmProcessId());
TaskResp taskResp =
bpmCreateServiceFactory.getLastTaskByProcessInstanceId(boxApprovalDO.getBpmProcessId());
Long shipmentId = boxApprovalDO.getShipmentId();
BoxDO boxDO = boxService.getBox(shipmentId);
......@@ -1145,9 +1154,27 @@ public class BoxApprovalServiceImpl extends AbstractService<BoxApprovalMapper, B
//======================批量加价格=======================
case SHIPMENT_BATCH_ADD_PRICE:
//批量加价格
//lanbm 2024-06-18 添加注释 是给自编号下的订单加价
if (result == BpmProcessInstanceResultEnum.APPROVE.getResult()) {
String details = boxApprovalDO.getDetails();
BoxOrderMarkUpVO boxOrderMarkUpVO = JSON.parseObject(details, BoxOrderMarkUpVO.class);
BoxOrderMarkUpVO boxOrderMarkUpVO =
JSON.parseObject(details, BoxOrderMarkUpVO.class);
if(boxOrderMarkUpVO.getOrderIds()!=null)
{
String s=String.valueOf(boxOrderMarkUpVO.getOrderIds());
zTest z=new zTest();
z.setTestname("订单id,"+s);
z.setCreatedate(new Date());
zTestMapper2.insert(z);
}
else
{
String s=String.valueOf(boxOrderMarkUpVO.getOrderIds());
zTest z=new zTest();
z.setTestname("批量加价申报批,订单id为空");
z.setCreatedate(new Date());
zTestMapper2.insert(z);
}
boxService.checkOrderPayStatus(boxOrderMarkUpVO.getOrderIds());
boxService.batchAddPriceSuccess(shipmentId, details);
}
......
......@@ -675,7 +675,8 @@ public class BoxOrderCheckInfoServiceImpl extends AbstractService<BoxOrderCheckI
return tagList;
}
private List<BoxOrderCheckInfoDO> getOrderTagNumCaseList(OrderDO orderDO, List<OrderLabelDO> orderLabelList) {
private List<BoxOrderCheckInfoDO> getOrderTagNumCaseList(
OrderDO orderDO, List<OrderLabelDO> orderLabelList) {
//从OrderLabel里面查找订单的箱号
String orderNo = orderDO.getOrderNo();
List<BoxOrderCheckInfoDO> tagList = new ArrayList<>();
......
......@@ -855,7 +855,8 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
}
@Override
public BoxGoodsStatistics calculationStatisticsByOrderList(Collection<OrderDO> orderDOList) {
public BoxGoodsStatistics calculationStatisticsByOrderList(
Collection<OrderDO> orderDOList) {
BoxGoodsStatistics boxGoodsStatistics = new BoxGoodsStatistics();
if (CollectionUtil.isEmpty(orderDOList)) {
return boxGoodsStatistics;
......@@ -865,17 +866,19 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
BigDecimal volumeSum = boxGoodsStatistics.getVolume();
BigDecimal weightSum = boxGoodsStatistics.getWeight();
if (orderDO.getSumNum() != null) {
numSum += orderDO.getSumNum();
boxGoodsStatistics.setNum(numSum);
}
if (orderDO.getSumVolume() != null) {
volumeSum = volumeSum.add(orderDO.getSumVolume()).setScale(2, BigDecimal.ROUND_DOWN);
boxGoodsStatistics.setVolume(volumeSum);
}
if (orderDO.getSumWeight() != null) {
weightSum = weightSum.add(orderDO.getSumWeight()).setScale(2, BigDecimal.ROUND_DOWN);
boxGoodsStatistics.setWeight(weightSum);
if(orderDO!=null) {
if (orderDO.getSumNum() != null) {
numSum += orderDO.getSumNum();
boxGoodsStatistics.setNum(numSum);
}
if (orderDO.getSumVolume() != null) {
volumeSum = volumeSum.add(orderDO.getSumVolume()).setScale(2, BigDecimal.ROUND_DOWN);
boxGoodsStatistics.setVolume(volumeSum);
}
if (orderDO.getSumWeight() != null) {
weightSum = weightSum.add(orderDO.getSumWeight()).setScale(2, BigDecimal.ROUND_DOWN);
boxGoodsStatistics.setWeight(weightSum);
}
}
}
return boxGoodsStatistics;
......@@ -3160,6 +3163,7 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
List<Long> preloadOrderIds = boxPreloadGoodsDOS.stream().map(BoxPreloadGoodsDO::getOrderId).distinct().collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(boxMergePkgDOS)) {
for (BoxMergePkgDO boxMergePkgDO : boxMergePkgDOS) {
List<BoxPkgOrderDO> boxPkgOrderDOS = boxPkgOrderService.selectList(BoxPkgOrderDO::getPkgId, boxMergePkgDO.getId());
if (CollectionUtil.isNotEmpty(boxPkgOrderDOS)) {
List<Long> orderIds = boxPkgOrderDOS.stream().map(BoxPkgOrderDO::getOrderId).collect(Collectors.toList());
......
......@@ -49,7 +49,8 @@ public class BoxMergePkgController {
@PostMapping("/create")
@ApiOperation("创建合包箱")
//@PreAuthorize("@ss.hasPermission('ecw:box-merge-pkg:create')")
public CommonResult<String> createBoxMergePkg(@Valid @RequestBody BoxMergePkgCreateReqVO createReqVO) {
public CommonResult<String> createBoxMergePkg(
@Valid @RequestBody BoxMergePkgCreateReqVO createReqVO) {
return success(boxMergePkgService.createBoxMergePkg(createReqVO));
}
......@@ -101,7 +102,8 @@ public class BoxMergePkgController {
@ApiOperation("获得合包箱分页")
//@PreAuthorize("@ss.hasPermission('ecw:box-merge-pkg:query')")
public CommonResult<PageResult<BoxMergePkgPageDto>> getBoxMergePkgPage(@Valid BoxMergePkgQueryVO query, PageVO page) {
PageResult<BoxMergePkgPageDto> pageResult = boxMergePkgService.getBoxMergePkgPage(query, page);
PageResult<BoxMergePkgPageDto> pageResult =
boxMergePkgService.getBoxMergePkgPage(query, page);
return success(pageResult);
}
......@@ -109,7 +111,8 @@ public class BoxMergePkgController {
@ApiOperation("获得未装箱列表分页")
// //@PreAuthorize("@ss.hasPermission('ecw:box-merge-pkg:query')")
public CommonResult<PageResult<BoxMergePkgWebVO>> getUnPkgPage(PageVO page,@RequestParam("shipmentId") Long shipmentId) {
PageResult<BoxMergePkgWebVO> pageResult = boxMergePkgService.getUnPkgPage(page,shipmentId);
PageResult<BoxMergePkgWebVO> pageResult =
boxMergePkgService.getUnPkgPage(page,shipmentId);
return success(pageResult);
}
......
......@@ -162,8 +162,10 @@ public class ReceivableServiceImpl extends AbstractService<ReceivableMapper, Rec
if (receivable.getDeleted()) {
throw exception(RECEIVABLE_DELETED);
}
//收款状态(0未收款,1收款中,2已收款)
if (receivable.getState() != 0) {
throw exception(RECEIVABLE_WRITE_OFF_ING);
//lanbm 2024-06-19 取消此逻辑
//throw exception(RECEIVABLE_WRITE_OFF_ING);
}
updateReqVO.setUpdateTime(new Date());
updateReqVO.setUpdater(String.valueOf(SecurityFrameworkUtils.getLoginUserId()));
......
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