1.
phpcjl
2024-12-10 1690d4d06b0c20b3606e50e0844ef67e07947a0d
1.
7个文件已修改
50 ■■■■■ 已修改文件
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/TechnicianClientFallbackFactory.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/TechnicianClient.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/OrderService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/factory/TechnicianClientFallbackFactory.java
@@ -2,6 +2,7 @@
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.Technician;
import com.ruoyi.other.api.domain.TechnicianSubscribe;
import com.ruoyi.other.api.feignClient.TechnicianClient;
import org.springframework.cloud.openfeign.FallbackFactory;
@@ -15,9 +16,14 @@
            }
            @Override
            public R<Void> updateStatus(Integer status, Integer subscribeId) {
            public R<Void> updateStatus(Integer status, Long subscribeId) {
                return R.fail("跟新技师预约状态失败:" + cause.getMessage());
            }
            @Override
            public R<TechnicianSubscribe> getSubscribeByOrderId(Long orderId) {
                return R.fail("根据订单id获取预约信息失败:" + cause.getMessage());
            }
        };
    }
}
ruoyi-api/ruoyi-api-other/src/main/java/com/ruoyi/other/api/feignClient/TechnicianClient.java
@@ -3,6 +3,7 @@
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.Technician;
import com.ruoyi.other.api.domain.TechnicianSubscribe;
import com.ruoyi.other.api.factory.TechnicianClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
@@ -16,5 +17,8 @@
    R<Technician> shopdetail(@RequestParam("id") Integer techId);
    @PutMapping("/technician-subscribe/updateStatus")
    R<Void> updateStatus(@RequestParam("status") Integer status, @RequestParam("subscribeId") Integer subscribeId);
    R<Void> updateStatus(@RequestParam("status") Integer status, @RequestParam("subscribeId") Long subscribeId);
    @GetMapping("/technician-subscribe/getSubscribeByOrderId")
    R<TechnicianSubscribe> getSubscribeByOrderId(@RequestParam("orderId") Long orderId);
}
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/OrderService.java
@@ -24,5 +24,4 @@
    void writeOff(String code,Integer shopId);
    void commission(Long orderId);
}
ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
@@ -210,14 +210,15 @@
        orderMapper.updateById(order);
        Integer orderType = order.getOrderType();
        if (orderType.equals(OrderType.SERVICE.getCode())){
            R<Technician> shopdetail = technicianClient.shopdetail(order.getTechnicianId());
            if (shopdetail.getCode() != R.SUCCESS){
                throw new ServiceException("获取技师信息失败");
            R<TechnicianSubscribe> subscribeR = technicianClient.getSubscribeByOrderId(order.getId());
            if (R.isError(subscribeR)){
                throw new ServiceException("获取预约信息失败");
            }
            Technician technician = shopdetail.getData();
            R<Void> r = technicianClient.updateStatus(2, technician.getId());
            if (r.getCode() != R.SUCCESS){
                throw new ServiceException("修改技师状态失败");
            TechnicianSubscribe subscribe = subscribeR.getData();
            subscribe.setStatus(2);
            R<Void> r = technicianClient.updateStatus(subscribe.getStatus(), subscribe.getId());
            if (R.isError(r)){
                throw new ServiceException("更新预约状态失败");
            }
        }
@@ -234,12 +235,5 @@
        JSONObject jsonObject = JSONObject.parseObject(content);
        Long days = jsonObject.getLong("days");
        commissionService.addToCommissionDelayQueue(order.getId(), LocalDateTime.now().plusDays(days));
    }
    @Override
    public void commission(Long orderId) {
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsCategoryController.java
@@ -75,8 +75,7 @@
        List<GoodsCategory> indexlist = goodsCategoryService.lambdaQuery()
                .orderByDesc(GoodsCategory::getCreateTime)
                .last("limit 8")
                .list()
                ;
                .list();
        return R.ok(indexlist);
    }
    @GetMapping("/list")
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianSubscribeController.java
@@ -104,6 +104,13 @@
        return R.ok(technicianSubscribeService.getTechnicianSubscribeByUser(page, SecurityUtils.getUserId(), status));
    }
    @GetMapping("/getSubscribeByOrderId")
    @ApiOperation(value = "根据订单id获取预约信息", notes = "根据订单id获取预约信息", tags = {"后台-技师预约管理-根据订单id获取预约信息"})
    public R<TechnicianSubscribe> getSubscribeByOrderId(@ApiParam(value = "订单id") @RequestParam Long orderId) {
        return R.ok(technicianSubscribeService.getOne(new LambdaQueryWrapper<TechnicianSubscribe>()
                .eq(TechnicianSubscribe::getOrderId, orderId)));
    }
}
ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/mapper/TechnicianMapper.java
@@ -4,6 +4,7 @@
import com.ruoyi.other.api.domain.Technician;
import com.ruoyi.other.vo.TechnicianDetailVO;
import com.ruoyi.other.vo.TechnicianVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -17,7 +18,7 @@
 */
public interface TechnicianMapper extends BaseMapper<Technician> {
    List<TechnicianVO> selectTechnicianListByShopId(Long shopId, String name);
    List<TechnicianVO> selectTechnicianListByShopId(@Param("shopId") Long shopId,@Param("name") String name);
    TechnicianDetailVO selectTechnicianDetail(Long technicianId);