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());
}
}
......@@ -11,10 +11,10 @@
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts s
where s.deleted = 0 and s.customer_id=contact.id) as all_contact_phone
from (select a.*,
c.name as default_contact_name,
<!--concat(c.area_code, c.phone_new, '') as default_contact_phone,-->
c.name as default_contact_name2,
concat(c.area_code, c.phone_new, '') as default_contact_phone,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone,
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social,
......@@ -67,9 +67,9 @@
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts s where s.deleted = 0 and s.customer_id=contact.id) as all_contact_phone
from (select a.*,
c.name as default_contact_name,
<!-- concat(c.area_code, c.phone_new, '') as default_contact_phone,-->
concat(c.area_code, c.phone_new, '') as default_contact_phone,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone,
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social,
......@@ -108,9 +108,9 @@
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts s where s.deleted = 0 and s.customer_id=contact.id) as all_contact_phone
from (select a.*,
c.name as default_contact_name,
<!--concat(c.area_code, c.phone_new, '') as default_contact_phone,-->
concat(c.area_code, c.phone_new, '') as default_contact_phone,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone,
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social,
......@@ -149,9 +149,9 @@
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts s where s.deleted = 0 and s.customer_id=contact.id) as all_contact_phone
from (select a.*,
c.name as default_contact_name,
<!--concat(c.area_code, c.phone_new, '') as default_contact_phone,-->
concat(c.area_code, c.phone_new, '') as default_contact_phone,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone,
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social,
......@@ -186,6 +186,8 @@
from (select a.*,
c.name as default_contact_name,
concat(c.area_code, c.phone_new, '') as default_contact_phone,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social,
......@@ -219,7 +221,7 @@
AND contact.name LIKE concat('%', concat( #{query.name}, '%' ))
</if>
<if test="query.defaultContactPhone != null and query.defaultContactPhone != '' ">
AND contact.default_contact_phone LIKE concat('%', concat( #{query.defaultContactPhone}, '%' ))
AND contact.default_contact_phone2 LIKE concat('%', concat( #{query.defaultContactPhone}, '%' ))
</if>
<if test="query.defaultContactName != null and query.defaultContactName != '' ">
AND contact.all_contact_phone LIKE concat('%', concat( #{query.defaultContactName}, '%' ))
......@@ -408,9 +410,9 @@
where s.deleted = 0 and s.customer_id=contact.id) as all_contact_phone
from (select a.*,
c.name as default_contact_name,
<!-- concat(c.area_code, c.phone_new, '') as default_contact_phone,-->
concat(c.area_code, c.phone_new, '') as default_contact_phone,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone,
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social,
......@@ -440,9 +442,9 @@
select count(1)
from (select a.*,
c.name as default_contact_name,
<!--concat(c.area_code, c.phone_new, '') as default_contact_phone,-->
concat(c.area_code, c.phone_new, '') as default_contact_phone,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone,
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social,
......@@ -473,7 +475,7 @@
AND contact.name LIKE concat('%', concat( #{query.name}, '%' ))
</if>
<if test="query.defaultContactPhone != null and query.defaultContactPhone != '' ">
AND contact.default_contact_phone LIKE concat('%', concat( #{query.defaultContactPhone}, '%' ))
AND contact.default_contact_phone2 LIKE concat('%', concat( #{query.defaultContactPhone}, '%' ))
</if>
<if test="query.defaultContactName != null and query.defaultContactName != '' ">
AND contact.all_contact_phone LIKE concat('%', concat( #{query.defaultContactName}, '%' ))
......@@ -670,9 +672,9 @@
credit.name_en as credit_level_name_en
from (select a.*,
c.name as default_contact_name,
<!-- concat(c.area_code, c.phone_new, '') as default_contact_phone,-->
concat(c.area_code, c.phone_new, '') as default_contact_phone,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone,
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2,
c.social as default_social,
c.email as default_email,
c.social_number as default_social_number
......@@ -1378,9 +1380,9 @@
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts s where s.deleted = 0 and s.customer_id=contact.id) as all_contact_phone
from (select a.*,
c.name as default_contact_name,
<!--concat(c.area_code, c.phone_new, '') as default_contact_phone,-->
concat(c.area_code, c.phone_new, '') as default_contact_phone,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone,
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social,
......@@ -1412,9 +1414,9 @@
select count(1)
from (select a.*,
c.name as default_contact_name,
<!-- concat(c.area_code, c.phone_new, '') as default_contact_phone,-->
concat(c.area_code, c.phone_new, '') as default_contact_phone,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone,
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social,
......@@ -1450,9 +1452,9 @@
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts s where s.deleted = 0 and s.customer_id=contact.id) as all_contact_phone
from (select a.*,
c.name as default_contact_name,
<!--concat(c.area_code, c.phone_new, '') as default_contact_phone,-->
concat(c.area_code, c.phone_new, '') as default_contact_phone,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone,
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social,
......@@ -1487,9 +1489,9 @@
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts s where s.deleted = 0 and s.customer_id=contact.id) as all_contact_phone
from (select a.*,
c.name as default_contact_name,
<!-- concat(c.area_code, c.phone_new, '') as default_contact_phone,-->
concat(c.area_code, c.phone_new, '') as default_contact_phone,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone,
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social,
......@@ -1522,9 +1524,9 @@
select count(1)
from (select a.*,
c.name as default_contact_name,
<!-- concat(c.area_code, c.phone_new, '') as default_contact_phone,-->
concat(c.area_code, c.phone_new, '') as default_contact_phone,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone,
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social,
......@@ -1558,9 +1560,9 @@
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts s where s.deleted = 0 and s.customer_id=contact.id) as all_contact_phone
from (select a.*,
c.name as default_contact_name,
<!-- concat(c.area_code, c.phone_new, '') as default_contact_phone,-->
concat(c.area_code, c.phone_new, '') as default_contact_phone,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone,
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social,
......@@ -1594,9 +1596,9 @@
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts s where s.deleted = 0 and s.customer_id=contact.id) as all_contact_phone
from (select a.*,
c.name as default_contact_name,
<!-- concat(c.area_code, c.phone_new, '') as default_contact_phone,-->
concat(c.area_code, c.phone_new, '') as default_contact_phone,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone,
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social,
......@@ -1631,9 +1633,9 @@
select count(1)
from (select a.*,
c.name as default_contact_name,
<!--concat(c.area_code, c.phone_new, '') as default_contact_phone,-->
concat(c.area_code, c.phone_new, '') as default_contact_phone,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone,
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social,
......@@ -1669,9 +1671,9 @@
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts s where s.deleted = 0 and s.customer_id=contact.id) as all_contact_phone
from (select a.*,
c.name as default_contact_name,
<!--concat(c.area_code, c.phone_new, '') as default_contact_phone,-->
concat(c.area_code, c.phone_new, '') as default_contact_phone,
(select GROUP_CONCAT(s.phone_new) from ecw_customer_contacts
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone,
s where s.deleted = 0 and s.customer_id=a.id) as default_contact_phone2,
c.phone_new as contactPhone,
c.id as defaultContactId,
c.social as default_social,
......
......@@ -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,6 +1227,8 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
Date validateEndDate = productPriceDO.getValidateEndDate();
boolean hasPrice = false;
if (productPriceDO.getPriceType() != null) {
if (productPriceDO.getPriceType() == 0) {
//运费和清关价
BigDecimal transportPrice = productPriceDO.getTransportPrice();
......@@ -1240,11 +1240,14 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
BigDecimal allPrice = productPriceDO.getAllPrice();
hasPrice = allPrice != null && allPrice.floatValue() > 0;
}
}
//lanbm 2024-06-06 处理单询价问题添加的逻辑点。
if (productPriceDO.getNeedOrderInquiry() != null) {
if (productPriceDO.getNeedOrderInquiry() == 1) {
hasPrice = true;
}
}
//没有价格信息不继续后面的处理
if (!hasPrice) continue;
......@@ -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>
......
......@@ -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;
......@@ -3453,6 +3458,8 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
.map(BoxAbnormalDO::getShipmentId)
.collect(Collectors.toList());
List<BoxDO> boxList = getBoxList(shipmentIdList);
if (CollectionUtil.isNotEmpty(boxList)) {
Map<Long, BoxDO> boxMap = boxList.stream()
.collect(Collectors.toMap(BoxDO::getId, v -> v));
......@@ -3483,6 +3490,7 @@ public class BoxServiceImpl extends AbstractService<BoxMapper, BoxDO> implements
}
}
}
}
//3.agent提醒
//查找已预装未设置agent的出货
......@@ -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);
}
......
......@@ -136,16 +136,20 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
@Transactional(rollbackFor = Exception.class)
public String createBoxMergePkg(BoxMergePkgCreateReqVO createReqVO) {
BoxDO boxDO = boxService.getById(createReqVO.getShipmentId());
//校验业务逻辑
checkBoxApproval(createReqVO.getShipmentId());
RegionDO region = regionService.getRegion(warehouseService.getWarehouse(boxDO.getDestWarehouseId()).getShi());
RegionDO region = regionService.getRegion(
warehouseService.getWarehouse(boxDO.getDestWarehouseId()).getShi());
String year = DateUtil.format(new Date(), "yy");
DecimalFormat df = new DecimalFormat("0000");
Integer num = createReqVO.getNum();
if (region == null || StringUtils.isBlank(region.getLabelCode())) {
throw exception(COUNTRY_LABEL_CODE_NOT_EXISTS);
}
String code = region.getLabelCode().substring(0,1);
BoxMergePkgNumRecordDO boxMergePkgNumRecordDO = boxMergePkgNumRecordMapper.selectOne(BoxMergePkgNumRecordDO::getDestCountryId, boxDO.getDestCountryId());
String code = region.getLabelCode().substring(0, 1);
BoxMergePkgNumRecordDO boxMergePkgNumRecordDO =
boxMergePkgNumRecordMapper.selectOne(BoxMergePkgNumRecordDO::getDestCountryId, boxDO.getDestCountryId());
if (boxMergePkgNumRecordDO == null) {
boxMergePkgNumRecordDO = new BoxMergePkgNumRecordDO();
boxMergePkgNumRecordDO.setDestCountryId(boxDO.getDestCountryId());
......@@ -155,22 +159,41 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
boxMergePkgNumRecordMapper.insert(boxMergePkgNumRecordDO);
}
// 插入
for (int i = 0;i < num;i++) {
for (int i = 0; i < num; i++) {
if (boxMergePkgNumRecordDO.getNum().intValue() <= 9999) {
createReqVO.setPkgNum(code+year+df.format(boxMergePkgNumRecordDO.getNum()));
createReqVO.setPkgNum(code + year +
df.format(boxMergePkgNumRecordDO.getNum()));
} else {
createReqVO.setPkgNum(code+year+String.valueOf(boxMergePkgNumRecordDO.getNum()));
createReqVO.setPkgNum(code + year +
String.valueOf(boxMergePkgNumRecordDO.getNum()));
}
BoxMergePkgDO boxMergePkg = BoxMergePkgConvert.INSTANCE.convert(createReqVO);
//lanbm 2024-06-15 添加箱码是否重复的校验功能
BoxMergePkgDO boxMergePkg =
BoxMergePkgConvert.INSTANCE.convert(createReqVO);
if (isHavingBoxCod(boxMergePkg.getPkgNum()) == 0) {
boxMergePkgMapper.insert(boxMergePkg);
} else {
String sBox = boxMergePkg.getPkgNum();
boxMergePkg.setPkgNum(sBox + "F");
boxMergePkgMapper.insert(boxMergePkg);
}
boxMergePkgNumRecordDO.setNum(boxMergePkgNumRecordDO.getNum() + 1);
}
boxMergePkgNumRecordDO.setUpdateTime(new Date());
boxMergePkgNumRecordMapper.updateById(boxMergePkgNumRecordDO);
// 返回
return "success";
}
//lanbm 2024-06-15 add
private long isHavingBoxCod(String sBoxCode) {
LambdaQueryWrapperX q1 = new LambdaQueryWrapperX<BoxMergePkgDO>().
eq(BoxMergePkgDO::getPkgNum, sBoxCode);
Long lH = boxMergePkgMapper.selectCount(q1);
return lH;
}
@Override
public void updateBoxMergePkg(BoxMergePkgUpdateReqVO updateReqVO) {
// 校验存在
......@@ -189,7 +212,7 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
// 删除
boxMergePkgMapper.deleteById(id);
boxOrderCheckInfoService.remove(new LambdaQueryWrapperX<BoxOrderCheckInfoDO>()
.eq(BoxOrderCheckInfoDO::getPkgId,id)
.eq(BoxOrderCheckInfoDO::getPkgId, id)
);
}
......@@ -213,7 +236,7 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
public PageResult<BoxMergePkgPageDto> getBoxMergePkgPage(BoxMergePkgQueryVO query, PageVO page) {
page.setField("t.id");
IPage<BoxMergePkgPageDto> mpPage = MyBatisUtils.buildPage(page);
boxMergePkgMapper.getBoxMergePkgPage(mpPage,query);
boxMergePkgMapper.getBoxMergePkgPage(mpPage, query);
return PageResult.of(mpPage);
}
......@@ -278,81 +301,85 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
@Override
public PageResult<BoxMergePkgWebVO> getUnPkgPage(PageVO page,Long shipmentId) {
public PageResult<BoxMergePkgWebVO> getUnPkgPage(PageVO page, Long shipmentId) {
PageResult<BoxMergePkgWebVO> pageResult = new PageResult<>();
//全部要装的箱子
List<BoxOrderCheckInfoDO> tagList = new ArrayList<>();
//全部要装箱的订单
List<BoxOrderInstallVO> orderInstallVOList = boxMergePkgMapper.getBoxOrderInstallVo(shipmentId);
List<Long> allOrderIds = new ArrayList<>() ;
if(CollectionUtil.isNotEmpty(orderInstallVOList)){
orderInstallVOList.forEach(o->{
OrderDO order = new OrderDO() ;
BeanUtils.copyProperties(o,order);
List<BoxOrderCheckInfoDO> tags = boxOrderCheckInfoService.getOrderTagNumList(order);
tagList.addAll(tags) ;
allOrderIds.add(o.getOrderId()) ;
List<BoxOrderInstallVO> orderInstallVOList =
boxMergePkgMapper.getBoxOrderInstallVo(shipmentId);
List<Long> allOrderIds = new ArrayList<>();
if (CollectionUtil.isNotEmpty(orderInstallVOList)) {
orderInstallVOList.forEach(o -> {
OrderDO order = new OrderDO();
BeanUtils.copyProperties(o, order);
List<BoxOrderCheckInfoDO> tags =
boxOrderCheckInfoService.getOrderTagNumList(order);
tagList.addAll(tags);
allOrderIds.add(o.getOrderId());
});
}
//一个箱子的只要判断在 ecw_box_pkg_order 表有数据就可以,多个实装箱子的,要在合包标签表ecw_box_order_check_info 判断还有哪个箱子没装
//已加入装箱列表的有哪些
List<BoxMergePkgWebVO> allBoxPgkOrder = boxMergePkgMapper.getAllBoxPgkOrder(shipmentId,allOrderIds) ;
List<BoxMergePkgWebVO> allBoxPgkOrder =
boxMergePkgMapper.getAllBoxPgkOrder(shipmentId, allOrderIds);
//已加入合包标签表的有哪些
List<BoxOrderCheckInfoDO> allBoxOrderCheck= boxMergePkgMapper.getAlllBoxOrderCheck(shipmentId,allOrderIds) ;
List<BoxOrderCheckInfoDO> allBoxOrderCheck =
boxMergePkgMapper.getAlllBoxOrderCheck(shipmentId, allOrderIds);
//剔除数据,留下 带”-“ 还未装的
//加入已装箱列表但未加入合包标签表的
List<BoxMergePkgWebVO> noInBoxOrderCheck = new ArrayList<>() ;
List<BoxMergePkgWebVO> noInBoxOrderCheck = new ArrayList<>();
List<Long> unInstallOrderList = new ArrayList<>() ;
List<Long> unInstallOrderList = new ArrayList<>();
//已加入装箱列表不为空,提取不在已装箱列表的数据
if(CollectionUtil.isNotEmpty(allBoxPgkOrder) && CollectionUtil.isNotEmpty(allBoxOrderCheck)){
List<BoxMergePkgWebVO> pkgWebVOS = allBoxPgkOrder.stream().filter(item -> !allBoxOrderCheck.stream().anyMatch(ins -> item.getOrderId().equals(ins.getOrderId()) || item.getOrderId()==ins.getOrderId())) .collect(Collectors.toList());
noInBoxOrderCheck.addAll(pkgWebVOS) ;
List<BoxOrderCheckInfoDO> collect = tagList.stream().filter(item -> !allBoxOrderCheck.stream().anyMatch(ins -> item.getOrderNumCode().equals(ins.getOrderNumCode()))) .collect(Collectors.toList());
if(CollectionUtil.isNotEmpty(collect)){
List<BoxOrderCheckInfoDO> checkInfoDOS = collect.stream().filter(item -> !pkgWebVOS.stream().anyMatch(ins -> item.getOrderId().equals(ins.getOrderId()) || item.getOrderId()==ins.getOrderId())) .collect(Collectors.toList());
List<Long> orderIdList = checkInfoDOS.stream().map(s->s.getOrderId()).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(allBoxPgkOrder) && CollectionUtil.isNotEmpty(allBoxOrderCheck)) {
List<BoxMergePkgWebVO> pkgWebVOS = allBoxPgkOrder.stream().filter(item -> !allBoxOrderCheck.stream().anyMatch(ins -> item.getOrderId().equals(ins.getOrderId()) || item.getOrderId() == ins.getOrderId())).collect(Collectors.toList());
noInBoxOrderCheck.addAll(pkgWebVOS);
List<BoxOrderCheckInfoDO> collect = tagList.stream().filter(item -> !allBoxOrderCheck.stream().anyMatch(ins -> item.getOrderNumCode().equals(ins.getOrderNumCode()))).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(collect)) {
List<BoxOrderCheckInfoDO> checkInfoDOS = collect.stream().filter(item -> !pkgWebVOS.stream().anyMatch(ins -> item.getOrderId().equals(ins.getOrderId()) || item.getOrderId() == ins.getOrderId())).collect(Collectors.toList());
List<Long> orderIdList = checkInfoDOS.stream().map(s -> s.getOrderId()).collect(Collectors.toList());
unInstallOrderList.addAll(orderIdList);
}
}else if(CollectionUtil.isNotEmpty(allBoxPgkOrder) && CollectionUtil.isEmpty(allBoxOrderCheck)) {
if(orderInstallVOList.size()==allBoxPgkOrder.size()){
} else if (CollectionUtil.isNotEmpty(allBoxPgkOrder) && CollectionUtil.isEmpty(allBoxOrderCheck)) {
if (orderInstallVOList.size() == allBoxPgkOrder.size()) {
// List<Long> orderIdList = allBoxPgkOrder.stream().map(s->s.getOrderId()).collect(Collectors.toList());
// unInstallOrderList.addAll(orderIdList);
}else{
List<BoxOrderInstallVO> info = orderInstallVOList.stream().filter(item -> !allBoxPgkOrder.stream().anyMatch(ins -> item.getOrderId().equals(ins.getOrderId()) || item.getOrderId()==ins.getOrderId())) .collect(Collectors.toList());
List<Long> orderIdList = info.stream().map(s->s.getOrderId()).collect(Collectors.toList());
} else {
List<BoxOrderInstallVO> info = orderInstallVOList.stream().filter(item -> !allBoxPgkOrder.stream().anyMatch(ins -> item.getOrderId().equals(ins.getOrderId()) || item.getOrderId() == ins.getOrderId())).collect(Collectors.toList());
List<Long> orderIdList = info.stream().map(s -> s.getOrderId()).collect(Collectors.toList());
unInstallOrderList.addAll(orderIdList);
}
}else if(CollectionUtil.isEmpty(allBoxPgkOrder) && CollectionUtil.isEmpty(allBoxOrderCheck)) {
List<BoxOrderInstallVO> info = orderInstallVOList.stream().filter(item -> !allBoxPgkOrder.stream().anyMatch(ins -> item.getOrderId().equals(ins.getOrderId()) || item.getOrderId()==ins.getOrderId())) .collect(Collectors.toList());
List<Long> orderIdList = info.stream().map(s->s.getOrderId()).collect(Collectors.toList());
} else if (CollectionUtil.isEmpty(allBoxPgkOrder) && CollectionUtil.isEmpty(allBoxOrderCheck)) {
List<BoxOrderInstallVO> info = orderInstallVOList.stream().filter(item -> !allBoxPgkOrder.stream().anyMatch(ins -> item.getOrderId().equals(ins.getOrderId()) || item.getOrderId() == ins.getOrderId())).collect(Collectors.toList());
List<Long> orderIdList = info.stream().map(s -> s.getOrderId()).collect(Collectors.toList());
unInstallOrderList.addAll(orderIdList);
}else if(CollectionUtil.isEmpty(allBoxPgkOrder) && CollectionUtil.isNotEmpty(allBoxOrderCheck)){
} else if (CollectionUtil.isEmpty(allBoxPgkOrder) && CollectionUtil.isNotEmpty(allBoxOrderCheck)) {
throw exception(ORDER_NOT_IN_BOX);
}
IPage page1 = new PageDTO(page.getPage(),page.getRows());
if(CollectionUtil.isNotEmpty(unInstallOrderList)){//剩余未装箱订单
IPage<BoxMergePkgWebVO> boxMergePkgWebVOS = boxMergePkgMapper.getUnPkgPage(page1,shipmentId,unInstallOrderList);
IPage page1 = new PageDTO(page.getPage(), page.getRows());
if (CollectionUtil.isNotEmpty(unInstallOrderList)) {//剩余未装箱订单
IPage<BoxMergePkgWebVO> boxMergePkgWebVOS = boxMergePkgMapper.getUnPkgPage(page1, shipmentId, unInstallOrderList);
getUnOrderInfoPageResult(pageResult, boxMergePkgWebVOS,shipmentId);
}else{//没有剩余未装箱数据
List<Long> orderIdList = orderInstallVOList.stream().map(s->s.getOrderId()).collect(Collectors.toList());
getUnOrderInfoPageResult(pageResult, boxMergePkgWebVOS, shipmentId);
} else {//没有剩余未装箱数据
List<Long> orderIdList = orderInstallVOList.stream().map(s -> s.getOrderId()).collect(Collectors.toList());
List<Long> installOrderList = new ArrayList<>();
installOrderList.addAll(orderIdList) ;
IPage<BoxMergePkgWebVO> boxMergePkgWebVOS = boxMergePkgMapper.getUnPkgPage2(page1,shipmentId,installOrderList);
installOrderList.addAll(orderIdList);
IPage<BoxMergePkgWebVO> boxMergePkgWebVOS = boxMergePkgMapper.getUnPkgPage2(page1, shipmentId, installOrderList);
getUnOrderInfoPageResult(pageResult, boxMergePkgWebVOS,shipmentId);
getUnOrderInfoPageResult(pageResult, boxMergePkgWebVOS, shipmentId);
}
return pageResult;
......@@ -361,10 +388,10 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
@Override
public PageResult<BoxMergePkgWebVO> getPkgPageByPkgId(BoxMergePkgUpdateReqVO boxMergePkgUpdateReqVO, PageVO page) {
PageResult<BoxMergePkgWebVO> pageResult = new PageResult<>();
IPage page1 = new PageDTO(page.getPage(),page.getRows());
IPage page1 = new PageDTO(page.getPage(), page.getRows());
Long pkgId = boxMergePkgUpdateReqVO.getId();
BoxMergePkgDO boxMergePkgDO = boxMergePkgMapper.selectOne(BoxMergePkgDO::getId, pkgId);
IPage<BoxMergePkgWebVO> boxMergePkgWebVOS = boxMergePkgMapper.getPkgPageByPkgId(page1,boxMergePkgDO);
IPage<BoxMergePkgWebVO> boxMergePkgWebVOS = boxMergePkgMapper.getPkgPageByPkgId(page1, boxMergePkgDO);
boxMergePkgWebVOS.getRecords().stream().forEach(item -> item.setPkgNum(boxMergePkgDO.getPkgNum()));
getOrderInfoPageResult(pageResult, boxMergePkgWebVOS);
return pageResult;
......@@ -382,7 +409,7 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
@Override
public void finishMergePkg(Long shipmentId) {
BoxDO boxDO = boxService.getBox(shipmentId);
if(boxDO == null) {
if (boxDO == null) {
throw exception(BOX_NOT_EXISTS);
}
checkBoxApproval(shipmentId);
......@@ -393,7 +420,7 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
}
int mergePkgStatus = boxDO.getMergePkgStatus();
MergePkgStatusEnum merge = MergePkgStatusEnum.MERGED;
if(mergePkgStatus != merge.getStatus()) {
if (mergePkgStatus != merge.getStatus()) {
boxDO.setMergePkgStatus(merge.getStatus());
//修改订单状态
......@@ -412,7 +439,7 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
@Override
public BoxMergePkgTagVO getMergeTagById(Long id) {
BoxMergePkgTagVO boxMergePkgTagVO = new BoxMergePkgTagVO();
String partPath = "airTag/"+ DateUtils.formatDate(new Date());
String partPath = "airTag/" + DateUtils.formatDate(new Date());
BoxMergePkgDO boxMergePkgDO = boxMergePkgMapper.selectById(id);
BoxDO box = boxService.getBox(boxMergePkgDO.getShipmentId());
WarehouseDO startWarehouse = warehouseService.getWarehouse(box.getStartWarehouseId());
......@@ -430,7 +457,7 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
try {
QRCode.generateQRCodeImage(boxMergePkgDO.getPkgNum(), 350, 350, outputStream);
String url = fileApi.createFile(partPath+"/"+ UUID.fastUUID().toString(),outputStream.toByteArray());
String url = fileApi.createFile(partPath + "/" + UUID.fastUUID().toString(), outputStream.toByteArray());
boxMergePkgTagVO.setQrCodeUrl(url);
//需求修改,不需要条码
// String barcodeUrl = fileApi.createFile(BarcodeUtil.generateBarCode39("https://groupage.cn/", null, null, null, false, null));
......@@ -498,17 +525,17 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
.map(DeptWarehouseDO::getWarehouseId)
.collect(Collectors.toSet());
IPage<BoxMergePkgPDAListVO> result = boxMergePkgMapper.getBoxMergePkgList4PDAPage(mpPage,warehouseIds,selfNo);
result.getRecords().stream().forEach(item ->{
IPage<BoxMergePkgPDAListVO> result = boxMergePkgMapper.getBoxMergePkgList4PDAPage(mpPage, warehouseIds, selfNo);
result.getRecords().stream().forEach(item -> {
BoxGoodsStatistics boxStatistics = boxPreloadGoodsService.getBoxStatistics(item.getId());
BeanUtils.copyProperties(boxStatistics,item);
BeanUtils.copyProperties(boxStatistics, item);
});
return PageResult.of(result);
}
@Override
public void closeMergePkg(BoxMergePkgUpdateReqVO updateReqVO) {
boxService.checkOrderTagNum(updateReqVO.getId(),1);
boxService.checkOrderTagNum(updateReqVO.getId(), 1);
this.updateBoxMergePkg(updateReqVO);
}
......@@ -529,11 +556,11 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
pageResult.setTotal(boxMergePkgWebVOIPage.getTotal());
}
private void getUnOrderInfoPageResult(PageResult<BoxMergePkgWebVO> pageResult, IPage<BoxMergePkgWebVO> boxMergePkgWebVOIPage,Long shipmentId) {
private void getUnOrderInfoPageResult(PageResult<BoxMergePkgWebVO> pageResult, IPage<BoxMergePkgWebVO> boxMergePkgWebVOIPage, Long shipmentId) {
if (CollectionUtil.isNotEmpty(boxMergePkgWebVOIPage.getRecords())) {
List<Long> orderIdList = boxMergePkgWebVOIPage.getRecords().stream().map(o->o.getOrderId()).collect(Collectors.toList());
List<Long> orderIdList = boxMergePkgWebVOIPage.getRecords().stream().map(o -> o.getOrderId()).collect(Collectors.toList());
List<OrderItemDO> AllOrderItemDOS = orderItemService.selectList(new LambdaQueryWrapperX<OrderItemDO>()
.in(OrderItemDO::getOrderId,orderIdList)
.in(OrderItemDO::getOrderId, orderIdList)
.isNotNull(OrderItemDO::getWarehouseInInfo)
);
boxMergePkgWebVOIPage.getRecords().stream().forEach(item -> {
......@@ -542,9 +569,9 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
// .isNotNull(OrderItemDO::getWarehouseInInfo)
// );
List<OrderItemDO> orderItemDOS = AllOrderItemDOS.stream().filter(all -> all.getOrderId()==item.getOrderId() || all.getOrderId().equals(item.getOrderId())) .collect(Collectors.toList());
List<OrderItemDO> orderItemDOS = AllOrderItemDOS.stream().filter(all -> all.getOrderId() == item.getOrderId() || all.getOrderId().equals(item.getOrderId())).collect(Collectors.toList());
List<BoxOrderCheckInfoDO> installBox = boxMergePkgMapper.getInstallBoxByShipmentId(shipmentId,item.getOrderId()) ;
List<BoxOrderCheckInfoDO> installBox = boxMergePkgMapper.getInstallBoxByShipmentId(shipmentId, item.getOrderId());
item.setInstallNum(CollectionUtil.isNotEmpty(installBox) ? installBox.size() : 0);
item.setOrderItemDOS(orderItemDOS);
......@@ -556,7 +583,8 @@ public class BoxMergePkgServiceImpl extends AbstractService<BoxMergePkgMapper, B
pageResult.setRows(boxMergePkgWebVOIPage.getSize());
pageResult.setTotal(boxMergePkgWebVOIPage.getTotal());
}
private void checkBoxApproval(Long shipmentId){
private void checkBoxApproval(Long shipmentId) {
BoxDO box = boxService.getBox(shipmentId);
if (box.getAirShipmentStatus() != AirShipmentStatusEnum.UNSHIPMENT.getStatus()) {
throw exception(MERGE_PKG_IS_FINISH);
......
......@@ -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,6 +866,7 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
BigDecimal volumeSum = boxGoodsStatistics.getVolume();
BigDecimal weightSum = boxGoodsStatistics.getWeight();
if(orderDO!=null) {
if (orderDO.getSumNum() != null) {
numSum += orderDO.getSumNum();
boxGoodsStatistics.setNum(numSum);
......@@ -878,6 +880,7 @@ public class BoxPreloadGoodsServiceImpl extends AbstractService<BoxPreloadGoodsM
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