提交 406dc5b2 authored 作者: liuhaiquan's avatar liuhaiquan

Merge remote-tracking branch 'origin/v4.9_create_goods_child_20230918' into test

......@@ -21,7 +21,7 @@ public class PageOrderGoodsListParam extends PageParam {
@ApiModelProperty(value = "货单编号")
private String orderGoodsNo;
@ApiModelProperty(value = "货单状态: 10:已挂单 20:挂单中 30:运输中 40:已完成 50:已取消")
@ApiModelProperty(value = "货单状态: 10:已挂单 20:挂单中 30:运输中 40:已完成 50:已取消 60:已完结")
private Integer orderGoodsStatus;
@ApiModelProperty(value = "开始时间", example = "2023-09-09 12:00:01")
......
......@@ -23,7 +23,7 @@ public class OrderGoodsIdGenerate {
public long getOrderGoodsId(String type, Integer size) {
long baseStart = Long.parseLong(DateUtils.formatDate(LocalDate.now(), "yyyyMMdd").get() + "00001");
Object o = redisTemplate.opsForHash().get(RedisConstants.ORDER_GOODS_ID, type);
if (o == null) {
if (o == null ) {
Long maxOrderGoodsId = null;
String maxID = orderGoodsDao.getMaxOrderGoodsId(type);
if (StringUtils.isNotBlank(maxID)) {
......@@ -43,6 +43,9 @@ public class OrderGoodsIdGenerate {
}
} else {
long redisOrderGoodsId = Long.parseLong(o.toString());
if (redisOrderGoodsId < baseStart) {
redisOrderGoodsId = baseStart;
}
long orderGoodsId = redisOrderGoodsId + size;
redisTemplate.opsForHash().put(RedisConstants.ORDER_GOODS_ID, type, String.valueOf(orderGoodsId));
return redisOrderGoodsId;
......
......@@ -70,7 +70,7 @@ public class OrderGoodsTruckBindDaoImpl extends BaseDaoImpl<OrderGoodsTruckBindM
@Override
public Optional<List<OrderGoodsTruckBind>> selectListByTruckNo(List<String> truckList) {
return Optional.ofNullable(baseMapper.selectList(new QueryWrapper<OrderGoodsTruckBind>().lambda()
.ne(OrderGoodsTruckBind::getStatus, OrderGoodsTruckBindEnum.Status.GET.getCode())
.ne(OrderGoodsTruckBind::getStatus, OrderGoodsTruckBindEnum.Status.CANCEL.getCode())
.in(OrderGoodsTruckBind::getTruckNo,truckList).select(OrderGoodsTruckBind::getOrderGoodsNo)));
}
}
package com.clx.performance.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.clx.order.enums.OrderEnum;
import com.clx.order.feign.OrderFeign;
import com.clx.order.param.feign.UpdateOrderInfoParam;
import com.clx.order.vo.feign.FeignAddressVO;
import com.clx.order.vo.feign.FeignOrderInfoVO;
import com.clx.performance.dao.*;
......@@ -83,6 +86,7 @@ public class OrderChildServiceImpl implements OrderChildService {
private final OrderChildLogStruct orderChildLogStruct;
private final UniqueOrderNumService uniqueOrderNumService;
private final OrderFeign orderFeign;
@Autowired
......@@ -931,6 +935,7 @@ public class OrderChildServiceImpl implements OrderChildService {
Integer status = OrderGoodsStatusEnum.Status.GO_TO_SEND.getCode();
orderGoodsService.updateOrderGoodsReduceWeightAndStatus(orderGoods.getId(), weight, status);
orderFeign.updateOrderStatusByOrderNo(orderGoods.getOrderNo(), OrderEnum.Status.IN_TRANSIT.getCode());
}
/**
......@@ -1121,14 +1126,18 @@ public class OrderChildServiceImpl implements OrderChildService {
//应付运费
BigDecimal payableFreight=BigDecimal.ZERO;
if(Objects.nonNull(orderChild.getLoadNet())){
payableFreight = orderChild.getLoadNet().multiply(orderChild.getFreightPrice().movePointLeft(2));
payableFreight = orderChild.getLoadNet()
.multiply(orderChild.getFreightPrice().movePointLeft(2))
.setScale(2,BigDecimal.ROUND_HALF_UP);
}
//亏吨扣款(元)
BigDecimal lossDeduction=BigDecimal.ZERO;
if(Objects.nonNull(orderChild.getLoadNet()) && Objects.nonNull(orderChild.getUnloadNet())){
if(orderChild.getLoadNet().compareTo(orderChild.getUnloadNet()) >0){
lossDeduction = carrierOrderChildDetailVO.getLossPrice().movePointLeft(2).multiply(orderChild.getLoadNet().subtract(orderChild.getUnloadNet()));
lossDeduction = carrierOrderChildDetailVO.getLossPrice().movePointLeft(2)
.multiply(orderChild.getLoadNet().subtract(orderChild.getUnloadNet()))
.setScale(2,BigDecimal.ROUND_HALF_UP);
}
}
......
......@@ -60,6 +60,8 @@ public class OrderGoodsSqlProvider {
WHERE("a.order_goods_status = #{param.orderGoodsStatus}");
} else if (OrderGoodsStatusEnum.Status.CANCEL.getCode().equals(param.getOrderGoodsStatus())) {
WHERE("a.order_goods_status = #{param.orderGoodsStatus}");
}else if (OrderGoodsStatusEnum.Status.COMPLETED.getCode().equals(param.getOrderGoodsStatus())) {
WHERE("a.order_goods_status = #{param.orderGoodsStatus}");
}
}
......
......@@ -28,7 +28,6 @@ public class RedisGeoUntil {
//Point的属性值,x轴是经度longitude,y轴是纬度latitude。
Point point = new Point(longitudeX,latitudeY);
Long addedNum = redisTemplate.opsForGeo().add(redisKey,point,code);
System.out.println(addedNum);
}
......@@ -52,7 +51,6 @@ public class RedisGeoUntil {
//删除
//redisTemplate.opsForZSet().remove(redisKey,"hangzhou5");
Long remove = redisTemplate.boundZSetOps(redisKey).remove(code);
System.out.println(remove);
}
......@@ -63,7 +61,6 @@ public class RedisGeoUntil {
//修改(先删除再新增)
deleteRedisGeo( redisKey , code);
insertRedisGeo( redisKey , longitudeX, latitudeY, code);
System.out.println();
}
......@@ -78,7 +75,6 @@ public class RedisGeoUntil {
pointList.add(redisGeo);
}
}
System.out.println(pointList);
return pointList;
}
......@@ -89,7 +85,6 @@ public class RedisGeoUntil {
public Point getRedisGeo(String redisKey , String code) {
//查询可以查询多个 经纬度
List<Point> pointsAll = redisTemplate.opsForGeo().position(redisKey,code);
System.out.println(pointsAll);
if(!CollectionUtils.isEmpty(pointsAll)){
return pointsAll.get(0);
}
......@@ -104,7 +99,6 @@ public class RedisGeoUntil {
Distance disFiveKmFive = new Distance(Integer.MAX_VALUE, Metrics.KILOMETERS);
RedisGeoCommands.GeoRadiusCommandArgs argsFiveKmFive = RedisGeoCommands.GeoRadiusCommandArgs.newGeoRadiusArgs().includeDistance().includeCoordinates().sortAscending().limit(5);
GeoResults<RedisGeoCommands.GeoLocation<String>> resultsFiveKmFive = redisTemplate.opsForGeo().radius(redisKey,code,disFiveKmFive,argsFiveKmFive);
System.out.println(resultsFiveKmFive);
return resultsFiveKmFive;
}
......@@ -119,7 +113,6 @@ public class RedisGeoUntil {
Circle circleCenter = new Circle(pointCenter, distanceCenter);
RedisGeoCommands.GeoRadiusCommandArgs argsCircle = RedisGeoCommands.GeoRadiusCommandArgs.newGeoRadiusArgs().includeDistance().includeCoordinates().sortAscending().limit(limit);
GeoResults<RedisGeoCommands.GeoLocation<String>> resultsDis = redisTemplate.opsForGeo().radius(redisKey,circleCenter ,argsCircle);
System.out.println(resultsDis);
return resultsDis;
}
......@@ -129,7 +122,6 @@ public class RedisGeoUntil {
*/
public List<String> getRedisGeoListHash(String redisKey , String code) {
List<String> resultsHash = redisTemplate.opsForGeo().hash(redisKey,code);
System.out.println(resultsHash);
return resultsHash;
}
......@@ -138,7 +130,6 @@ public class RedisGeoUntil {
*/
public Distance getRedisGeoListTwoSpace(String redisKey , String codeOne,String codeTwo) {
Distance disTwoPlace = redisTemplate.opsForGeo().distance(redisKey,codeOne,codeTwo, RedisGeoCommands.DistanceUnit.KILOMETERS);
System.out.println(disTwoPlace);
return disTwoPlace;
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论