无关风月
2025-01-14 a1524afe5eb74cf9e6dd7bfb88222944b3eb10bf
Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/qijisheng
7个文件已修改
78 ■■■■■ 已修改文件
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/OrderService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TechnicianSubscribeService.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopPointServiceImpl.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
@@ -131,9 +131,9 @@
    @ApiImplicitParams({
            @ApiImplicitParam(value = "订单id", name = "id", required = true, dataType = "String"),
    })
    @GetMapping("/writeOff/{id}/{shopId}")
    public R<Void> writeOff(@PathVariable("id") String id, @PathVariable("shopId") Integer shopId){
        orderService.writeOff(id, shopId);
    @GetMapping("/writeOff/{id}/{shopId}/{technicianId}")
    public R<Void> writeOff(@PathVariable("id") String id, @PathVariable("shopId") Integer shopId, @PathVariable("technicianId") Integer technicianId){
        orderService.writeOff(id, shopId, technicianId);
        return R.ok();
    }
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/OrderService.java
@@ -26,7 +26,7 @@
    boolean check(Order order, Integer shopId, Long userId);
    void writeOff(String id,Integer shopId);
    void writeOff(String id,Integer shopId, Integer technicianId);
    
    
    /**
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
@@ -177,14 +177,6 @@
        }
        OrderDetailVO orderDetailVO = new OrderDetailVO();
        orderDetailVO.setDistributionMode(order.getDistributionMode());
        Technician technician = new Technician();
        if (order.getTechnicianId() != null){
            R<Technician> shopdetail = technicianClient.shopdetail(order.getTechnicianId());
            if (shopdetail.getCode() != R.SUCCESS){
                throw new ServiceException("获取技师信息失败");
            }
            technician = shopdetail.getData();
        }
        Shop shop = shopR.getData();
        orderDetailVO.setId(order.getId());
        orderDetailVO.setOrderStatus(order.getOrderStatus());
@@ -209,13 +201,14 @@
        orderDetailVO.setLongitude(shop.getLongitude());
        orderDetailVO.setLatitude(shop.getLatitude());
        orderDetailVO.setShopId(shop.getId());
        orderDetailVO.setTechnicianName(technician.getName());
        orderDetailVO.setTechnicianId(technician.getId());
        if(order.getOrderType() == 1){
            List<TechnicianSubscribe> data = technicianSubscribeClient.getTechnicianSubscribeList(order.getId()).getData();
            if(data.size() > 0){
                Long id = data.get(0).getId();
                orderDetailVO.setTechnicianSubscribeId(id.toString());
                Technician technician = technicianClient.shopdetail(order.getTechnicianId()).getData();
                orderDetailVO.setTechnicianName(technician.getName());
                orderDetailVO.setTechnicianId(technician.getId());
            }
        }
        // 生成核销码BASE64
@@ -258,7 +251,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void writeOff(String id,Integer shopId) {
    public void writeOff(String id,Integer shopId, Integer technicianId) {
        LoginUser loginUserApplet = tokenService.getLoginUserApplet();
        Order order = orderMapper.selectById(id);
        boolean check = check(order, shopId, loginUserApplet.getUserid());
@@ -283,6 +276,7 @@
        order.setAfterSaleTime(LocalDateTime.now().plusDays(days));
        order.setEndTime(LocalDateTime.now());
        order.setCancellerAppUserId(loginUserApplet.getUserid());
        order.setTechnicianId(technicianId);
        orderMapper.updateById(order);
    }
    
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java
@@ -82,15 +82,7 @@
    }
    /**
     * 预约技师
     */
    @PostMapping("/switchingTechnician")
    @ApiOperation(value = "切换技师", notes = "切换技师", tags = {"小程序-个人中心-门店管理-预约列表"})
    public R<Void> switchingTechnician(@RequestBody TechnicianSubscribe technicianSubscribe) {
        technicianSubscribeService.switchingTechnician(technicianSubscribe);
        return R.ok();
    }
    /**
@@ -149,7 +141,7 @@
    @PostMapping("/getTechnicianSubscribeList")
    public R<List<TechnicianSubscribe>> getTechnicianSubscribeList(@RequestParam("orderId") Long orderId){
        List<TechnicianSubscribe> list = technicianSubscribeService.list(new LambdaQueryWrapper<TechnicianSubscribe>().eq(TechnicianSubscribe::getOrderId, orderId)
                .eq(TechnicianSubscribe::getDelFlag, 0).in(TechnicianSubscribe::getStatus, Arrays.asList(0, 1)));
                .eq(TechnicianSubscribe::getDelFlag, 0).in(TechnicianSubscribe::getStatus, Arrays.asList(0, 1)).orderByDesc(TechnicianSubscribe::getCreateTime));
        return R.ok(list);
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/TechnicianSubscribeService.java
@@ -33,11 +33,7 @@
    void subscribe(TechnicianSubscribe technicianSubscribe);
    /**
     * 切換技師
     * @param technicianSubscribe
     */
    void switchingTechnician(TechnicianSubscribe technicianSubscribe);
    /**
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/ShopPointServiceImpl.java
@@ -4,10 +4,12 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.other.api.domain.Shop;
import com.ruoyi.other.api.domain.ShopPoint;
import com.ruoyi.other.api.enums.PointChangeType;
import com.ruoyi.other.mapper.ShopPointMapper;
import com.ruoyi.other.service.ShopPointService;
import com.ruoyi.other.service.ShopService;
import com.ruoyi.other.vo.ShopPointStatistics;
import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.feignClient.SysUserClient;
@@ -37,6 +39,8 @@
    private TokenService tokenService;
    @Resource
    private SysUserClient sysUserClient;
    @Resource
    private ShopService shopService;
@@ -45,17 +49,18 @@
    public ShopPointStatistics statistics(IPage<ShopPoint> page, ShopPoint shopPoint) {
        Long userid = tokenService.getLoginUser().getUserid();
        SysUser sysUser = sysUserClient.getSysUser(userid).getData();
        List<ShopPoint> shopPoints = this.baseMapper.selectShopPointList(shopPoint);
        Map<Integer, Integer> shopPointMap = shopPoints.stream()
                .collect(Collectors.groupingBy(
                        ShopPoint::getType,
                        Collectors.summingInt(ShopPoint::getVariablePoint)
                ));
        List<Shop> shopList = shopService.list();
        Integer sPoint = 0;
        Integer shopCommissionPoint = 0;
        Integer subShopCommissionPoint = 0;
        for (Shop shop : shopList) {
            sPoint += shop.getServerPoint();
            shopCommissionPoint += shop.getSharePoint();
            subShopCommissionPoint += shop.getLowerLevelSharePoint();
        }
        ShopPointStatistics shopPointStatistics = new ShopPointStatistics();
        int sPoint = shopPointMap.getOrDefault(PointChangeType.SHOP_ACHIEVEMENT.getCode(), 0);
        int shopCommissionPoint = shopPointMap.getOrDefault(PointChangeType.SHOP_REBATE.getCode(), 0);
        int subShopCommissionPoint = shopPointMap.getOrDefault(PointChangeType.JUNIOR_SHOP_REBATE.getCode(), 0);
        shopPointStatistics.setTotalPoint(sPoint + shopCommissionPoint + subShopCommissionPoint);
        shopPointStatistics.setShopPoint(sPoint);
        shopPointStatistics.setShopCommissionPoint(shopCommissionPoint);
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/service/impl/TechnicianSubscribeServiceImpl.java
@@ -119,19 +119,6 @@
    }
    @Override
    public void switchingTechnician(TechnicianSubscribe technicianSubscribe) {
        List<TechnicianSubscribe> list = this.list(new LambdaQueryWrapper<TechnicianSubscribe>().eq(TechnicianSubscribe::getOrderId, technicianSubscribe.getOrderId())
                .eq(TechnicianSubscribe::getDelFlag, 0).eq(TechnicianSubscribe::getStatus, 0));
        for (TechnicianSubscribe subscribe : list) {
            if(subscribe.getTechnicianId().equals(technicianSubscribe.getTechnicianId())){
                throw new RuntimeException("不能切换相同的技师");
            }
            subscribe.setTechnicianId(technicianSubscribe.getTechnicianId());
            this.updateById(subscribe);
        }
    }
    /**
     * 定时修改到期状态