Commit 55d166f5 authored by lanbaoming's avatar lanbaoming

2024-06-24-4提交

parent 85bb8a7c
......@@ -82,7 +82,8 @@ public class ProductPriceExceptionHandleListener {
//找出这些订单的未处理的未报价异常
List<OrderExceptionDO> exceptionDOList =
orderExceptionService.list(new LambdaQueryWrapper<OrderExceptionDO>()
.eq(OrderExceptionDO::getOrderExceptionType, OrderExceptionEnum.ORDER_NO_QUOTE_EXCEPTION.getKey())
.eq(OrderExceptionDO::getOrderExceptionType,
OrderExceptionEnum.ORDER_NO_QUOTE_EXCEPTION.getKey())
.in(OrderExceptionDO::getOrderItemId, orderItemIdSet)
.ne(OrderExceptionDO::getOrderExceptionStatus, 2)
);
......@@ -109,6 +110,10 @@ public class ProductPriceExceptionHandleListener {
}
}
else
{
}
//只要有价格就处理清关费未报价异常
//if (productPriceDO.getPriceType() == 0) {
......
......@@ -480,8 +480,12 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
//lanbm 2024-06-06 添加的逻辑点
for (OrderItemDO oItem : orderItemDOList
) {
if (productPriceDO.getNeedOrderInquiry() == 1)
oItem.setNeedOrderInquiry(productPriceDO.getNeedOrderInquiry());
if (productPriceDO.getNeedOrderInquiry() == null) {
oItem.setNeedOrderInquiry(0);
} else {
if (productPriceDO.getNeedOrderInquiry() == 1)
oItem.setNeedOrderInquiry(productPriceDO.getNeedOrderInquiry());
}
}
//end lanbm 2024-06-06 添加的逻辑点
......@@ -1093,8 +1097,8 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
}
ReceivableDO clearanceFeeReceivable =
receivableDOList.stream().filter(r -> r.getFeeType() == 2 &&
Objects.nonNull(r.getFeeSource()) && 1 == r.getFeeSource() && Objects.equals(r.getOrderItemId(),
orderItemDO.getOrderItemId())).findFirst().orElse(null);
Objects.nonNull(r.getFeeSource()) && 1 == r.getFeeSource() && Objects.equals(r.getOrderItemId(),
orderItemDO.getOrderItemId())).findFirst().orElse(null);
if (orderItemDO.getCharging() == 0) {
// 清关费
......@@ -2711,7 +2715,6 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
if (orderItemDO.getItemStatus() == -1 && !orderItemDO.getIsProd()) {
if (CollectionUtil.isEmpty(orderNoQuoteExceptionDOList)) {
OrderExceptionCreateReqVO orderExceptionCreateReqVO =
this.genOrderException(orderDO.getOrderId(),
orderDO,
......@@ -2727,7 +2730,7 @@ public class OrderBusinessServiceImpl extends AbstractService<OrderMapper, Order
// TODO 同一个订单相同品名有相同未报价异常时,不重复产生
orderExceptionService.createOrderException(orderExceptionCreateReqVO);
}
noQuoteOrAutomaticNoQuote = 1;
//noQuoteOrAutomaticNoQuote = 1;
} else {
if (CollectionUtil.isNotEmpty(orderNoQuoteExceptionDOList)) {
// TODO 当其他业务补充了品名价格后,如果还有待处理的未报价异常,需要同步处理掉
......
......@@ -24,8 +24,10 @@ import cn.iocoder.yudao.module.ecw.api.currency.dto.ExchangeRateRespDTO;
import cn.iocoder.yudao.module.ecw.api.internalMessage.InternalMessageApi;
import cn.iocoder.yudao.module.ecw.api.internalMessage.dto.InternalMessageCreateDto;
import cn.iocoder.yudao.module.product.convert.product.ProductPriceConvert;
import cn.iocoder.yudao.module.product.dal.dataobject.coupon.zTest3;
import cn.iocoder.yudao.module.product.dal.dataobject.product.*;
import cn.iocoder.yudao.module.product.dal.dataobject.productPriceSnapshot.ProductPriceSnapshotDO;
import cn.iocoder.yudao.module.product.dal.mysql.coupon.ZTestMapper3;
import cn.iocoder.yudao.module.product.dal.mysql.product.*;
import cn.iocoder.yudao.module.product.dal.mysql.productPriceSnapshot.ProductPriceSnapshotMapper;
import cn.iocoder.yudao.module.product.dto.AirClearancePriceResultDto;
......@@ -127,6 +129,9 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
@Resource
private ProductPriceStepClearanceService productPriceStepClearanceService;
@Resource
private ZTestMapper3 zTestMapper;
private static final String PREFIX = "price_batch_update_";
private static final Integer DATA_THRESHOLD = 50;
......@@ -1244,13 +1249,20 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
//lanbm 2024-06-06 处理单询价问题添加的逻辑点。
if (productPriceDO.getNeedOrderInquiry() != null) {
if (productPriceDO.getNeedOrderInquiry() == 1) {
if (productPriceDO.getNeedOrderInquiry() == 1 ||
productPriceDO.getNeedOrderInquiry() == 0) {
hasPrice = true;
}
}
//没有价格信息不继续后面的处理
if (!hasPrice) continue;
if (!hasPrice) {
zTest3 m=new zTest3();
m.setTestname("没有价格信息,不后续处理");
m.setCreatedate(new Date());
zTestMapper.insert(m);
continue;
}
//校验价格的有效期
if (validateStartDate == null && validateEndDate == null) {
......@@ -1284,6 +1296,13 @@ public class ProductPriceServiceImpl extends AbstractService<ProductPriceMapper,
handleData.setNeedHandleList(needHandleList);
applicationContext.publishEvent(handleData);
}
else
{
zTest3 m=new zTest3();
m.setTestname("needHandleList 为空");
m.setCreatedate(new Date());
zTestMapper.insert(m);
}
}
@Override
......
......@@ -96,10 +96,12 @@ public class ShipmentBillingZipExportListener {
* @param event 编号记录
*/
@EventListener(ShipmentBillingZipExportPushEvent.class)
public void shipmentBillingZipExportPushEvent(ShipmentBillingZipExportPushEvent event) {
public void shipmentBillingZipExportPushEvent(
ShipmentBillingZipExportPushEvent event) {
if (StringUtils.isNotBlank(event.getRequestParams())) {
try {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(DATA_FORMAT);
DateTimeFormatter formatter =
DateTimeFormatter.ofPattern(DATA_FORMAT);
String nowTime = formatter.format(LocalDateTime.now());
JSONObject jsonObject = JSONObject.parseObject(event.getRequestParams());
Long shipmentId = jsonObject.getLong("shipmentId");
......
......@@ -868,7 +868,8 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin
if (checkFile.exists()) {
checkFile.delete();
}
List<BoxPreloadGoodsBackVO> goodsItemList = boxPreloadGoodsService.getShipGoodItemList(shipmentId);
List<BoxPreloadGoodsBackVO> goodsItemList =
boxPreloadGoodsService.getShipGoodItemList(shipmentId);
//以secId排序
goodsItemList.sort(Comparator.comparing(BoxPreloadGoodsBackVO::getSecId));
......@@ -879,7 +880,10 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin
List<InputStream> inputStreams = new ArrayList<>();
for (Map.Entry<Long, List<BoxPreloadGoodsBackVO>> entry : orderMap.entrySet()) {
Long orderId = entry.getKey();
MakeBillOfLadingDO makeBillOfLadingDO = makeBillOfLadingMapper.selectOne(new LambdaQueryWrapperX<MakeBillOfLadingDO>().eq(MakeBillOfLadingDO::getOrderId, orderId).eq(MakeBillOfLadingDO::getStatus, 2).select(MakeBillOfLadingDO::getImgUrl));
MakeBillOfLadingDO makeBillOfLadingDO =
makeBillOfLadingMapper.selectOne(
new LambdaQueryWrapperX<MakeBillOfLadingDO>().eq(
MakeBillOfLadingDO::getOrderId, orderId).eq(MakeBillOfLadingDO::getStatus, 2).select(MakeBillOfLadingDO::getImgUrl));
if (makeBillOfLadingDO == null) continue;
if (StringUtils.isNotBlank(makeBillOfLadingDO.getImgUrl())) {
if (StringUtils.isNotBlank(makeBillOfLadingDO.getImgUrl())) {
......@@ -980,8 +984,12 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin
paramMap.put("num1", item.getWarehouseInInfoVO().getCartonsNum());
paramMap.put("volume", item.getWarehouseInInfoVO().getWeight());
paramMap.put("weight", Objects.nonNull(item.getChargeWeight()) && item.getChargeWeight().compareTo(item.getMinMeteringWeight()) > 0 ? item.getChargeWeight() : item.getMinMeteringWeight());
if (item.getSeaFreightCurrency() != 1) {// 运费固定为美元,其他币种转换为美元
BigDecimal seaFreight = changeAmountToDestCurrency(item.getSeaFreightCurrency().longValue(), 1L, item.getOneSeaFreight());
if (item.getSeaFreightCurrency() != 1) {
// 运费固定为美元,其他币种转换为美元
BigDecimal seaFreight =
changeAmountToDestCurrency(
item.getSeaFreightCurrency().longValue(),
1L, item.getOneSeaFreight());
paramMap.put("seaFreight", seaFreight);
} else {
paramMap.put("seaFreight", item.getOneSeaFreight());
......@@ -1032,13 +1040,16 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin
}
}
}
StringBuffer seaStringBuffer = getStringBuffer(totalFeeMap, orderItemIds, 1);//运费
StringBuffer clearanceStringBuffer = getStringBuffer(totalFeeMap, orderItemIds, 2);//清关费
StringBuffer seaStringBuffer = getStringBuffer(totalFeeMap,
orderItemIds, 1);//运费
StringBuffer clearanceStringBuffer =
getStringBuffer(totalFeeMap, orderItemIds, 2);//清关费
totalItemMap.put("totalNum", totalNum);
totalItemMap.put("totalVolume", totalVolume);
totalItemMap.put("totalWeight", totalWeight);
totalItemMap.put("totalSeaFreight", seaStringBuffer.length() == 0 ? "" : seaStringBuffer.deleteCharAt(seaStringBuffer.length() - 1));
totalItemMap.put("totalClearanceFreight", clearanceStringBuffer.length() == 0 ? "" : clearanceStringBuffer.deleteCharAt(clearanceStringBuffer.length() - 1));
totalItemMap.put("totalClearanceFreight",
clearanceStringBuffer.length() == 0 ? "" : clearanceStringBuffer.deleteCharAt(clearanceStringBuffer.length() - 1));
templateMap.put("totalItemMap", totalItemMap);//订单项总计
templateMap.put("dataList", dataList);//订单项
......@@ -1153,7 +1164,9 @@ public class MakeBillOfLadingServiceImpl extends AbstractService<MakeBillOfLadin
//总金额加上保价费
if (info.getCostVO().getInsuranceCurrencyId().longValue() == 1L) {
totalLeft = totalLeft.add(info.getCostVO().getInsuranceFee());
} else if (info.getCostVO().getInsuranceCurrencyId().longValue() == realClearanceFreightCurrency) {
} else if (info.getCostVO().getInsuranceCurrencyId().longValue() ==
realClearanceFreightCurrency) {
//加报价费
totalRight = totalRight.add(info.getCostVO().getInsuranceFee());
} else {
//TODO 和总金额拼起来展示?还是转换成美元加进去?
......
......@@ -103,7 +103,8 @@ public class MakeBillOfLadingController {
@PutMapping("/update")
@ApiOperation("更新制作提货单")
//@PreAuthorize("@ss.hasPermission('shipment:make-bill-of-lading:update')")
public CommonResult<Boolean> updateMakeBillOfLading(@Valid @RequestBody MakeBillOfLadingUpdateReqVO updateReqVO) {
public CommonResult<Boolean> updateMakeBillOfLading(
@Valid @RequestBody MakeBillOfLadingUpdateReqVO updateReqVO) {
makeBillOfLadingService.updateMakeBillOfLading(updateReqVO);
return success(true);
}
......@@ -180,7 +181,9 @@ public class MakeBillOfLadingController {
@ApiImplicitParam(name = "orderId", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
//@PreAuthorize("@ss.hasPermission('shipment:make-bill-of-lading:query')")
public CommonResult<MakeBillOfLadingBackVO> downloadByOrderId(@RequestParam("orderId") Long orderId, HttpServletResponse response) {
MakeBillOfLadingDO lading = makeBillOfLadingService.selectOne(MakeBillOfLadingDO::getOrderId, orderId);
MakeBillOfLadingDO lading =
makeBillOfLadingService.selectOne(MakeBillOfLadingDO::getOrderId,
orderId);
if (lading == null) {
return error(new ErrorCode(1109010018,
"该提单未制作或未审批通过!"));
......@@ -211,7 +214,8 @@ public class MakeBillOfLadingController {
@ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class)
//@PreAuthorize("@ss.hasPermission('shipment:make-bill-of-lading:query')")
public CommonResult<MakeBillOfLadingBackVO> download(@RequestParam("id") Long id, HttpServletResponse response) {
MakeBillOfLadingDO makeBillOfLading = makeBillOfLadingService.getMakeBillOfLading(id);
MakeBillOfLadingDO makeBillOfLading =
makeBillOfLadingService.getMakeBillOfLading(id);
return success(MakeBillOfLadingConvert.INSTANCE.convert(makeBillOfLading));
}
......@@ -256,7 +260,8 @@ public class MakeBillOfLadingController {
})
//@PreAuthorize("@ss.hasPermission('shipment:make-bill-of-lading:query')")
public CommonResult<Map<String, Object>> makeAirBillOfLading(@RequestParam("orderId") Long orderId, @RequestParam("shipmentId") Long shipmentId) throws Exception {
Map<String, Object> map = makeBillOfLadingService.makeAirBillOfLading(orderId, shipmentId);
Map<String, Object> map =
makeBillOfLadingService.makeAirBillOfLading(orderId, shipmentId);
return success(map);
}
......
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