| | |
| | | import com.ruoyi.account.api.model.UserAddress; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.poi.ExcelUtil; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | |
| | | 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.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; |
| | |
| | | * 导入物流信息 |
| | | */ |
| | | @PostMapping("/importExpress") |
| | | public R importExpress(@RequestParam("file") MultipartFile file){ |
| | | public R importExpress(@RequestBody String url){ |
| | | JSONObject jsonObject = JSONObject.parseObject(url); |
| | | String url2 = jsonObject.getString("url"); |
| | | orderService.importExpress(url2); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 导出订单信息 |
| | | */ |
| | | @GetMapping("/exportExpress") |
| | | public void exportExpress(HttpServletResponse response,OrderPageList orderPage){ |
| | | PageInfo<OrderPageListVo> orderPageList = orderService.getOrderPageList(orderPage); |
| | | List<OrderPageListVo> list = orderPageList.getRecords(); |
| | | ExcelUtil<OrderPageListVo> util = new ExcelUtil<OrderPageListVo>(OrderPageListVo.class); |
| | | util.exportExcel(response, list, "订单数据"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取用户订单数量 |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | | @PostMapping("/getOrderCountByAppUserId") |
| | | public R<Long> getOrderCountByAppUserId(@RequestParam("id") Long appUserId){ |
| | | long count = orderService.count(new LambdaQueryWrapper<Order>().eq(Order::getDelFlag, 0) |
| | | .eq(Order::getAppUserId, appUserId).in(Order::getOrderStatus, Arrays.asList(1, 2, 3, 4, 7, 8)) |
| | | .eq(Order::getPayStatus, 2)); |
| | | return R.ok(count); |
| | | } |
| | | |
| | | } |
| | | |