| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.account.service.ITEnterpriseWithdrawalService; |
| | | import com.stylefeng.guns.modular.account.service.UserWithdrawalService; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.service.ICompanyService; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IReassignService; |
| | | import com.stylefeng.guns.modular.system.util.PayMoneyUtil; |
| | | import com.stylefeng.guns.modular.system.util.rongyun.RongYunUtil; |
| | | import com.stylefeng.guns.modular.system.util.rongyun.model.CloudRecordingCallback; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.BufferedReader; |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | @Autowired |
| | | private IDriverService driverService; |
| | | @Autowired |
| | | private ICompanyService companyService; |
| | | @Autowired |
| | | private ITEnterpriseWithdrawalService enterpriseWithdrawalService; |
| | | @Autowired |
| | | private UserWithdrawalService userWithdrawalService; |
| | | |
| | | |
| | | @Autowired |
| | | private IOrderPrivateCarService orderPrivateCarService; |
| | | |
| | | @Autowired |
| | | private IOrderTaxiService orderTaxiService; |
| | | |
| | | @Autowired |
| | | private IOrderCrossCityService orderCrossCityService; |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/rongYunCallBack") |
| | | public void rongYunCallBack(HttpServletRequest request, HttpServletResponse response){ |
| | | CloudRecordingCallback cloudRecordingCallback = RongYunUtil.cloudRecordingCallback(request); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | System.err.println(sdf.format(new Date()) + "-------------------云端录制状态回调!-------------------"); |
| | | System.err.println(JSON.toJSONString(cloudRecordingCallback)); |
| | | if(null == cloudRecordingCallback){ |
| | | System.err.println("云端录制状态回调解析出错!"); |
| | | return; |
| | | } |
| | | Integer type = cloudRecordingCallback.getType(); |
| | | if(4 == type){//文件上传 |
| | | String fileUrl = cloudRecordingCallback.getOutput().getFileUrl(); |
| | | String roomId = cloudRecordingCallback.getRoomId(); |
| | | String[] split = roomId.split("_"); |
| | | String orderType = split[0]; |
| | | String orderId = split[1]; |
| | | if("1".equals(orderType)){ |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); |
| | | orderPrivateCar.setVoice(fileUrl); |
| | | orderPrivateCarService.updateById(orderPrivateCar); |
| | | } |
| | | if("2".equals(orderType)){ |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(orderId); |
| | | orderTaxi.setVoice(fileUrl); |
| | | orderTaxiService.updateById(orderTaxi); |
| | | } |
| | | if("3".equals(orderType)){ |
| | | OrderCrossCity orderCrossCity = orderCrossCityService.selectById(orderId); |
| | | orderCrossCity.setVoice(fileUrl); |
| | | orderCrossCityService.updateById(orderCrossCity); |
| | | } |
| | | |
| | | // TODO 顺风车 |
| | | } |
| | | PrintWriter out = null; |
| | | try { |
| | | out = response.getWriter(); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | out.print("OK"); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | |
| | | } |