| | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.ruoyi.account.api.feignClient.AppUserClient; |
| | | import com.ruoyi.account.api.feignClient.UserAddressClient; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.UserAddress; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | |
| | | import com.ruoyi.order.util.vo.MapTrackKD100Vo; |
| | | import com.ruoyi.order.vo.*; |
| | | import com.ruoyi.other.api.domain.BaseSetting; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.feignClient.BaseSettingClient; |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | import io.swagger.annotations.*; |
| | | import org.springframework.core.io.InputStreamResource; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.validation.constraints.NotBlank; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.PrintWriter; |
| | | import java.math.BigDecimal; |
| | | import java.net.URL; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | |
| | | private SysUserClient sysUserClient; |
| | | @Resource |
| | | private RefundPassService refundPassService; |
| | | @Resource |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | /** |
| | |
| | | .notIn(Order::getOrderStatus, 5, 6).list(); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @PostMapping("/byShopId") |
| | | public R<List<Order>> byShopId(@RequestParam("shopId") Integer shopId){ |
| | | return R.ok(orderService.lambdaQuery().isNotNull(Order::getEndTime).eq(Order::getShopId, shopId).list()); |
| | | } |
| | | |
| | | @PostMapping("/byShopIdAndUserId") |
| | | public R<List<Order>> byShopIdAndUserId(@RequestParam("appUserId") Long appUserId,@RequestParam("shopId") Integer shopId){ |
| | | List<Order> list = orderService.lambdaQuery().isNotNull(Order::getEndTime) |
| | |
| | | .notIn(Order::getOrderStatus, 5, 6).list(); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/confirmDelivery") |
| | |
| | | |
| | | /** |
| | | * 订单取消支付回退 |
| | | * |
| | | * @param refundCallbackResult |
| | | * @param response |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 取消订单快递费回退 |
| | | * |
| | | * @param refundCallbackResult |
| | | * @param response |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取商品销售数量 |
| | | * |
| | | * @param goodsId |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取门店销售订单数量 |
| | | * |
| | | * @param shopId 门店id |
| | | * @param type 1:服务订单,2:单品订单 |
| | | * @return |
| | |
| | | |
| | | /** |
| | | * 获取所有在指定门店消费的用户id |
| | | * |
| | | * @param shopId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 获取订单快递明细 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据id获取订单详情 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改订单 |
| | | * |
| | | * @param order |
| | | * @return |
| | | */ |
| | |
| | | */ |
| | | @GetMapping("/exportExpress") |
| | | public void exportExpress(HttpServletResponse response,OrderPageList orderPage){ |
| | | orderPage.setPageCurr(1); |
| | | orderPage.setPageSize(Integer.MAX_VALUE); |
| | | PageInfo<OrderPageListVo> orderPageList = orderService.getOrderPageList(orderPage); |
| | | List<OrderPageListVo> list = orderPageList.getRecords(); |
| | | ExcelUtil<OrderPageListVo> util = new ExcelUtil<OrderPageListVo>(OrderPageListVo.class); |
| | | util.exportExcel(response, list, "订单数据"); |
| | | |
| | | List<OrderExport> orderExportList = orderMapper.getOrderExportList(orderPage); |
| | | orderExportList.forEach(orderExport -> { |
| | | Long appUserId = orderExport.getAppUserId(); |
| | | AppUser appUserById = appUserClient.getAppUserById(appUserId); |
| | | if (null != appUserById){ |
| | | orderExport.setUserName(appUserById.getName()); |
| | | orderExport.setPhone(appUserById.getPhone()); |
| | | } |
| | | String goodJson = orderExport.getGoodJson(); |
| | | if (StringUtils.isNotEmpty(goodJson) && !"NULL".equals(goodJson)) { |
| | | Goods goods = JSONObject.parseObject(goodJson, Goods.class); |
| | | orderExport.setGoodsName(goods.getName()); |
| | | orderExport.setCostPrice(goods.getShopCost().add(goods.getOperatingCost())); |
| | | } |
| | | |
| | | String expressJson = orderExport.getExpressJson(); |
| | | if (StringUtils.isNotEmpty(expressJson) && !expressJson.equals("NULL")) { |
| | | JSONObject jsonObject = JSONObject.parseObject(expressJson); |
| | | orderExport.setExpressNum(jsonObject.getString("num")); |
| | | orderExport.setExpressName(jsonObject.getString("com")); |
| | | } |
| | | |
| | | |
| | | }); |
| | | |
| | | ExcelUtil<OrderExport> util = new ExcelUtil<OrderExport>(OrderExport.class); |
| | | util.exportExcel(response, orderExportList, "订单数据"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取用户订单数量 |
| | | * |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | |
| | | return R.ok(count); |
| | | } |
| | | |
| | | |
| | | } |
| | | |