yanghui
2022-12-01 e78a7c543c0e3510cfab36ac0ea1b8e9ea7a608f
#feat 排序
3个文件已修改
15 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/convenient/ConvenientElevatingPointVO.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerOrderDeliveryServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientElevatingPointServiceImpl.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/convenient/ConvenientElevatingPointVO.java
@@ -14,7 +14,7 @@
 */
@Data
@ApiModel("便民服自提点")
public class ConvenientElevatingPointVO {
public class ConvenientElevatingPointVO implements Comparable<ConvenientElevatingPointVO>{
    /**
     * 主键id
     */
@@ -107,4 +107,9 @@
    @ApiModelProperty(value = "提货点详细地址")
    private String detailAddress;
    @Override
    public int compareTo(ConvenientElevatingPointVO o) {
        return this.getDistance().compareTo(o.getDistance()); //定义你自己的排序规则
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComShopFlowerOrderDeliveryServiceImpl.java
@@ -117,7 +117,7 @@
        int update = this.baseMapper.updateById(comShopFlowerOrderDeliveryDO);
        if (update > 0){
            //一个自提订单算一个货
            ConvenientElevatingPointDO convenientElevatingPointDO = convenientElevatingPointDAO.selectById(comShopFlowerOrderDeliveryDTO.getPointId());
            ConvenientElevatingPointDO convenientElevatingPointDO = convenientElevatingPointDAO.selectById(comShopFlowerOrderDeliveryDO.getPointId());
            convenientElevatingPointDO.setCumulativeGoodsNum(convenientElevatingPointDO.getCumulativeGoodsNum() + comShopFlowerOrderDeliveryDTO.getDeliveryOrderNum());
            convenientElevatingPointDO.setPrepareGoodsNum(convenientElevatingPointDO.getPrepareGoodsNum()+comShopFlowerOrderDeliveryDTO.getDeliveryOrderNum());
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ConvenientElevatingPointServiceImpl.java
@@ -22,10 +22,7 @@
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.*;
import static java.util.Objects.isNull;
import static java.util.Objects.nonNull;
@@ -163,6 +160,7 @@
            convenientElevatingPointVO.setDistance(distance);
            convenientElevatingPointVOS.add(convenientElevatingPointVO);
        });
        Collections.sort(convenientElevatingPointVOS);
        return R.ok(convenientElevatingPointVOS);
    }