ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
@@ -250,7 +250,7 @@ @PostMapping("/confirmDelivery") @ApiOperation(value = "已发货操作", tags = {"管理后台-订单管理"}) public R confirmDelivery(@RequestBody ConfirmDelivery confirmDelivery){ return orderService.confirmDelivery(confirmDelivery.getOrderId(), confirmDelivery.getCode()); return orderService.confirmDelivery(confirmDelivery); } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/OrderService.java
@@ -45,11 +45,9 @@ /** * 确认发货操作 * @param orderId * @param code * @return */ R confirmDelivery(Long orderId, String code); R confirmDelivery(ConfirmDelivery confirmDelivery); /** ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
@@ -371,8 +371,8 @@ * @return */ @Override public R confirmDelivery(Long orderId, String code) { Order order = this.getById(orderId); public R confirmDelivery(ConfirmDelivery confirmDelivery) { Order order = this.getById(confirmDelivery.getOrderId()); if(1 == order.getPayStatus()){ return R.fail("订单还未完成支付"); } @@ -383,7 +383,13 @@ return R.fail("无效的操作"); } //添加快递号和修改订单状态 order.setExpressJson(code); order.setExpressJson(confirmDelivery.getCode()); order.setDeliverProvince(confirmDelivery.getDeliverProvince()); order.setDeliverProvinceCode(confirmDelivery.getDeliverProvinceCode()); order.setDeliverCity(confirmDelivery.getDeliverCity()); order.setDeliverCityCode(confirmDelivery.getDeliverCityCode()); order.setDeliverDistrict(confirmDelivery.getDeliverDistrict()); order.setDeliverDistrictCode(confirmDelivery.getDeliverDistrictCode()); order.setOrderStatus(2); //添加查询快递信息队列 //一小时后定时查询快递信息 @@ -392,7 +398,7 @@ Integer waitTime = jsonObject.getInteger("waitTime"); redisTemplate.opsForZSet().add("order_express", order.getId(), LocalDateTime.now().plusHours(waitTime).toEpochSecond(ZoneOffset.UTC)); JSONObject jsonObject1 = JSON.parseObject(code); JSONObject jsonObject1 = JSON.parseObject(confirmDelivery.getCode()); String com = jsonObject1.getString("com"); String num = jsonObject1.getString("num"); UserAddress userAddress = JSON.parseObject(order.getAddressJson(), UserAddress.class); ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/vo/ConfirmDelivery.java
@@ -1,5 +1,6 @@ package com.ruoyi.order.vo; import com.baomidou.mybatisplus.annotation.TableField; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -15,4 +16,22 @@ private Long orderId; @ApiModelProperty("快递json信息{\"com\":\"shunfeng\",\"num\":\"123456\"}") private String code; @ApiModelProperty(value = "发货省") private String deliverProvince; @ApiModelProperty(value = "发货省编号") private String deliverProvinceCode; @ApiModelProperty(value = "发货市") private String deliverCity; @ApiModelProperty(value = "发货市编号") private String deliverCityCode; @ApiModelProperty(value = "发货区") private String deliverDistrict; @ApiModelProperty(value = "发货区编号") private String deliverDistrictCode; } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TechnicianController.java
@@ -84,11 +84,8 @@ @PostMapping("/manage/addorupdate") @ApiOperation(value = "添加编辑", tags = {"门店-技师列表"}) public R<Page<Technician>> add(@RequestBody Technician technician) { Long userid = tokenService.getLoginUser().getUserid(); SysUser sysUser = sysUserClient.getSysUser(userid).getData(); if (technician.getId()==null) { technician.setSubscribeStatus(2); List<Technician> list = technicianService.lambdaQuery().eq(Technician::getPhone, technician.getPhone()).eq(Technician::getShopId, sysUser.getObjectId()).list(); @@ -109,18 +106,14 @@ appUserShopClient.saveAppUserShop(appUserShop); }else { Technician byId = technicianService.getById(technician.getId()); if (byId.getPhone()!=technician.getPhone()){ List<Technician> list = technicianService.lambdaQuery() .eq(Technician::getPhone, technician.getPhone()) .ne(Technician::getId, byId.getId()).list(); if (!list.isEmpty()) { List<Technician> list = technicianService.lambdaQuery().eq(Technician::getPhone, technician.getPhone()).eq(Technician::getShopId, sysUser.getObjectId()) .ne(Technician::getId, technician.getId()).list(); if(list.size() > 0){ return R.fail("当前号码已经添加"); } R<AppUser> appUserByPhone1 = appUserClient.getAppUserByPhone1(technician.getPhone()); if (appUserByPhone1.getData()==null){ return R.fail("当前号码暂无注册用户"); } } } technician.setShopId(sysUser.getObjectId()); @@ -138,7 +131,21 @@ @GetMapping("/manage/delete") @ApiOperation(value = "删除", tags = {"门店-技师列表"}) public R<Page<Technician>> delete(@RequestParam Integer id) { technicianService.removeById(id); Technician technician = technicianService.getById(id); technician.setDelFlag(1); technicianService.updateById(technician); //检查删除app_user_shop数据 AppUserShop appUserShop = new AppUserShop(); appUserShop.setAppUserId(technician.getAppUserId()); appUserShop.setShopId(technician.getShopId()); appUserShop.setRoleType(3); appUserShopClient.delAppUserShop(appUserShop); List<AppUserShop> userShopList = appUserShopClient.getAppUserShop(technician.getAppUserId()).getData(); if(userShopList.size() == 0){ AppUser appUser = appUserClient.getAppUserById(technician.getAppUserId()); appUser.setUserType(1); appUserClient.editAppUserById(appUser); } return R.ok(); }