| | |
| | | import java.io.FileWriter; |
| | | import java.io.PrintWriter; |
| | | import java.math.BigDecimal; |
| | | import java.math.MathContext; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | |
| | | |
| | |
| | | @Autowired |
| | | private GDMapGeocodingUtil gdMapGeocodingUtil; |
| | | |
| | | @Autowired |
| | | private ChinaMobileUtil chinaMobileUtil; |
| | | // @Autowired |
| | | // private ChinaMobileUtil chinaMobileUtil; |
| | | |
| | | @Resource |
| | | private RegionMapper regionMapper; |
| | |
| | | //调用移动的小号接口 |
| | | /*Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | Region region = regionMapper.query(geocode.get("districtCode"));*/ |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), null); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderPrivateCar.setTelX(map.get("telX")); |
| | | orderPrivateCar.setBindId(map.get("bindId")); |
| | | } |
| | | System.out.println(map); |
| | | // Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), null); |
| | | // if(String.valueOf(map.get("code")).equals("200")){ |
| | | // orderPrivateCar.setTelX(map.get("telX")); |
| | | // orderPrivateCar.setBindId(map.get("bindId")); |
| | | // } |
| | | // System.out.println(map); |
| | | this.updateById(orderPrivateCar); |
| | | |
| | | //如果是预约单,则不修改司机为服务中 |
| | |
| | | } |
| | | if(company.getIsSpeFixedOrProportional() == 1){//比例 |
| | | Double price = orderPrivateCar.getStartMoney() + orderPrivateCar.getMileageMoney() + orderPrivateCar.getWaitMoney() + orderPrivateCar.getDurationMoney() + orderPrivateCar.getLongDistanceMoney(); |
| | | d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | d = new BigDecimal(price).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100), new MathContext(2, RoundingMode.HALF_EVEN))).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | c = new BigDecimal(orderPrivateCar.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | incomeService.saveData(1, orderPrivateCar.getCompanyId(), 2, orderPrivateCar.getId(), 1, d.doubleValue()); |
| | |
| | | orderPrivateCar.setState(7); |
| | | } |
| | | |
| | | Map<String, String> map = chinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId(),orderPrivateCar.getTelX()); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderPrivateCar.setTelX(""); |
| | | orderPrivateCar.setBindId(""); |
| | | } |
| | | // Map<String, String> map = chinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId(),orderPrivateCar.getTelX()); |
| | | // if(String.valueOf(map.get("code")).equals("200")){ |
| | | // orderPrivateCar.setTelX(""); |
| | | // orderPrivateCar.setBindId(""); |
| | | // } |
| | | this.updateById(orderPrivateCar); |
| | | |
| | | |