Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/qijisheng
New file |
| | |
| | | {"address":"四川省成都市武侯区锦辉西二街天府新谷9号楼二单元1005A","days":10,"name":"平台退货地址嘎嘎嘎嘎","phone":"19912351325"} |
| | |
| | | @PostMapping("/confirmDelivery") |
| | | @ApiOperation(value = "已发货操作", tags = {"管理后台-订单管理"}) |
| | | public R confirmDelivery(@RequestBody ConfirmDelivery confirmDelivery){ |
| | | return orderService.confirmDelivery(confirmDelivery.getOrderId(), confirmDelivery.getCode()); |
| | | return orderService.confirmDelivery(confirmDelivery); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | /** |
| | | * 确认发货操作 |
| | | * @param orderId |
| | | * @param code |
| | | * @return |
| | | */ |
| | | R confirmDelivery(Long orderId, String code); |
| | | R confirmDelivery(ConfirmDelivery confirmDelivery); |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | // 生成核销码BASE64 |
| | | try { |
| | | String base64 = QRCodeGenerator.generateQRCodeBase64(order.getOrderNumber(), 124, 124); |
| | | String base64 = QRCodeGenerator.generateQRCodeBase64(String.valueOf(order.getId()), 124, 124); |
| | | orderDetailVO.setWriteOffCode(base64); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | orderPageListVo.setUserName(appUser.getName()); |
| | | orderPageListVo.setPhone(appUser.getPhone()); |
| | | } |
| | | RefundPass one = refundPassService.getOne(new LambdaQueryWrapper<RefundPass>().eq(RefundPass::getOrderId, orderPageListVo.getId()).eq(RefundPass::getDelFlag, 0).last(" order by create_time desc limit 0,1")); |
| | | // RefundPass one = refundPassService.getOne(new LambdaQueryWrapper<RefundPass>().eq(RefundPass::getOrderId, orderPageListVo.getId()).eq(RefundPass::getDelFlag, 0).last(" order by create_time desc limit 0,1")); |
| | | RefundPass one = refundPassService.lambdaQuery().eq(RefundPass::getOrderId, orderPageListVo.getId()).one(); |
| | | |
| | | orderPageListVo.setRefundPassId(null != one ? one.getId().toString() : null); |
| | | } |
| | | return pageInfo.setRecords(list); |
| | |
| | | * @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("订单还未完成支付"); |
| | | } |
| | |
| | | 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); |
| | | //添加查询快递信息队列 |
| | | //一小时后定时查询快递信息 |
| | |
| | | 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); |
| | |
| | | package com.ruoyi.order.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | 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; |
| | | } |
| | |
| | | */ |
| | | @GetMapping("/goodsDetail/{goodsId}") |
| | | @ApiOperation(value = "商品详情", tags = {"小程序-商城-首页"}) |
| | | public R<GoodsVO> goodsDetail(@PathVariable("goodsId") Long goodsId, String longitude, String latitude){ |
| | | return R.ok(goodsService.goodsDetail(goodsId, longitude, latitude)); |
| | | public R<GoodsVO> goodsDetail(@PathVariable("goodsId") Long goodsId, |
| | | Integer shopId, |
| | | String longitude, |
| | | String latitude) { |
| | | return R.ok(goodsService.goodsDetail(goodsId, shopId, longitude, latitude)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据类型(1=服务商品,2=单品商品)获取商品数据 |
| | | * @param type |
| | |
| | | List<Goods> list = goodsService.list(new LambdaQueryWrapper<Goods>().eq(Goods::getType, type).eq(Goods::getDelFlag, 0).eq(Goods::getStatus, 2)); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据id获取商品信息 |
| | | * @param id |
| | |
| | | @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(); |
| | |
| | | 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()) { |
| | | return R.fail("当前号码已经添加"); |
| | | } |
| | | R<AppUser> appUserByPhone1 = appUserClient.getAppUserByPhone1(technician.getPhone()); |
| | | if (appUserByPhone1.getData()==null){ |
| | | return R.fail("当前号码暂无注册用户"); |
| | | } |
| | | 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()); |
| | |
| | | @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(); |
| | | } |
| | | |
| | |
| | | |
| | | PageInfo<GoodsVO> goodsList(Goods goods); |
| | | |
| | | GoodsVO goodsDetail(Long goodsId, String longitude, String latitude); |
| | | GoodsVO goodsDetail(Long goodsId, Integer shopId, String longitude, String latitude); |
| | | |
| | | List<Goods> getGoodsListByShopId(PageInfo<Goods> pageInfo, Integer shopId); |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public GoodsVO goodsDetail(Long goodsId, String longitude, String latitude) { |
| | | public GoodsVO goodsDetail(Long goodsId, Integer shopId, String longitude, String latitude) { |
| | | if (goodsId == null || goodsId <= 0) { |
| | | throw new NullPointerException("商品ID不能为空"); |
| | | } |
| | |
| | | BeanUtils.copyBeanProp(goodsVO, goods); |
| | | goodsVO.setGoodsId(goods.getId()); |
| | | goodsVO.setGoodsName(goods.getName()); |
| | | Price price = getPrice(vipId, goods.getId(), null, 1, provinceCode, cityCode, districtCode); |
| | | Price price = getPrice(vipId, goods.getId(), shopId, 1, provinceCode, cityCode, districtCode); |
| | | if(null != price){ |
| | | goodsVO.setPointPayment(price.getPointPayment() ? 1 : 0); |
| | | goodsVO.setCashPayment(price.getCashPayment() ? 1 : 0); |