| | |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.dto.ChargingOrderGroup; |
| | | import com.ruoyi.common.core.dto.ChargingPercentProvinceDto; |
| | | import com.ruoyi.common.core.web.page.PageInfo; |
| | | import com.ruoyi.order.dto.GetImportOrderDTO; |
| | | import com.ruoyi.order.model.ChargeOrder; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = "充电订单") |
| | | @RestController |
| | |
| | | public class ChargeOrderController { |
| | | @Resource |
| | | private ChargeOrderService chargeOrderService; |
| | | @PostMapping(value = "/getBySiteIdAndTime") |
| | | public R<List<ChargingOrderGroup>> getBySiteIdAndTime(@RequestBody ChargingPercentProvinceDto chargingPercentProvinceDto) { |
| | | |
| | | List<ChargingOrderGroup> groups = chargeOrderService.chargingOrderGroup(chargingPercentProvinceDto); |
| | | return R.ok(groups); |
| | | } |
| | | /** |
| | | * 导入充电信息 |
| | | */ |
| | | @PostMapping("/importExpress") |
| | | public R importExpress(@RequestBody String url) { |
| | | JSONObject jsonObject = JSONObject.parseObject(url); |
| | | String url2 = jsonObject.getString("url"); |
| | | chargeOrderService.importExpress(url2); |
| | | return R.ok(); |
| | | public R importExpress(@RequestParam("file") MultipartFile file) { |
| | | /* JSONObject jsonObject = JSONObject.parseObject(url); |
| | | String url2 = jsonObject.getString("url");*/ |
| | | if (file.isEmpty()) { |
| | | return R.fail("请选择要上传的文件"); |
| | | } |
| | | |
| | | return chargeOrderService.importExpress(file); |
| | | } |
| | | |
| | | /** |