93个文件已修改
100个文件已删除
15个文件已添加
| | |
| | | @Bean |
| | | public CookieRememberMeManager rememberMeManager(SimpleCookie rememberMeCookie) { |
| | | CookieRememberMeManager manager = new CookieRememberMeManager(); |
| | | manager.setCipherKey(Base64.decode("Z3VucwAAAAAAAAAAAAAAAA==")); |
| | | manager.setCipherKey(Base64.decode("")); |
| | | manager.setCookie(rememberMeCookie); |
| | | return manager; |
| | | } |
| | |
| | | */ |
| | | @Bean |
| | | public SimpleCookie rememberMeCookie() { |
| | | SimpleCookie simpleCookie = new SimpleCookie("rememberMe"); |
| | | SimpleCookie simpleCookie = new SimpleCookie(""); |
| | | simpleCookie.setHttpOnly(true); |
| | | simpleCookie.setMaxAge(7 * 24 * 60 * 60);//7天 |
| | | return simpleCookie; |
| | |
| | | @PostMapping("/queryByType") |
| | | @ApiOperation(value = "获取各种协议及H5页面", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "数据类型(1:隐私协议,2:用户协议,3:用户指南,4:法律条款,5:关于我们,6=注册协议,7=取消订单说明,8=充值领券规则设置,17=超时扣款协议,18=投诉扣款须知,19:汽车出租协议,20:汽车售卖协议)", name = "type", required = true, dataType = "int") |
| | | @ApiImplicitParam(value = "数据类型(1:隐私协议,2:用户协议,3:用户指南,4:法律条款,5:关于我们,6=注册协议,7=取消订单说明,8=充值领券规则设置)", name = "type", required = true, dataType = "int") |
| | | }) |
| | | public ResultUtil<BaseWarpper> queryByType(Integer type){ |
| | | try { |
| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.model.BankCard; |
| | | import com.stylefeng.guns.modular.system.service.IBankCardService; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.util.LiuZhouBank.ProtocolSignUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | |
| | | |
| | | @Autowired |
| | | private IDriverService driverService; |
| | | |
| | | |
| | | // @ResponseBody |
| | | // @PostMapping("/getSignSendSms") |
| | | // @ApiOperation(value = "发送签约银行验证短信", tags = {"司机端-个人中心"}, notes = "") |
| | | // @ApiImplicitParams({ |
| | | // @ApiImplicitParam(value = "身份证号码", name = "IdNum", required = true, dataType = "String"), |
| | | // @ApiImplicitParam(value = "银行预留电话", name = "phone", required = true, dataType = "String"), |
| | | // @ApiImplicitParam(value = "开户姓名", name = "acctName", required = true, dataType = "String"), |
| | | // @ApiImplicitParam(value = "银行卡号", name = "acctNum", required = true, dataType = "String"), |
| | | // @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | // }) |
| | | // public ResultUtil getSignSendSms(String IdNum, String phone, String acctName, String acctNum){ |
| | | // try { |
| | | // ResultUtil<String> stringResultUtil = ProtocolSignUtil.protocolSignSendSms(IdNum, phone, acctName, acctNum); |
| | | // if(200 != stringResultUtil.getCode()){ |
| | | // return stringResultUtil; |
| | | // } |
| | | // return ResultUtil.success(); |
| | | // }catch (Exception e){ |
| | | // e.printStackTrace(); |
| | | // return ResultUtil.runErr(); |
| | | // } |
| | | // } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/saveBankCard1") |
| | | @ApiOperation(value = "保存银行卡信息【新】", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "身份证号码", name = "IdNum", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "银行预留电话", name = "phone", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "开户姓名", name = "acctName", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "银行卡号", name = "acctNum", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "短信验证码", name = "code", required = true, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil saveBankCard1(String IdNum, String phone, String acctName, String acctNum, String code, HttpServletRequest request){ |
| | | try { |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if(null == driverId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return bankCardService.saveBankCard1(driverId, IdNum, phone, acctName, acctNum, code); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 删除银行卡号 |
| | | * @param id |
| | |
| | | |
| | | @Autowired |
| | | private IReassignService reassignService; |
| | | |
| | | @Autowired |
| | | private ICBCPayUtil icbcPayUtil; |
| | | |
| | |
| | | try { |
| | | Map<String, String> map = payMoneyUtil.weixinpayCallback(request); |
| | | if(null != map){ |
| | | String id = map.get("out_trade_no"); |
| | | String order_id = map.get("transaction_id"); |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String transaction_id = map.get("transaction_id"); |
| | | |
| | | String substring = out_trade_no.substring(17); |
| | | Integer type = Integer.valueOf(substring.substring(0, 1)); |
| | | Integer id = Integer.valueOf(substring.substring(1)); |
| | | reassignService.payReassign(id.toString(), type, transaction_id, 1); |
| | | |
| | | String result = map.get("result"); |
| | | if(ToolUtil.isNotEmpty(id) && ToolUtil.isNotEmpty(order_id)){ |
| | | PrintWriter out = response.getWriter(); |
| | | out.write(result); |
| | | out.flush(); |
| | | out.close(); |
| | | reassignService.payReassign(id, order_id, 1); |
| | | } |
| | | PrintWriter out = response.getWriter(); |
| | | out.print(result); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | try { |
| | | Map<String, String> map = payMoneyUtil.alipayCallback(request); |
| | | if(null != map){ |
| | | String id = map.get("out_trade_no"); |
| | | String order_id = map.get("trade_no"); |
| | | if(ToolUtil.isNotEmpty(id) && ToolUtil.isNotEmpty(order_id)){ |
| | | reassignService.payReassign(id, order_id, 2); |
| | | } |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String trade_no = map.get("trade_no"); |
| | | |
| | | String substring = out_trade_no.substring(17); |
| | | Integer type = Integer.valueOf(substring.substring(0, 1)); |
| | | Integer id = Integer.valueOf(substring.substring(1)); |
| | | reassignService.payReassign(id.toString(), type, trade_no, 2); |
| | | PrintWriter out = response.getWriter(); |
| | | out.print("success"); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.util.ALiSendSms; |
| | | import com.stylefeng.guns.modular.system.model.Income; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.warpper.ActivityWarpper; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.OrderPosition; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.math.BigDecimal; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.FileOutputStream; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 司机控制器 |
| | |
| | | @Autowired |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | |
| | | @Autowired |
| | | private IOfflineTravelPaymentService offlineTravelPaymentService; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | }) |
| | | public ResultUtil checkCaptcha(String phone, String code){ |
| | | try { |
| | | phone = AESUtil.decrypt(phone); |
| | | boolean b = driverService.checkCaptcha(phone, code); |
| | | if(b){ |
| | | Driver driver = driverService.queryByPhone(phone); |
| | | String encrypt = AESUtil.encrypt(phone); |
| | | Driver driver = driverService.queryByPhone(encrypt); |
| | | smsrecordService.saveData(null == driver ? 5 : 8, phone, code, "短信验证码【" + code + "】已发到您的手机,验证码将在5分钟后失效,请及时登录!"); |
| | | } |
| | | return b ? ResultUtil.success() : ResultUtil.error("验证码无效"); |
| | |
| | | }) |
| | | public ResultUtil<LoginWarpper> registeredDriver_(String phone, String code, String password){ |
| | | try { |
| | | phone = AESUtil.decrypt(phone); |
| | | return driverService.registeredDriver(phone, code, password); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | String templateCode = null; |
| | | switch (type){ |
| | | case 1: |
| | | templateCode = "SMS_229648175";//身份验证 |
| | | templateCode = "SMS_154775435";//身份验证 |
| | | break; |
| | | case 2: |
| | | templateCode = "SMS_229613335";//登录确认 |
| | | templateCode = "SMS_154775434";//登录确认 |
| | | break; |
| | | case 3: |
| | | templateCode = "SMS_229613333";//用户注册 |
| | | templateCode = "SMS_154775432";//用户注册 |
| | | break; |
| | | case 4: |
| | | templateCode = "SMS_229613329";//修改密码 |
| | | templateCode = "SMS_154775431";//修改密码 |
| | | break; |
| | | case 5: |
| | | templateCode = "SMS_229648168";//司机注册成功 |
| | | templateCode = "SMS_194650202";//司机注册成功 |
| | | break; |
| | | case 6: |
| | | templateCode = "SMS_229613326";//司机注册失败 |
| | | templateCode = "SMS_194610237";//司机注册失败 |
| | | break; |
| | | } |
| | | String s = aLiSendSms.sendSms(driver.getPhone(), templateCode, "{}"); |
| | | String phone = AESUtil.decrypt(driver.getPhone()); |
| | | String s = aLiSendSms.sendSms(phone, templateCode, "{}"); |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @PostMapping("/api/driver/work") |
| | | @ApiOperation(value = "司机上下班操作", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "上班的业务类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)多个已逗号分隔", name = "type", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "上班的业务类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)多个已逗号分隔", name = "type", required = false, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil work(String type, HttpServletRequest request){ |
| | |
| | | @PostMapping("/api/driver/work2") |
| | | @ApiOperation(value = "司机上下班操作,同时设置接单类型", tags = {"司机端-车载端"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "上班的业务类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)多个已逗号分隔", name = "type", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "上班的业务类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)多个已逗号分隔", name = "type", required = false, dataType = "String"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil work2(String type, HttpServletRequest request){ |
| | |
| | | @PostMapping("/api/driver/updateOrders") |
| | | @ApiOperation(value = "设置接单规则", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil updateOrders(Integer type, HttpServletRequest request){ |
| | |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private IReassignService reassignService; |
| | | |
| | | @Autowired |
| | | private ITimeOutAppealService timeOutAppealService; |
| | | |
| | | @Autowired |
| | | private ITComplaintDeductmoneyService complaintDeductmoneyService; |
| | | |
| | | /** |
| | | * 获取扣款明细 |
| | | * @param pageNum |
| | |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | // List<Map<String, Object>> list = driverService.queryPenalties(pageNum, size, uid); |
| | | List<Reassign> list1 = reassignService.selectList(new EntityWrapper<Reassign>().eq("originalDriverId",uid)); |
| | | List<Map<String, Object>> list = driverService.queryPenalties(pageNum, size, uid); |
| | | List<BaseWarpper> data = new ArrayList<>(); |
| | | |
| | | /// 存入改派处罚扣款 |
| | | for (Reassign reassign : list1) { |
| | | for(Map<String, Object> map : list){ |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | String insertTime = DateUtil.format(reassign.getInsertTime(),"yyyy-MM-dd HH:mm"); |
| | | baseWarpper.setAmount(reassign.getMoney()); |
| | | baseWarpper.setName("改派处罚"); |
| | | baseWarpper.setDay(insertTime); |
| | | baseWarpper.setAmount(Double.valueOf(String.valueOf(map.get("amount")))); |
| | | baseWarpper.setName(String.valueOf(map.get("name"))); |
| | | baseWarpper.setDay(String.valueOf(map.get("day"))); |
| | | data.add(baseWarpper); |
| | | } |
| | | |
| | | // List<TimeOutAppeal> list2 = timeOutAppealService.selectList(new EntityWrapper<TimeOutAppeal>().eq("driverId",uid)); |
| | | List<OrderLogistics> list2 = orderLogisticsService.selectList(new EntityWrapper<OrderLogistics>().eq("driverId",uid).gt("timeOutMoney",0)); |
| | | for (OrderLogistics timeOutAppeal : list2) { |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | String insertTime = DateUtil.format(timeOutAppeal.getEndServiceTime(),"yyyy-MM-dd HH:mm"); |
| | | baseWarpper.setDay(insertTime); |
| | | baseWarpper.setName("小件物流超时扣款"); |
| | | baseWarpper.setAmount(timeOutAppeal.getTimeOutMoney()); |
| | | data.add(baseWarpper); |
| | | } |
| | | |
| | | List<TComplaintDeductmoney> list3 = complaintDeductmoneyService.selectList(new EntityWrapper<TComplaintDeductmoney>().eq("driverId",uid)); |
| | | for (TComplaintDeductmoney tComplaintDeductmoney : list3) { |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | String insertTime = DateUtil.format(tComplaintDeductmoney.getCreateTime(),"yyyy-MM-dd HH:mm"); |
| | | baseWarpper.setDay(insertTime); |
| | | baseWarpper.setName("投诉扣款"); |
| | | baseWarpper.setAmount(tComplaintDeductmoney.getMoney()); |
| | | data.add(baseWarpper); |
| | | } |
| | | |
| | | List<BaseWarpper> collect = data.stream().sorted(Comparator.comparing(BaseWarpper::getDay).reversed()).collect(Collectors.toList()); |
| | | |
| | | List<BaseWarpper> data1 = new ArrayList<>(); |
| | | // 手动分页 |
| | | for (int i=(pageNum-1)*size; i<pageNum*size; i++){ |
| | | if (i < collect.size()){ |
| | | data1.add(collect.get(i)); |
| | | } |
| | | } |
| | | return ResultUtil.success(data1); |
| | | return ResultUtil.success(data); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | // List<Map<String, Object>> list = driverService.queryActivityIncome(uid, pageNum, size); |
| | | // List<BaseWarpper> data = new ArrayList<>(); |
| | | // for(Map<String, Object> map : list){ |
| | | // BaseWarpper baseWarpper = new BaseWarpper(); |
| | | // baseWarpper.setDay(String.valueOf(null != map.get("time") ? map.get("time") : "")); |
| | | // baseWarpper.setAmount(Double.valueOf(String.valueOf(null != map.get("money") ? map.get("money") : 0))); |
| | | // baseWarpper.setName("活动奖励"); |
| | | // data.add(baseWarpper); |
| | | // } |
| | | |
| | | |
| | | List<Income> list1 = incomeService.selectList(new EntityWrapper<Income>().eq("userType",2).eq("objectId",uid)); |
| | | List<Map<String, Object>> list = driverService.queryActivityIncome(uid, pageNum, size); |
| | | List<BaseWarpper> data = new ArrayList<>(); |
| | | |
| | | /// 存入改派处罚扣款 |
| | | for (Income income : list1) { |
| | | for(Map<String, Object> map : list){ |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | String insertTime = DateUtil.format(income.getInsertTime(),"yyyy-MM-dd HH:mm"); |
| | | baseWarpper.setDay(insertTime); |
| | | baseWarpper.setAmount(income.getMoney()); |
| | | if (income.getType() == 1){ |
| | | baseWarpper.setName("活动奖励"); |
| | | data.add(baseWarpper); |
| | | } |
| | | // else if (income.getType() == 2){ |
| | | // baseWarpper.setName("跑单收入"); |
| | | // }else if (income.getType() == 6){ |
| | | // baseWarpper.setName("感谢费"); |
| | | // } |
| | | |
| | | baseWarpper.setDay(String.valueOf(null != map.get("time") ? map.get("time") : "")); |
| | | baseWarpper.setAmount(Double.valueOf(String.valueOf(null != map.get("money") ? map.get("money") : 0))); |
| | | baseWarpper.setName("活动奖励"); |
| | | data.add(baseWarpper); |
| | | } |
| | | |
| | | List<TimeOutAppeal> list2 = timeOutAppealService.selectList(new EntityWrapper<TimeOutAppeal>().eq("driverId",uid)); |
| | | for (TimeOutAppeal timeOutAppeal : list2) { |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | String insertTime = DateUtil.format(timeOutAppeal.getCreateTime(),"yyyy-MM-dd HH:mm"); |
| | | baseWarpper.setDay(insertTime); |
| | | baseWarpper.setName("小件物流超时退款"); |
| | | if (timeOutAppeal.getState() == 2){ |
| | | baseWarpper.setAmount(timeOutAppeal.getReturnMoney()); |
| | | data.add(baseWarpper); |
| | | } |
| | | } |
| | | |
| | | List<BaseWarpper> collect = data.stream().sorted(Comparator.comparing(BaseWarpper::getDay).reversed()).collect(Collectors.toList()); |
| | | List<BaseWarpper> data1 = new ArrayList<>(); |
| | | // 手动分页 |
| | | for (int i=(pageNum-1)*size; i<pageNum*size; i++){ |
| | | if (i < collect.size()){ |
| | | data1.add(collect.get(i)); |
| | | } |
| | | } |
| | | return ResultUtil.success(data1); |
| | | return ResultUtil.success(data); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | baseWarpper.setName("跨城小件物流"); |
| | | break; |
| | | } |
| | | |
| | | Map<String, Object> map1 = new HashMap<>(); |
| | | |
| | | |
| | | switch (Integer.valueOf(map.get("orderType").toString())){ |
| | | case 1: |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(map.get("incomeId").toString()); |
| | |
| | | map1.put("tipMoney", 0);//小费 |
| | | map1.put("roadTollMoney", null != orderPrivateCar.getRoadTollMoney() ? orderPrivateCar.getRoadTollMoney() : 0);//过路费 |
| | | map1.put("rakeMoney", incomes.size() > 0 ? incomes.get(0).getMoney() : 0);//抽成 |
| | | map1.put("thankYouFee", null != orderPrivateCar.getThankYouFee() ? orderPrivateCar.getThankYouFee() : 0);//感谢费 |
| | | map1.put("returnMoney", 0);//超时退款金额 |
| | | } |
| | | |
| | | break; |
| | |
| | | map1.put("tipMoney", null != orderTaxi.getTipMoney() ? orderTaxi.getTipMoney(): 0);//小费 |
| | | map1.put("roadTollMoney", null != orderTaxi.getRoadTollMoney() ? orderTaxi.getRoadTollMoney() : 0);//过路费 |
| | | map1.put("rakeMoney", incomes1.size() > 0 ? incomes1.get(0).getMoney() : 0);//抽成 |
| | | map1.put("thankYouFee", null != orderTaxi.getThankYouFee() ? orderTaxi.getThankYouFee() : 0);//感谢费 |
| | | map1.put("returnMoney", 0);//超时退款金额 |
| | | } |
| | | |
| | | break; |
| | |
| | | map1.put("tipMoney", 0);//小费 |
| | | map1.put("roadTollMoney", 0);//过路费 |
| | | map1.put("rakeMoney", incomes2.size() > 0 ? incomes2.get(0).getMoney() : 0);//抽成 |
| | | map1.put("thankYouFee", null != orderCrossCity.getThankYouFee() ? orderCrossCity.getThankYouFee() : 0);//感谢费 |
| | | map1.put("returnMoney", 0);//超时退款金额 |
| | | } |
| | | break; |
| | | case 4: |
| | |
| | | map1.put("tipMoney", null != orderLogistics.getTipMoney() ? orderLogistics.getTipMoney() : 0);//小费 |
| | | map1.put("roadTollMoney", 0);//过路费 |
| | | map1.put("rakeMoney", incomes3.size() > 0 ? incomes3.get(0).getMoney() : 0);//抽成 |
| | | map1.put("thankYouFee", null != orderLogistics.getThankYouFee() ? orderLogistics.getThankYouFee() : 0);//感谢费 |
| | | |
| | | |
| | | /// 小件物流超时退款 |
| | | List<Income> list1 = incomeService.selectList(new EntityWrapper<Income>().eq("userType",2) |
| | | .eq("orderType",4).eq("type",9) |
| | | .eq("objectId",orderLogistics.getDriverId()).eq("incomeId",orderLogistics.getId())); |
| | | |
| | | double returnMoney = 0; |
| | | if (ToolUtil.isNotEmpty(list1)){ |
| | | for (Income income : list1) { |
| | | returnMoney += income.getMoney(); |
| | | } |
| | | } |
| | | map1.put("returnMoney", BigDecimal.valueOf(returnMoney).setScale(2,BigDecimal.ROUND_HALF_UP)); |
| | | } |
| | | break; |
| | | case 5: |
| | |
| | | map1.put("tipMoney", orderLogistics1.getTipMoney());//小费 |
| | | map1.put("roadTollMoney", 0);//过路费 |
| | | map1.put("rakeMoney", incomes4.size() > 0 ? incomes4.get(0).getMoney() : 0);//抽成 |
| | | map1.put("thankYouFee", null != orderLogistics1.getThankYouFee() ? orderLogistics1.getThankYouFee() : 0);//感谢费 |
| | | |
| | | /// 小件物流超时退款 |
| | | List<Income> list1 = incomeService.selectList(new EntityWrapper<Income>().eq("userType",2) |
| | | .eq("orderType",5).eq("type",9) |
| | | .eq("objectId",orderLogistics1.getDriverId()).eq("incomeId",orderLogistics1.getId())); |
| | | |
| | | double returnMoney = 0; |
| | | if (ToolUtil.isNotEmpty(list1)){ |
| | | for (Income income : list1) { |
| | | returnMoney += income.getMoney(); |
| | | } |
| | | } |
| | | map1.put("returnMoney", BigDecimal.valueOf(returnMoney).setScale(2,BigDecimal.ROUND_HALF_UP)); |
| | | } |
| | | break; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | @Autowired |
| | | private ITimeOutAppealService appealService; |
| | | |
| | | |
| | | /** |
| | | * 历史申诉 |
| | | * @param request |
| | | * @return |
| | | * 获取图形验证码 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/appealHistory") |
| | | @ApiOperation(value = "历史申诉", tags = {"司机端-个人中心"}, notes = "") |
| | | @GetMapping("/base/getVerifyCodeUtils") |
| | | @ApiOperation(value = "获取图形验证码", tags = {"用户端-登录"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil<Map<String, Object>> getVerifyCodeUtils(){ |
| | | try { |
| | | String s = VerifyCodeUtils.generateVerifyCode(4); |
| | | File file = new File("/usr/local/server/VerifyCode" + s + ".jpg"); |
| | | if(!file.exists()){ |
| | | file.createNewFile(); |
| | | FileOutputStream out = new FileOutputStream(file); |
| | | VerifyCodeUtils.outputImage(100, 40, out, s); |
| | | file = new File("/usr/local/server/VerifyCode" + s + ".jpg"); |
| | | FileInputStream inputStream = new FileInputStream(file); |
| | | byte[] data = new byte[inputStream.available()]; |
| | | inputStream.read(data); |
| | | inputStream.close(); |
| | | String string = Base64.getEncoder().encodeToString(data); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("code", MD5AndKL.MD5(s.toLowerCase())); |
| | | map.put("img", string); |
| | | file.delete(); |
| | | return ResultUtil.success(map); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/getMoneyReceivingQRCode") |
| | | @ApiOperation(value = "获取支付二维码", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<AppealWrapper>> appealHistory(Integer pageNum, Integer size, HttpServletRequest request){ |
| | | public ResultUtil getMoneyReceivingQRCode(HttpServletRequest request){ |
| | | try { |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if(null == driverId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | List<Map<String,Object>> list = appealService.selectMaps(new EntityWrapper<TimeOutAppeal>().eq("driverId",driverId).orderBy("id",false).last("limit " + (pageNum-1)*size+ "," + pageNum*size)); |
| | | for (Map<String, Object> map : list) { |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(map.get("orderId").toString()); |
| | | map.put("timeOutMoney",orderLogistics.getTimeOutMoney()); |
| | | map.put("travelTime",DateUtil.getTimes(orderLogistics.getTravelTime())); |
| | | map.put("endServiceTime",DateUtil.getTimes(orderLogistics.getEndServiceTime())); |
| | | map.put("timeOut", DateUtil.CalTime(DateUtil.getTime(orderLogistics.getEndServiceTime()),DateUtil.getTime(orderLogistics.getArriveTimeExpect()))); |
| | | return driverService.getMoneyReceivingQRCode(driverId); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | map.put("createTime",DateUtil.getTimeMunite((Date) map.get("createTime"))); |
| | | if (ToolUtil.isNotEmpty(map.get("dealTime"))){ |
| | | map.put("dealTime",DateUtil.getTimeMunite((Date) map.get("dealTime"))); |
| | | }else { |
| | | map.put("dealTime",""); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/driver/queryOfflineTravelPaymentList") |
| | | @ApiOperation(value = "获取收款支付记录", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "开始时间", name = "start", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "结束时间", name = "end", required = false, dataType = "String"), |
| | | @ApiImplicitParam(value = "页码首页1", name = "pageNum", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<OfflineTravelPaymentWarpper> queryOfflineTravelPaymentList(String start, String end, Integer pageNum, Integer size, HttpServletRequest request){ |
| | | try { |
| | | Integer driverId = driverService.getUserIdFormRedis(request); |
| | | if(null == driverId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(AppealWrapper.getAppealListWrapper(list)); |
| | | OfflineTravelPaymentWarpper offlineTravelPaymentWarpper = new OfflineTravelPaymentWarpper(); |
| | | List<BaseWarpper> list = offlineTravelPaymentService.queryOfflineTravelPaymentList(driverId, start, end, pageNum, size); |
| | | offlineTravelPaymentWarpper.setList(list); |
| | | Double totalMoney = offlineTravelPaymentService.getTotalMoney(driverId, start, end); |
| | | offlineTravelPaymentWarpper.setTotal(totalMoney); |
| | | return ResultUtil.success(offlineTravelPaymentWarpper); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiOperation(value = "司机端主动调用该接口上传位置信息", tags = {"司机端-仿socket接口"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7景区直通车,8=公务出行)", name = "orderType", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "经度", name = "lon", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "纬度", name = "lat", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "方向角", name = "directionAngle", required = true, dataType = "string"), |
| | |
| | | package com.stylefeng.guns.modular.api; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityInfoWrapper; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderWarpper; |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.Reassign; |
| | | import com.stylefeng.guns.modular.system.model.SysTimeoutMoney; |
| | | import com.stylefeng.guns.modular.system.model.TimeOutAppeal; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.ChinaMobileUtil; |
| | | import com.stylefeng.guns.modular.system.util.PushUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.SystemException; |
| | | import com.stylefeng.guns.modular.system.warpper.*; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IOrderService; |
| | | import com.stylefeng.guns.modular.system.service.IReassignService; |
| | | import com.stylefeng.guns.modular.system.service.ITransactionDetailsService; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.MoneyInfoWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.OrderInfoWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.OrderListWarpper; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @Autowired |
| | | private IOrderLogisticsService orderLogisticsService; |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | @Autowired |
| | | private IOrderCrossCityService orderCrossCityService; |
| | | |
| | | @Autowired |
| | | private ITransactionDetailsService transactionDetailsService; |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | @PostMapping("/api/order/queryOrderList") |
| | | @ApiOperation(value = "获取首页订单列表", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "数据类型(1=服务中,2=待服务,3=助老模式接单)", name = "state", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "数据类型(1=服务中,2=待服务)", name = "state", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "页码,首页1", name = "pageNum", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "页条数", name = "size", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | |
| | | @ApiOperation(value = "获取抢单界面的订单详情", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "当前定位经度", name = "lon", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "当前定位纬度", name = "lat", required = true, dataType = "string"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | |
| | | @ApiOperation(value = "司机抢单操作", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil grabOrder(Integer orderId, Integer orderType, HttpServletRequest request){ |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private ISysTimeoutMoneyService sysTimeoutMoneyService; |
| | | |
| | | /** |
| | | * 获取服务中页面订单详情 |
| | | * @param orderId |
| | |
| | | @ApiOperation(value = "获取服务中页面订单详情", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<OrderInfoWarpper> queryOrderInfo(Integer orderId, Integer orderType){ |
| | | try { |
| | | Map<String, Object> map = orderService.queryOrderInfo(orderId, orderType); |
| | | |
| | | if (orderType == 4 || orderType == 5){ |
| | | |
| | | SysTimeoutMoney sysTimeoutMoney = sysTimeoutMoneyService.selectOne(null); |
| | | map.put("timeOutMoney",Double.parseDouble(map.get("timeOutMoney").toString())); |
| | | map.put("note","配送超过" + sysTimeoutMoney.getTimeOut() + "分钟扣订单的" + sysTimeoutMoney.getDeductMoney() + "%费用"); |
| | | |
| | | TimeOutAppeal timeOutAppeal = timeAppealService.selectOne(new EntityWrapper<TimeOutAppeal>().eq("orderId",orderId)); |
| | | if (ToolUtil.isNotEmpty(timeOutAppeal)){ |
| | | if (timeOutAppeal.getState() == 1){ |
| | | map.put("appealState",1); |
| | | map.put("returnMoney",0); |
| | | }else if (timeOutAppeal.getState() == 2){ |
| | | map.put("appealState",2); |
| | | map.put("returnMoney",timeOutAppeal.getReturnMoney()==null?0:timeOutAppeal.getReturnMoney()); |
| | | }else { |
| | | map.put("appealState",2); |
| | | map.put("returnMoney",0); |
| | | } |
| | | } |
| | | } |
| | | return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map)); |
| | | //return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/queryOrderInfo1") |
| | | @ApiOperation(value = "获取服务中页面订单详情", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<OrderWarpper> queryOrderInfo1(Integer orderId, Integer orderType){ |
| | | try { |
| | | Map<String, Object> map = orderService.queryOrderInfo(orderId, 7); |
| | | |
| | | if (orderType == 4 || orderType == 5){ |
| | | |
| | | SysTimeoutMoney sysTimeoutMoney = sysTimeoutMoneyService.selectOne(null); |
| | | map.put("timeOutMoney",Double.parseDouble(map.get("timeOutMoney").toString())); |
| | | map.put("note","配送超过" + sysTimeoutMoney.getTimeOut() + "分钟扣订单的" + sysTimeoutMoney.getDeductMoney() + "%费用"); |
| | | |
| | | TimeOutAppeal timeOutAppeal = timeAppealService.selectOne(new EntityWrapper<TimeOutAppeal>().eq("orderId",orderId)); |
| | | if (ToolUtil.isNotEmpty(timeOutAppeal)){ |
| | | if (timeOutAppeal.getState() == 1){ |
| | | map.put("appealState",1); |
| | | map.put("returnMoney",0); |
| | | }else if (timeOutAppeal.getState() == 2){ |
| | | map.put("appealState",2); |
| | | map.put("returnMoney",timeOutAppeal.getReturnMoney()==null?0:timeOutAppeal.getReturnMoney()); |
| | | }else { |
| | | map.put("appealState",2); |
| | | map.put("returnMoney",0); |
| | | } |
| | | } |
| | | } |
| | | OrderWarpper orderWarpper = OrderWarpper.getOrderWarpper(map); |
| | | List<OrderCrossCityInfoWrapper> orders = orderWarpper.getOrders(); |
| | | Integer peopleNumber=0; |
| | | Double totalMoney=0d; |
| | | Double serverMoney=0d; |
| | | for(OrderCrossCityInfoWrapper orderCrossCityInfoWrapper:orders){ |
| | | |
| | | Map<String, Object> map1 = orderService.queryMoneyInfo(orderCrossCityInfoWrapper.getOrderId(), 1); |
| | | MoneyInfo1Warpper moneyInfo1Warpper = MoneyInfo1Warpper.getMoneyInfoWarpper(map1); |
| | | orderCrossCityInfoWrapper.setMoneyInfo1Warpper(moneyInfo1Warpper); |
| | | peopleNumber=peopleNumber+orderCrossCityInfoWrapper.getPeopleNumber(); |
| | | totalMoney=totalMoney+moneyInfo1Warpper.getOrderMoney(); |
| | | } |
| | | orderWarpper.setPeopleNumber(peopleNumber); |
| | | orderWarpper.setTotalMoney(totalMoney); |
| | | orderWarpper.setOrders(orders); |
| | | return ResultUtil.success(orderWarpper); |
| | | //return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | @ApiOperation(value = "获取改派支付金额", tags = {"司机端-服务中"}, notes = "返回金额为0不需要调用支付") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id(跨城多个订单使用逗号分隔)", name = "orderId", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<BaseWarpper> queryReassignMoney(String orderId, Integer orderType){ |
| | |
| | | @ApiOperation(value = "提交改派申请", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "改派支付方式(1=微信,2=支付宝,3=余额)", name = "payType", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "改派原因", name = "reason", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "备注", name = "remark", required = false, dataType = "string"), |
| | |
| | | @ApiOperation(value = "司机走流程操作", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "流程操作状态(3=开始出发预约点,4=到达预约点,5=开始服务,6=服务结束)", name = "state", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "当前经度", name = "lon", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "当前纬度", name = "lat", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "小件物流司机上传的图片,多个分号分隔", name = "driverImg", required = true, dataType = "string"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil process(Integer orderId, Integer orderType, Integer state, Double lon, Double lat, String driverImg, HttpServletRequest request){ |
| | | public ResultUtil process(Integer orderId, Integer orderType, Integer state, Double lon, Double lat, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return orderService.process(orderId, orderType, state, uid, lon, lat, driverImg); |
| | | return orderService.process(orderId, orderType, state, uid, lon, lat); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/cancleOrder") |
| | | @ApiOperation(value = "取消订单", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil cancleOrder(Integer orderId, Integer orderType){ |
| | | try{ |
| | | return orderService.cancleOrder(orderId, orderType); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/api/order/updatePeopleNum") |
| | | @ApiOperation(value = "修改人数", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "人数", name = "peopleNum", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil updatePeopleNum(Integer orderId, Integer peopleNum){ |
| | | try{ |
| | | |
| | | return orderService.updatePeopleNum(orderId, peopleNum); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/confirmFees1") |
| | | @ApiOperation(value = "1.0-司机确认费用", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "支付方式(1=OK平台收款,2=其他方式收款)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "行程费用(出租车必传)", name = "travelFee", required = false, dataType = "double"), |
| | | @ApiImplicitParam(value = "附加费JSON数组[{\"id\":1,\"amount\":20.5}]", name = "additionalFee", required = false, dataType = "double"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil confirmFees1(Integer orderId, Integer orderType, Integer type, Double travelFee, String additionalFee){ |
| | | try{ |
| | | return orderService.confirmFees1(orderId, orderType, type, travelFee, additionalFee); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | public ResultUtil<OrderInfoWarpper> queryToBePaidPage(Integer orderId, Integer orderType){ |
| | | try { |
| | | Map<String, Object> map = orderService.queryToBePaidPage(orderId, orderType); |
| | | if(null != map.get("telX")){ |
| | | map.put("phone", map.get("telX")); |
| | | } |
| | | return ResultUtil.success(OrderInfoWarpper.getOrderInfoWarpper(map)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 管理后台处理改派后的回退金额 |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/order/reassignRollbackAmount") |
| | | public String reassignRollbackAmount(Integer reassignId){ |
| | | try { |
| | | Reassign reassign = reassignService.selectById(reassignId); |
| | | Driver driver = driverService.selectById(reassign.getOriginalDriverId()); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String out_trade_no = sdf.format(new Date()) + reassign.getOrderType() + reassign.getId(); |
| | | if(reassign.getPayType() == 1){//微信 |
| | | reassign.setRefundState(1); |
| | | reassignService.updateById(reassign); |
| | | Map<String, String> map = payMoneyUtil.wxRefund(reassign.getPayOrder(), out_trade_no, reassign.getMoney().toString(), reassign.getMoney().toString(), callbackPath + "/base/wxReassignRollback"); |
| | | String return_code = map.get("return_code"); |
| | | if(!"SUCCESS".equals(return_code)){ |
| | | return JSON.toJSONString(ResultUtil.error(map.get("return_msg"))); |
| | | } |
| | | } |
| | | if(reassign.getPayType() == 2){//支付宝 |
| | | reassign.setRefundState(1); |
| | | reassignService.updateById(reassign); |
| | | Map<String, String> map = payMoneyUtil.aliRefund(reassign.getPayOrder(), reassign.getMoney().toString()); |
| | | String code = map.get("code"); |
| | | if("10000".equals(code)){ |
| | | String trade_no = map.get("trade_no"); |
| | | reassign.setRefundCode(trade_no); |
| | | reassign.setRefundState(2); |
| | | reassignService.updateById(reassign); |
| | | }else{ |
| | | return JSON.toJSONString(ResultUtil.error(map.get("msg"))); |
| | | } |
| | | |
| | | } |
| | | if(reassign.getPayType() == 3){//余额 |
| | | reassign.setRefundState(2); |
| | | reassignService.updateById(reassign); |
| | | driver.setLaveBusinessMoney(driver.getLaveBusinessMoney() + reassign.getMoney()); |
| | | driver.setBalance(driver.getBalance() + reassign.getMoney()); |
| | | driverService.updateById(driver); |
| | | } |
| | | transactionDetailsService.saveData(driver.getId(), "司机改派回退", reassign.getMoney(), 1, 1, 2, reassign.getOrderType(), reassign.getOrderId()); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return JSON.toJSONString(ResultUtil.runErr()); |
| | | } |
| | | return JSON.toJSONString(ResultUtil.success()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public void wxReassignRollback(HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | Map<String, String> map = payMoneyUtil.wxRefundCallback(request); |
| | | if(null != map){ |
| | | String refund_id = map.get("refund_id"); |
| | | String out_refund_no = map.get("out_refund_no"); |
| | | String result = map.get("result"); |
| | | String substring = out_refund_no.substring(17); |
| | | Integer type = Integer.valueOf(substring.substring(0, 1)); |
| | | Integer id = Integer.valueOf(substring.substring(1)); |
| | | Reassign reassign = reassignService.selectById(id); |
| | | if(reassign.getRefundState() == 2){ |
| | | return; |
| | | } |
| | | |
| | | reassign.setRefundState(2); |
| | | reassign.setRefundCode(refund_id); |
| | | reassignService.updateById(reassign); |
| | | transactionDetailsService.saveData(reassign.getOriginalDriverId(), "司机改派回退", reassign.getMoney(), 1, 1, 2, reassign.getOrderType(), reassign.getOrderId()); |
| | | switch (type){ |
| | | case 1: |
| | | break; |
| | | } |
| | | |
| | | PrintWriter out = response.getWriter(); |
| | | out.print(result); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | @ApiOperation(value = "提交改派申请", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8公务出行)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "改派支付方式(1=微信,2=支付宝,3=余额)", name = "payType", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "改派原因", name = "reason", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "备注", name = "remark", required = false, dataType = "string"), |
| | |
| | | @PostMapping("/base/order/test") |
| | | public String test(String phoneA, String phoneB){ |
| | | try { |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(phoneA, phoneB, (System.currentTimeMillis() + 86400000)); |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(phoneA, phoneB, 28); |
| | | System.err.println(JSON.toJSONString(map)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @PostMapping("/base/order/test_") |
| | | public String test(String bindId){ |
| | | try { |
| | | Map<String, String> map = chinaMobileUtil.midAxbUnBindSend(bindId, null, null); |
| | | Map<String, String> map = chinaMobileUtil.midAxbUnBindSend(bindId); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ""; |
| | |
| | | @ApiOperation(value = "接单后获取语音播报内容", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "当前位置经度", name = "lon", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "当前位置纬度", name = "lat", required = true, dataType = "string"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/queryMoneyInfo1") |
| | | @ApiOperation(value = "1.0-获取订单费用明细", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单类型(1=专车)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<MoneyInfo1Warpper> queryMoneyInfo1(Integer orderId, Integer orderType){ |
| | | try { |
| | | Map<String, Object> map = orderService.queryMoneyInfo(orderId, orderType); |
| | | return ResultUtil.success(MoneyInfo1Warpper.getMoneyInfoWarpper(map)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/fillInPickUpCode") |
| | | @ApiOperation(value = "验证小件物流取件码", tags = {"司机端-服务中"}, notes = "") |
| | |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/turnAppeal") |
| | | @ApiOperation(value = "跳转到申诉", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<AppealWrapper> turnAppeal(Integer orderId){ |
| | | try { |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId); |
| | | Map<String,Object> map = new HashMap<>(); |
| | | map.put("arriveTimeExpect",DateUtil.getTime(orderLogistics.getArriveTimeExpect())); |
| | | // map.put("deductMoney",orderLogistics.getTimeOutMoney()); |
| | | // map.put("endServiceTime",orderLogistics.getEndServiceTime()); |
| | | map.put("travelTime",DateUtil.getTime(orderLogistics.getTravelTime())); |
| | | map.put("endServiceTime",DateUtil.getTime(orderLogistics.getEndServiceTime())); |
| | | if (ToolUtil.isNotEmpty(orderLogistics.getArriveTimeExpect()) && ToolUtil.isNotEmpty(orderLogistics.getEndServiceTime())){ |
| | | map.put("timeOut", DateUtil.CalTime(DateUtil.getTime(orderLogistics.getEndServiceTime()),DateUtil.getTime(orderLogistics.getArriveTimeExpect()))); |
| | | }else { |
| | | map.put("timeOut",0); |
| | | } |
| | | return ResultUtil.success(AppealWrapper.getAppealWrapper(map)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | @Autowired |
| | | private ITimeOutAppealService timeAppealService; |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/submitAppeal") |
| | | @ApiOperation(value = "提交申诉", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "申诉内容", name = "content", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "申诉图片(多张用分号;隔开)", name = "imgList", required = true, dataType = "string"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil submitAppeal(HttpServletRequest request, Integer orderId, String content, String imgList){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | TimeOutAppeal timeAppeal = new TimeOutAppeal(); |
| | | timeAppeal.setOrderId(orderId); |
| | | timeAppeal.setDriverId(uid); |
| | | timeAppeal.setCreateTime(new Date()); |
| | | timeAppeal.setContent(content); |
| | | timeAppeal.setImgList(imgList); |
| | | timeAppealService.insert(timeAppeal); |
| | | |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/makeUpTheDifference") |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 管理后台发送收货码 |
| | | * @param orderId |
| | | * @return |
| | | * 完成订单微信支付回调 |
| | | * @param request |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/order/sendVerificationCode1") |
| | | public ResultUtil sendVerificationCode1(Integer orderId){ |
| | | @PostMapping("/base/wxPayCrossCity") |
| | | public void wxPayCrossCity(HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | orderLogisticsService.sendVerificationCode(orderId); |
| | | return ResultUtil.success(); |
| | | Map<String, String> map = payMoneyUtil.weixinpayCallback(request); |
| | | if(null != map){ |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String transaction_id = map.get("transaction_id"); |
| | | |
| | | String substring = out_trade_no.substring(17); |
| | | Integer type = Integer.valueOf(substring.substring(0, 1)); |
| | | Integer id = Integer.valueOf(substring.substring(1)); |
| | | switch (type){ |
| | | case 3: |
| | | orderCrossCityService.payOrderCrossCityCallback(id, transaction_id, 1); |
| | | break; |
| | | } |
| | | |
| | | String result = map.get("result"); |
| | | PrintWriter out = response.getWriter(); |
| | | out.print(result); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 完成订单支付宝支付回调 |
| | | * @param request |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/order/queryAdditionalFee") |
| | | @ApiOperation(value = "1.0-获取确认费用页面的附加费", tags = {"司机端-服务中"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)", name = "orderType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil queryAdditionalFee(Integer orderType, Integer orderId, HttpServletRequest request){ |
| | | @PostMapping("/base/aliPayCrossCity") |
| | | public void aliPayCrossCity(HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | Map<String, String> map = payMoneyUtil.alipayCallback(request); |
| | | if(null != map){ |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String trade_no = map.get("trade_no"); |
| | | |
| | | String substring = out_trade_no.substring(17); |
| | | Integer type = Integer.valueOf(substring.substring(0, 1)); |
| | | Integer id = Integer.valueOf(substring.substring(1)); |
| | | switch (type){ |
| | | case 1: |
| | | case 3: |
| | | orderCrossCityService.payOrderCrossCityCallback(id, trade_no, 2); |
| | | break; |
| | | } |
| | | PrintWriter out = response.getWriter(); |
| | | out.print("success"); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | List<BaseWarpper> list = orderService.queryAdditionalFee(orderType, orderId, uid); |
| | | return ResultUtil.success(list); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.success(); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | import com.stylefeng.guns.modular.system.model.Withdrawal; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.ISysWithdrawalPoundageService; |
| | | import com.stylefeng.guns.modular.system.service.IWithdrawalService; |
| | | import com.stylefeng.guns.modular.system.util.ICBCPayUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | |
| | | @Autowired |
| | | private IDriverService driverService; |
| | | |
| | | @Autowired |
| | | private ISysWithdrawalPoundageService sysWithdrawalPoundageService; |
| | | |
| | | |
| | | /** |
| | | * 账户余额提现操作 |
| | |
| | | @ApiOperation(value = "账户余额提现", tags = {"司机端-个人中心"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "提现金额", name = "money", required = true, dataType = "double"), |
| | | @ApiImplicitParam(value = "银行名称", name = "bankName", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "银行卡号", name = "code", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "银行卡id", name = "bankCardId", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "银行卡持有人姓名", name = "name", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "提现类型(1=活动收入提现,2=业务收入提现)", name = "type", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil withdrawal(Double money, String bankName, String code, String name, Integer type, HttpServletRequest request){ |
| | | public ResultUtil withdrawal(Double money, Integer bankCardId, String name, Integer type, HttpServletRequest request){ |
| | | try { |
| | | Integer uid = driverService.getUserIdFormRedis(request); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return withdrawalService.withdrawal(money, bankName, code, name, uid, type); |
| | | return withdrawalService.withdrawal(money, bankCardId, name, uid, type); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | public ResultUtil withdrawalAudit(Integer id, Integer state){ |
| | | try { |
| | | return withdrawalService.withdrawalAudit(id, state); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 提现手续说明 |
| | | * @return |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/withdrawal/withdrawalPoundage") |
| | | @ApiOperation(value = "提现手续说明", tags = {"司机端-个人中心"}, notes = "") |
| | | public ResultUtil withdrawalPoundage(){ |
| | | try { |
| | | return ResultUtil.success(sysWithdrawalPoundageService.selectOne(null).getPercentage() + "%"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | package com.stylefeng.guns.modular.crossCity.controller; |
| | | |
| | | |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityInfoWrapper; |
| | | import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityWarpper; |
| | |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IReassignService; |
| | | import com.stylefeng.guns.modular.system.util.ICBCPayUtil; |
| | | import com.stylefeng.guns.modular.system.util.PayMoneyUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.SystemException; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.util.Map; |
| | | |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private ICBCPayUtil icbcPayUtil; |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | |
| | | |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 扫码支付成功回调处理 |
| | | * @param request |
| | | * @param response |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/order/generatePay") |
| | | public void generatePay(HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | // Map<String, String> map = icbcPayUtil.generatePayCallback(request); |
| | | // if(null != map){ |
| | | // String out_trade_no = map.get("out_trade_no"); |
| | | // String order_id = map.get("order_id"); |
| | | // String s = icbcPayUtil.queryGeneratePayState("", order_id); |
| | | // if(s.equals("1")){ |
| | | // icbcPayUtil.answer(response);//回调应答 |
| | | // } |
| | | // if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id) && s.equals("1")){ |
| | | // String[] split = out_trade_no.split(","); |
| | | // Integer id = Integer.valueOf(split[0]); |
| | | // Integer type = Integer.valueOf(split[1]); |
| | | // switch (type){ |
| | | // case 1: |
| | | // break; |
| | | // case 2: |
| | | // break; |
| | | // case 3: |
| | | // orderCrossCityService.generatePayCallback(id, order_id); |
| | | // break; |
| | | // } |
| | | // } |
| | | // } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 完成订单微信支付回调 |
| | | * @param request |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/wxPayCrossCity") |
| | | public void wxPayCrossCity(HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | Map<String, String> map = payMoneyUtil.weixinpayCallback(request); |
| | | if(null != map){ |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String order_id = map.get("order_id"); |
| | | String result = map.get("result"); |
| | | if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id)){ |
| | | PrintWriter out = response.getWriter(); |
| | | out.write(result); |
| | | out.flush(); |
| | | out.close(); |
| | | |
| | | String[] split = out_trade_no.split("_"); |
| | | Integer id = Integer.valueOf(split[0]); |
| | | Integer type = Integer.valueOf(split[1]); |
| | | switch (type){ |
| | | case 3: |
| | | orderCrossCityService.payOrderCrossCityCallback(id, order_id, 1); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/aliPayCrossCity") |
| | | public void aliPayCrossCity(HttpServletRequest request, HttpServletResponse response){ |
| | | try { |
| | | Map<String, String> map = payMoneyUtil.alipayCallback(request); |
| | | if(null != map){ |
| | | String out_trade_no = map.get("out_trade_no"); |
| | | String order_id = map.get("trade_no"); |
| | | if(ToolUtil.isNotEmpty(out_trade_no) && ToolUtil.isNotEmpty(order_id)){ |
| | | String[] split = out_trade_no.split("_"); |
| | | Integer id = Integer.valueOf(split[0]); |
| | | Integer type = Integer.valueOf(split[1]); |
| | | switch (type){ |
| | | case 3: |
| | | orderCrossCityService.payOrderCrossCityCallback(id, order_id, 2); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | List<OrderCrossCity> queryMaturity(); |
| | | |
| | | |
| | | List<OrderCrossCity> taskMidAxbUnBindSend(); |
| | | } |
| | |
| | | select |
| | | b.id as id, |
| | | a.id as lineShiftDriverId, |
| | | CONCAT(b.startTime, '-', b.endTime) as startTime, |
| | | b.startTime as startTime, |
| | | c.headImgUrl as headImgUrl, |
| | | CONCAT(left(c.`name`, 1), '师傅') as `name`, |
| | | d.carLicensePlate as carLicensePlate, |
| | |
| | | <result column="activityId" property="activityId"/> |
| | | <result column="companyId" property="companyId"/> |
| | | <result column="payMoney" property="payMoney"/> |
| | | <result column="thankYouFee" property="thankYouFee"/> |
| | | <result column="passengers" property="passengers"/> |
| | | <result column="passengersPhone" property="passengersPhone"/> |
| | | <result column="sort" property="sort"/> |
| | |
| | | a.bindId as bindId, |
| | | a.peopleNumber as peopleNumber, |
| | | a.payMoney as payMoney, |
| | | a.thankYouFee, |
| | | a.payManner as payManner, |
| | | a.seatNumber as seatNumber, |
| | | (select phone from t_phone where companyId = a.companyId and `type` = 1) as emergencyCall |
| | |
| | | telX as telX, |
| | | bindId as bindId |
| | | from t_order_cross_city where state = 2 and (UNIX_TIMESTAMP(travelTime) - UNIX_TIMESTAMP(now())) between 1710 and 1800 |
| | | </select> |
| | | |
| | | |
| | | <select id="taskMidAxbUnBindSend" resultType="OrderCrossCity"> |
| | | select * from t_order_cross_city where (state in (8, 9) and telX != '' and telX is not null and (UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP(endServiceTime)) > 1800) or (state = 10 and telX != '' and telX is not null) |
| | | </select> |
| | | </mapper> |
| | |
| | | */ |
| | | @TableField("payMoney") |
| | | private Double payMoney; |
| | | //感谢费 |
| | | @TableField("thankYouFee") |
| | | private Double thankYouFee; |
| | | /** |
| | | * 乘车人姓名 |
| | | */ |
| | |
| | | |
| | | public void setPayMoney(Double payMoney) { |
| | | this.payMoney = payMoney; |
| | | } |
| | | |
| | | public Double getThankYouFee() { |
| | | return thankYouFee; |
| | | } |
| | | |
| | | public void setThankYouFee(Double thankYouFee) { |
| | | this.thankYouFee = thankYouFee; |
| | | } |
| | | |
| | | public String getPassengers() { |
| | |
| | | * @throws Exception |
| | | */ |
| | | List<OrderCrossCity> queryMaturity() throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 获取需要解绑小号的订单数据 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<OrderCrossCity> taskMidAxbUnBindSend() throws Exception; |
| | | } |
| | |
| | | return ResultUtil.error("该班次已经超出了可预约车次"); |
| | | } |
| | | CarService query = carServiceMapper.query(3, driverService.selectById(driverId).getCarId()); |
| | | if(null == query){ |
| | | return ResultUtil.error("车辆未开通该服务"); |
| | | } |
| | | Map<String, Object> query1 = linePriceMapper.query(lineShift.getLineId(), query.getServerCarModelId()); |
| | | if(null == query1){ |
| | | return ResultUtil.error("该线路还未设置服务车型相关数据,请联系管理员!"); |
| | |
| | | } |
| | | if(b){ |
| | | data.put("id", lineShift.getId()); |
| | | data.put("startTime", lineShift.getStartTime() + "-" + lineShift.getEndTime()); |
| | | data.put("startTime", lineShift.getStartTime()); |
| | | list.add(data); |
| | | } |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.crossCity.server.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.icbc.api.crypt.AES; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.crossCity.dao.LinePriceMapper; |
| | | import com.stylefeng.guns.modular.crossCity.dao.LineShiftDriverMapper; |
| | |
| | | import com.stylefeng.guns.modular.specialTrain.dao.OrderPrivateCarMapper; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.dao.PhoneMapper; |
| | | import com.stylefeng.guns.modular.system.dao.RegionMapper; |
| | | import com.stylefeng.guns.modular.system.dao.SysIntegralMapper; |
| | | import com.stylefeng.guns.modular.system.dao.UserInfoMapper; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.util.LiuZhouBank.PayUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.MerchantCouponListWarpper; |
| | | import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.math.MathContext; |
| | | import java.math.RoundingMode; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | @Service |
| | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | @Autowired |
| | | private IOrderAdditionalFeeService orderAdditionalFeeService; |
| | | @Resource |
| | | private UserCouponRecordMapper userCouponRecordMapper; |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | @Autowired |
| | | private IMerchantActivityService merchantActivityService; |
| | | |
| | | @Autowired |
| | | private IMerchantActivitySlaveService merchantActivitySlaveService; |
| | | |
| | | @Autowired |
| | | private IUserMerchantCouponService userMerchantCouponService; |
| | | |
| | | @Autowired |
| | | private IMerchantCouponService merchantCouponService; |
| | | @Resource |
| | | private UserRedPacketRecordMapper userRedPacketRecordMapper; |
| | | |
| | | @Value("${filePath}") |
| | | private String filePath; |
| | |
| | | @Override |
| | | public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address) throws Exception { |
| | | OrderCrossCity orderCrossCity = this.selectById(orderId); |
| | | UserInfo userInfo = userInfoMapper.selectById(orderCrossCity.getUserId()); |
| | | switch (state){ |
| | | case 3://出发前往预约点 |
| | | orderCrossCity.setState(3); |
| | | orderCrossCity.setSetOutTime(new Date()); |
| | | systemNoticeService.addSystemNotice(1, "司机已出发,请耐心等待", orderCrossCity.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "司机已出发,请耐心等待", orderCrossCity.getUserId()); |
| | | break; |
| | | case 4://到达预约点,等待客户上车 |
| | | orderCrossCity.setState(4); |
| | | orderCrossCity.setArriveTime(new Date()); |
| | | systemNoticeService.addSystemNotice(1, "司机已到达您设置的预约地点,请及时上车", orderCrossCity.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "司机已到达您设置的预约地点,请及时上车", orderCrossCity.getUserId()); |
| | | break; |
| | | case 5://开始服务 |
| | | orderCrossCity.setBoardingLon(lon); |
| | |
| | | driverService.updateById(driver); |
| | | } |
| | | |
| | | //存储商家优惠券到redis {"phone":[{...}]} |
| | | //订单数要加1,因为这里是后修改订单状态 |
| | | List<OrderCrossCity> list = orderCrossCityMapper.queryByState(userInfo.getId(), 8, 9); |
| | | List<MerchantActivity> merchantActivities = merchantActivityService.selectList(new EntityWrapper<MerchantActivity>().eq("companyId", orderCrossCity.getCompanyId()).eq("activityType", 1).eq("auditStatus", 2).eq("status", 1) |
| | | .eq("state", 1).like("orderType", "3").where("((orderAmountFull is not null and orderAmountFull <= " + orderCrossCity.getOrderMoney() + ") or (orderNumber is not null and orderNumber <= " + (list.size() + 1) + "))") |
| | | .in("id", merchantActivitySlaveService.selectList(new EntityWrapper<MerchantActivitySlave>().gt("laveNumber", 0)).stream().map(MerchantActivitySlave::getMerchantActivityId).collect(Collectors.toList())) |
| | | .notIn("id", userMerchantCouponService.selectList(new EntityWrapper<UserMerchantCoupon>().eq("userType", 1).eq("userId", userInfo.getId()).eq("state", 1)).stream().map(UserMerchantCoupon::getMerchantActivityId).collect(Collectors.toList())) |
| | | ); |
| | | List<MerchantCouponListWarpper> listWarppers = new ArrayList<>(); |
| | | if(merchantActivities.size() > 0){ |
| | | for(MerchantActivity merchantActivity :merchantActivities){ |
| | | List<MerchantActivitySlave> merchantActivitySlaves = merchantActivitySlaveService.selectList(new EntityWrapper<MerchantActivitySlave>().eq("merchantActivityId", merchantActivity.getId()).gt("laveNumber", 0)); |
| | | |
| | | for(MerchantActivitySlave merchantActivitySlave : merchantActivitySlaves){ |
| | | UserMerchantCoupon userMerchantCoupon = new UserMerchantCoupon(); |
| | | try { |
| | | userMerchantCoupon.setCode(UUIDUtil.getRandomCode(16)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | userMerchantCoupon.setUserType(1); |
| | | userMerchantCoupon.setUserId(userInfo.getId()); |
| | | userMerchantCoupon.setMerchantActivityId(merchantActivity.getId()); |
| | | userMerchantCoupon.setMerchantCouponId(merchantActivitySlave.getMerchantCouponId()); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(new Date()); |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + merchantActivity.getEffectiveDays()); |
| | | userMerchantCoupon.setEndTime(calendar.getTime()); |
| | | userMerchantCoupon.setStatus(1); |
| | | userMerchantCoupon.setState(1); |
| | | userMerchantCoupon.setCreateTime(new Date()); |
| | | userMerchantCouponService.insert(userMerchantCoupon); |
| | | //添加已收入明细 |
| | | Line line = lineService.selectById(orderCrossCity.getLineId()); |
| | | Double speMoney = Double.valueOf(line.getRakeRate()); |
| | | BigDecimal d = new BigDecimal(orderCrossCity.getOrderMoney()).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);//企业收入 |
| | | BigDecimal c = new BigDecimal(orderCrossCity.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);//司机收入 |
| | | incomeService.saveData(1, orderCrossCity.getCompanyId(), 2, orderCrossCity.getId(), 3, d.doubleValue()); |
| | | incomeService.saveData(2, orderCrossCity.getDriverId(), 2, orderCrossCity.getId(), 3, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderCrossCity.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | |
| | | MerchantCoupon merchantCoupon = merchantCouponService.selectById(merchantActivitySlave.getMerchantCouponId()); |
| | | MerchantCouponListWarpper merchantCouponListWarpper = new MerchantCouponListWarpper(); |
| | | merchantCouponListWarpper.setId(merchantActivitySlave.getMerchantCouponId()); |
| | | merchantCouponListWarpper.setName(merchantCoupon.getName()); |
| | | merchantCouponListWarpper.setType(merchantCoupon.getType()); |
| | | merchantCouponListWarpper.setFullAmount(merchantCoupon.getFullAmount()); |
| | | merchantCouponListWarpper.setDiscount(merchantCoupon.getDiscount()); |
| | | listWarppers.add(merchantCouponListWarpper); |
| | | |
| | | merchantActivitySlave.setLaveNumber(merchantActivitySlave.getLaveNumber() - 1); |
| | | if(merchantActivitySlave.getLaveNumber() == 0){ |
| | | merchantActivity.setStatus(2); |
| | | } |
| | | } |
| | | if(merchantActivitySlaves.size() > 0){ |
| | | merchantActivitySlaveService.updateBatchById(merchantActivitySlaves); |
| | | } |
| | | } |
| | | merchantActivityService.updateBatchById(merchantActivities); |
| | | } |
| | | String value = redisUtil.getValue("merchantVoucher"); |
| | | JSONObject jsonObject = JSON.parseObject(value); |
| | | if(null == jsonObject){ |
| | | jsonObject = new JSONObject(); |
| | | } |
| | | jsonObject.put(userInfo.getPhone(), listWarppers); |
| | | redisUtil.setStrValue("merchantVoucher", jsonObject.toJSONString()); |
| | | |
| | | pushUtil.removeTask(orderId, 3);//删除定时任务,结束推送数据 |
| | | systemNoticeService.addSystemNotice(1, "司机已结束本次行程,谢谢使用", orderCrossCity.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "司机已结束本次行程,谢谢使用", orderCrossCity.getUserId()); |
| | | break; |
| | | } |
| | | this.updateById(orderCrossCity); |
| | |
| | | return ResultUtil.error("司机处于离线状态"); |
| | | } |
| | | OrderCrossCity orderCrossCity = new OrderCrossCity(); |
| | | UserInfo userInfo = userInfoMapper.queryByPhone(orderCrossCityWarpper.getPassengersPhone()); |
| | | UserInfo userInfo = userInfoMapper.queryByPhone(AESUtil.encrypt(orderCrossCityWarpper.getPassengersPhone())); |
| | | if(userInfo == null){//添加用户信息 |
| | | userInfo = new UserInfo(); |
| | | Integer integer = userInfoMapper.selectCount(null) + 1000001; |
| | | userInfo.setNickName(ToolUtil.isNotEmpty(orderCrossCityWarpper.getPassengers()) ? orderCrossCityWarpper.getPassengers() : "OK" + String.valueOf(integer).substring(1)); |
| | | userInfo.setName(orderCrossCityWarpper.getPassengers()); |
| | | userInfo.setPhone(orderCrossCityWarpper.getPassengersPhone()); |
| | | userInfo.setPhone(AESUtil.encrypt(orderCrossCityWarpper.getPassengersPhone())); |
| | | userInfo.setState(1); |
| | | userInfo.setFlag(1); |
| | | userInfo.setInsertTime(new Date()); |
| | |
| | | orderCrossCity.setUserId(userInfo.getId()); |
| | | |
| | | /** |
| | | * 1.出租车、专车、跨城有待支付的订单不能叫车 |
| | | * 2.小件物流有未完成的订单可以下跨城、专车、出租车 |
| | | * 3.出租车、专车、跨城有预约单可以下即时单 |
| | | * 1.下了即时单就不能下预约单和即时单 |
| | | * 2.下了预约单和再下一张即时单不能再下预约单 |
| | | */ |
| | | List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.queryByState(uid, 1, 1, 1, 2, 3, 4, 5, 6, 7, 11, 12); |
| | | List<OrderPrivateCar> orderPrivateCars = orderPrivateCarMapper.queryByState(orderCrossCity.getUserId(), 1, 1, 1, 2, 3, 4, 5, 6, 7, 11); |
| | | if(orderPrivateCars.size() > 0){ |
| | | return ResultUtil.error("有未完成的订单"); |
| | | } |
| | | List<OrderTaxi> list = orderTaxiMapper.queryByState_(uid, 1, 1, 1, 2, 3, 4, 5, 6, 7, 11, 12); |
| | | List<OrderTaxi> list = orderTaxiMapper.queryByState_(orderCrossCity.getUserId(), 1, 1, 1, 2, 3, 4, 5, 6, 11); |
| | | if(list.size() > 0){ |
| | | return ResultUtil.error("有未完成的订单"); |
| | | } |
| | | List<OrderCrossCity> orderCrossCities1 = orderCrossCityMapper.queryByState(uid, 1, 2, 3, 4, 5, 7, 11, 12); |
| | | List<OrderCrossCity> orderCrossCities1 = orderCrossCityMapper.queryByState(orderCrossCity.getUserId(), 1, 2, 3, 4, 5, 7, 11); |
| | | if(orderCrossCities1.size() > 0){ |
| | | return ResultUtil.error("有未完成的订单"); |
| | | } |
| | |
| | | orderCrossCity.setTrackId(track); |
| | | |
| | | //调用移动的小号接口 |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderCrossCity.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderCrossCity.getStartLon().toString(), orderCrossCity.getStartLat().toString()); |
| | | Region region = regionMapper.query(geocode.get("districtCode")); |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderCrossCity.getPassengersPhone(), AESUtil.decrypt(driver.getPhone()), Integer.valueOf(region.getCitycode().substring(1))); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderCrossCity.setTelX(map.get("telX")); |
| | | orderCrossCity.setBindId(map.get("bindId")); |
| | | } |
| | | if(orderCrossCityWarpper.getTravelMode() == 2){//包车 |
| | | // orderCrossCity.setSeatNumber(lineShiftDriver.getLaveSeatNumber()); |
| | | // orderCrossCity.setPeopleNumber(lineShiftDriver.getLaveSeat()); |
| | | orderCrossCity.setSeatNumber(lineShiftDriver.getLaveSeatNumber()); |
| | | orderCrossCity.setPeopleNumber(lineShiftDriver.getLaveSeat()); |
| | | } |
| | | this.insert(orderCrossCity); |
| | | |
| | | Double t = 0D; |
| | | if(ToolUtil.isNotEmpty(orderCrossCityWarpper.getAdditionalFee())){//附加费 |
| | | JSONArray jsonArray = JSON.parseArray(orderCrossCityWarpper.getAdditionalFee()); |
| | | for(int i = 0; i < jsonArray.size(); i++){ |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | Integer id = jsonObject.getInteger("id"); |
| | | Double amount = jsonObject.getDouble("amount"); |
| | | OrderAdditionalFee orderAdditionalFee = new OrderAdditionalFee(); |
| | | orderAdditionalFee.setOrderType(3); |
| | | orderAdditionalFee.setOrderId(orderCrossCity.getId()); |
| | | orderAdditionalFee.setAdditionalFeeId(id); |
| | | orderAdditionalFee.setAmount(amount); |
| | | orderAdditionalFeeService.insert(orderAdditionalFee); |
| | | t += amount; |
| | | } |
| | | } |
| | | orderCrossCity.setOrderMoney(orderCrossCity.getOrderMoney() + t); |
| | | this.updateById(orderCrossCity); |
| | | |
| | | if(driver.getState() == 2){ |
| | | driver.setState(3); |
| | |
| | | lineShiftDriverMapper.updateById(lineShiftDriver); |
| | | |
| | | //添加消息 |
| | | systemNoticeService.addSystemNotice(1, "您的跨城订单已下单成功!", orderCrossCity.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "您的跨城订单已下单成功!", orderCrossCity.getUserId()); |
| | | |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | baseWarpper.setId(orderCrossCity.getId()); |
| | | |
| | | //创建定时任务,取消订单30分钟 |
| | | TimerTask timerTask = new TimerTask() { |
| | | @Override |
| | |
| | | }; |
| | | Timer timer = new Timer(); |
| | | timer.schedule(timerTask, 30 * 60 * 1000); |
| | | |
| | | return ResultUtil.success(baseWarpper); |
| | | } |
| | | |
| | |
| | | } |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(1, "您已成功完成出行订单支付,谢谢使用!", orderCrossCity.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "您已成功完成出行订单支付,谢谢使用!", orderCrossCity.getUserId()); |
| | | } |
| | | |
| | | |
| | |
| | | return ResultUtil.error("订单已被支付,不允许重复支付"); |
| | | } |
| | | Integer uid = orderCrossCity.getUserId(); |
| | | UserInfo userInfo = userInfoMapper.selectById(uid); |
| | | Double orderMoney = orderCrossCity.getOrderMoney(); |
| | | ResultUtil resultUtil = ResultUtil.success(""); |
| | | ResultUtil resultUtil = ResultUtil.success(); |
| | | orderCrossCity.setCouponMoney(0D);//初始化历史数据 |
| | | orderCrossCity.setCouponId(null); |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String out_trade_no = sdf.format(new Date()) + 3 + orderCrossCity.getId(); |
| | | |
| | | if(payType == 1){//微信支付 |
| | | |
| | | resultUtil = payMoneyUtil.weixinpay("完成订单", "", orderId + "_3_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/wxPayCrossCity", "APP"); |
| | | paymentRecordService.saveData(1, orderCrossCity.getDriverId(), 2, orderId, 3, 1, orderMoney, "", 1);//添加预支付数据 |
| | | |
| | | // Map<String, String> map = icbcPayUtil.placeAnOrder(orderId + ",3", 9, 5, uid.toString(), "完成订单", orderMoney, callbackPath + "/base/wxPayCrossCity", "", type, null); |
| | | // if(map.get("code").equals("200")){ |
| | | // paymentRecordService.saveData(1, orderCrossCity.getDriverId(), 2, orderId, 3, 1, orderMoney, map.get("order_id"), 1);//添加预支付数据 |
| | | // resultUtil = ResultUtil.success(map.get("data")); |
| | | // }else{ |
| | | // resultUtil = ResultUtil.error(map.get("msg"), ""); |
| | | // } |
| | | String appletsOpenId = ""; |
| | | String tradeType = "APP"; |
| | | resultUtil = payMoneyUtil.weixinpay("完成订单", "", out_trade_no, orderMoney.toString(), callbackPath + "/base/wxPayCrossCity", tradeType, appletsOpenId, ""); |
| | | if(resultUtil.getCode() == 200){ |
| | | paymentRecordService.saveData(1, orderCrossCity.getDriverId(), 2, orderId, 3, 1, orderMoney, "", 1);//添加预支付数据 |
| | | } |
| | | } |
| | | if(payType == 2){//支付宝支付 |
| | | resultUtil = payMoneyUtil.alipay("完成订单", "完成订单", "", orderId + "_3_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/aliPayCrossCity"); |
| | | paymentRecordService.saveData(1, orderCrossCity.getDriverId(), 2, orderId, 3, 2, orderMoney, "", 1);//添加预支付数据 |
| | | |
| | | |
| | | // Map<String, String> map = icbcPayUtil.placeAnOrder(orderId + ",3", 10, 5, uid.toString(), "完成订单", orderMoney, callbackPath + "/base/aliPayCrossCity", "", type, null); |
| | | // if(map.get("code").equals("200")){ |
| | | // paymentRecordService.saveData(1, orderCrossCity.getDriverId(), 2, orderId, 3, 2, orderMoney, map.get("order_id"), 1);//添加预支付数据 |
| | | // resultUtil = ResultUtil.success(map.get("data")); |
| | | // }else{ |
| | | // resultUtil = ResultUtil.error(map.get("msg"), ""); |
| | | // } |
| | | resultUtil = payMoneyUtil.alipay("订单完成支付", "支付订单", out_trade_no, orderMoney.toString(), callbackPath + "/base/aliPayCrossCity"); |
| | | if(resultUtil.getCode() == 200){ |
| | | paymentRecordService.saveData(1, orderCrossCity.getDriverId(), 2, orderId, 3, 2, orderMoney, "", 1);//添加预支付数据 |
| | | } |
| | | } |
| | | // if(payType == 3){//扫码支付,暂时屏蔽,这里需要确认需求 |
| | | // //调用支付获取收款二维码数据 |
| | | // ResultUtil<Map<String, Object>> generate = icbcPayUtil.generate(orderCrossCity.getId() + ",3", orderMoney, orderCrossCity.getInsertTime(), orderCrossCity.getOrderNum(), callbackPath + "/base/order/generatePay"); |
| | | // resultUtil = ResultUtil.success(generate.getData().get("qrcode").toString()); |
| | | // } |
| | | if(payType == 3){//扫码支付 |
| | | resultUtil = payMoneyUtil.weixinpay("完成订单", "", out_trade_no, orderMoney.toString(), callbackPath + "/base/wxPayCrossCity", "NATIVE", "", orderCrossCity.getId().toString()); |
| | | if(resultUtil.getCode() == 200){ |
| | | paymentRecordService.saveData(1, orderCrossCity.getUserId(), 1, orderId, 3, 1, orderMoney, "", 1);//添加预支付数据 |
| | | } |
| | | } |
| | | |
| | | this.updateAllColumnById(orderCrossCity); |
| | | return resultUtil; |
| | |
| | | @Override |
| | | public void payOrderCrossCityCallback(Integer id, String order_id, Integer type) throws Exception { |
| | | OrderCrossCity orderCrossCity = this.selectById(id); |
| | | if(orderCrossCity.getState() == 7){ |
| | | PaymentRecord query = paymentRecordService.query(1, orderCrossCity.getDriverId(), 2, id, 3, type, 1); |
| | | if(null == query){ |
| | | System.err.println("预支付数据异常(orderId = " + id + ")"); |
| | | } |
| | | PaymentRecord query = paymentRecordService.query(1, orderCrossCity.getUserId(), 1, Integer.valueOf(id), 3, type, 1); |
| | | if(null == query){ |
| | | query = paymentRecordService.query(1, orderCrossCity.getDriverId(), 2, Integer.valueOf(id), 3, type, 1); |
| | | } |
| | | if(null != query){ |
| | | //添加交易明细 |
| | | transactionDetailsService.saveData(orderCrossCity.getUserId(), "完成订单", query.getAmount(), 2, 1, 1, 3, query.getOrderId()); |
| | | orderCrossCity.setState(2);//先支付再服务 |
| | |
| | | userInfo.setIntegral(userInfo.getIntegral() + (query.getAmount().intValue() * query1.getIntegral()));//积分 |
| | | userInfoMapper.updateById(userInfo); |
| | | |
| | | //处理优惠券和红包 |
| | | if(null != orderCrossCity.getCouponId()){ |
| | | UserCouponRecord userCouponRecord = userCouponRecordMapper.selectById(orderCrossCity.getCouponId()); |
| | | userCouponRecord.setState(2); |
| | | userCouponRecord.setEndTime(new Date()); |
| | | userCouponRecordMapper.updateById(userCouponRecord); |
| | | } |
| | | if(null != orderCrossCity.getRedPacketId()){ |
| | | UserRedPacketRecord userRedPacketRecord = userRedPacketRecordMapper.selectById(orderCrossCity.getRedPacketId()); |
| | | userRedPacketRecord.setState(2); |
| | | userRedPacketRecord.setEndTime(new Date()); |
| | | userRedPacketRecordMapper.updateById(userRedPacketRecord); |
| | | } |
| | | |
| | | |
| | | query.setState(2); |
| | | query.setCode(order_id); |
| | | paymentRecordService.updateById(query); |
| | | |
| | | //添加已收入明细 |
| | | Line line = lineService.selectById(orderCrossCity.getLineId()); |
| | | Double speMoney = Double.valueOf(line.getRakeRate()); |
| | | BigDecimal d = new BigDecimal(orderCrossCity.getOrderMoney()).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN);//企业收入 |
| | | BigDecimal c = new BigDecimal(orderCrossCity.getOrderMoney()).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN);//司机收入 |
| | | incomeService.saveData(1, orderCrossCity.getCompanyId(), 2, orderCrossCity.getId(), 3, d.doubleValue()); |
| | | incomeService.saveData(2, orderCrossCity.getDriverId(), 2, orderCrossCity.getId(), 3, c.doubleValue()); |
| | | Driver driver = driverService.selectById(orderCrossCity.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | |
| | | // TODO: 2020/5/24 这里需要给司机和用户推送订单状态 |
| | | new Thread(new Runnable() { |
| | |
| | | }).start(); |
| | | |
| | | |
| | | systemNoticeService.addSystemNotice(1, "您已使用" + (type == 1 ? "微信" : "支付宝") + "成功完成出行订单支付,谢谢使用!", orderCrossCity.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "您已使用" + (type == 1 ? "微信" : "支付宝") + "成功完成出行订单支付,谢谢使用!", orderCrossCity.getUserId()); |
| | | }else{ |
| | | System.err.println("预支付数据异常(orderId = " + id + ")"); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | }else{//浮动计费 |
| | | //计算公式:实际历程 * 基础单价 * (参考费用 / (参考里程 * 基础单价)) + (实际历程 - 参考里程) * 基础单价 * 优惠系数 |
| | | double num1 = Double.valueOf(jsonObject.getString("num1")).doubleValue();//参考价格 |
| | | double num1 = Double.valueOf(jsonObject.getString("num1")).doubleValue();//参考费用 |
| | | double num2 = Double.valueOf(jsonObject.getString("num2")).doubleValue();//参考里程 |
| | | double num3 = Double.valueOf(jsonObject.getString("num3")).doubleValue();//保底价 |
| | | double num4 = Double.valueOf(jsonObject.getString("num4")).doubleValue();//超出参考里程优惠系数 |
| | | double num5 = Double.valueOf(jsonObject.getString("num5")).doubleValue();//低于参考里程优惠系数 |
| | | double num6 = Double.valueOf(jsonObject.getString("num6")).doubleValue();//包车系数 |
| | | double num7 = Double.valueOf(jsonObject.getString("num7")).doubleValue();//五座系数 |
| | | double num8 = Double.valueOf(jsonObject.getString("num8")).doubleValue();//七座系数 |
| | | |
| | | |
| | | /** |
| | | * 1、实际里程>=参考里程 |
| | | * 参考价+((实际里程-参考里程)*(参考价/参考里程)*超出参考里程优惠系数) |
| | | * |
| | | * 2、实际里程<参考里程 |
| | | * 参考价-(参考里程-实际路程)*(参考价/参考里程)*低于参考里程优惠系数 |
| | | */ |
| | | double unitPrice = 0d; |
| | | if(distance1 > num2){//1 |
| | | unitPrice = num1 + ((distance1 - num2) * (num1 / num2) * num4); |
| | | } |
| | | if(distance1 < num2){//2 |
| | | unitPrice = num1 - ((num2 - distance1) * (num1 / num2) * num5); |
| | | } |
| | | if(distance1 == num2){ |
| | | unitPrice = num1; |
| | | } |
| | | double num3 = Double.valueOf(jsonObject.getString("num3")).doubleValue();//基础单价 |
| | | double num4 = Double.valueOf(jsonObject.getString("num4")).doubleValue();//优惠系数 |
| | | double num5 = Double.valueOf(jsonObject.getString("num5")).doubleValue();//包车系数 |
| | | double num6 = Double.valueOf(jsonObject.getString("num6")).doubleValue();//五座系数 |
| | | double num7 = Double.valueOf(jsonObject.getString("num7")).doubleValue();//七座系数 |
| | | if(travelMode == 1){//拼车 |
| | | double unitPrice = (distance1 * num3 * (num1 / (num2 * num3))) + ((distance1 - num2) * num3 * num4); |
| | | String[] split = seatNumber.split(","); |
| | | boolean b = false; |
| | | for(String s : split){ |
| | |
| | | } |
| | | double price1 = 0D; |
| | | if(b){ |
| | | price1 = unitPrice * (totalSeat == 4 ? num7 : num8); |
| | | price1 = unitPrice * (totalSeat == 4 ? num6 : num7); |
| | | peopleNumber -= 1; |
| | | } |
| | | double price = (unitPrice * peopleNumber) + price1; |
| | | map.put("price", new BigDecimal(num3 > price ? num3 : price).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | map.put("price", new BigDecimal(price).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | }else{ |
| | | double price = unitPrice * totalSeat * num6; |
| | | map.put("price", new BigDecimal(num3 > price ? num3 : price).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | double unitPrice = (distance1 * num3 * (num1 / (num2 * num3))) + ((distance1 - num2) * num3 * num5); |
| | | double price = unitPrice * totalSeat; |
| | | map.put("price", new BigDecimal(price).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | } |
| | | } |
| | | return ResultUtil.success(map); |
| | | } |
| | | |
| | | @Override |
| | | public List<OrderCrossCity> taskMidAxbUnBindSend() throws Exception { |
| | | return this.baseMapper.taskMidAxbUnBindSend(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取订单编号 |
| | |
| | | package com.stylefeng.guns.modular.crossCity.warpper; |
| | | |
| | | import com.stylefeng.guns.modular.system.warpper.MoneyInfo1Warpper; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | |
| | | private Double payMoney; |
| | | @ApiModelProperty("座位") |
| | | private String seatNumber; |
| | | |
| | | @ApiModelProperty("乘车类型(1=独享,2=一口价,3=拼车)") |
| | | private Integer rideType; |
| | | |
| | | @ApiModelProperty("费用明细") |
| | | private MoneyInfo1Warpper moneyInfo1Warpper; |
| | | |
| | | public MoneyInfo1Warpper getMoneyInfo1Warpper() { |
| | | return moneyInfo1Warpper; |
| | | } |
| | | |
| | | public void setMoneyInfo1Warpper(MoneyInfo1Warpper moneyInfo1Warpper) { |
| | | this.moneyInfo1Warpper = moneyInfo1Warpper; |
| | | } |
| | | |
| | | public Integer getOrderId() { |
| | | return orderId; |
| | |
| | | this.seatNumber = seatNumber; |
| | | } |
| | | |
| | | public Integer getRideType() { |
| | | return rideType; |
| | | } |
| | | |
| | | public void setRideType(Integer rideType) { |
| | | this.rideType = rideType; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "OrderCrossCityInfoWrapper{" + |
| | |
| | | OrderCrossCityInfoWrapper orderInfoWarpper = new OrderCrossCityInfoWrapper(); |
| | | if(null != map){ |
| | | orderInfoWarpper.setOrderId(null != map.get("orderId") ? Integer.valueOf(String.valueOf(map.get("orderId"))) : 0); |
| | | orderInfoWarpper.setRideType(null != map.get("rideType") ? Integer.valueOf(String.valueOf(map.get("rideType"))) : 1); |
| | | orderInfoWarpper.setUserId(null != map.get("userId") ? Integer.valueOf(String.valueOf(map.get("userId"))) : 0); |
| | | orderInfoWarpper.setDriverId(null != map.get("driverId") ? Integer.valueOf(String.valueOf(map.get("driverId"))) : 0); |
| | | orderInfoWarpper.setOrderState(null != map.get("orderState") ? Integer.valueOf(String.valueOf(map.get("orderState"))) : 0); |
| | |
| | | private String passengersPhone; |
| | | @ApiModelProperty(value = "乘车人姓名", required = true, dataType = "string") |
| | | private String passengers; |
| | | @ApiModelProperty(value = "附加费JSON数组[{\"id\":1,\"amount\":20.5}]", required = false, dataType = "string") |
| | | private String additionalFee; |
| | | |
| | | public Integer getServerCarModelId() { |
| | | return serverCarModelId; |
| | |
| | | |
| | | public void setPassengers(String passengers) { |
| | | this.passengers = passengers; |
| | | } |
| | | |
| | | public String getAdditionalFee() { |
| | | return additionalFee; |
| | | } |
| | | |
| | | public void setAdditionalFee(String additionalFee) { |
| | | this.additionalFee = additionalFee; |
| | | } |
| | | } |
| | |
| | | */ |
| | | List<OrderLogistics> queryMaturity(); |
| | | |
| | | |
| | | |
| | | List<OrderLogistics> taskMidAxbUnBindSend(); |
| | | |
| | | } |
| | |
| | | <result column="cargoType" property="cargoType"/> |
| | | <result column="urgent" property="urgent"/> |
| | | <result column="cargoNumber" property="cargoNumber"/> |
| | | <result column="userImg" property="userImg"/> |
| | | <result column="driverImg" property="driverImg"/> |
| | | <result column="remark" property="remark"/> |
| | | <result column="placementLon" property="placementLon"/> |
| | | <result column="placementLat" property="placementLat"/> |
| | |
| | | <result column="activityId" property="activityId"/> |
| | | <result column="companyId" property="companyId"/> |
| | | <result column="payMoney" property="payMoney"/> |
| | | <result column="thankYouFee" property="thankYouFee"/> |
| | | <result column="state" property="state"/> |
| | | <result column="insertTime" property="insertTime"/> |
| | | <result column="travelTime" property="travelTime"/> |
| | |
| | | a.tipMoney as tipMoney, |
| | | a.remark as remark, |
| | | a.cargoType as cargoType, |
| | | a.isReassign as isReassign, |
| | | a.userImg, |
| | | a.driverImg, |
| | | DATE_FORMAT(a.arriveTimeExpect, '%Y年%m月%d日 %H:%i') as arriveTimeExpect |
| | | a.isReassign as isReassign |
| | | from t_order_logistics a |
| | | left join t_user b on (a.userId = b.id) |
| | | where a.id = #{orderId} |
| | |
| | | a.driverId as driverId, |
| | | a.state as orderState, |
| | | DATE_FORMAT(a.travelTime, '%m月%d日 %H:%i') as travelTime_, |
| | | IF(a.endServiceTime != null,DATE_FORMAT(a.endServiceTime, '%m月%d日 %H:%i'),'') as endServiceTime, |
| | | DATE_FORMAT(a.travelTime, '%Y-%m-%d %H:%i:%s') as travelTime, |
| | | DATE_FORMAT(a.arriveTime, '%Y-%m-%d %H:%i:%s') as arriveTime, |
| | | a.startAddress as startAddress, |
| | |
| | | a.endLat as endLat, |
| | | a.orderMoney as orderMoney, |
| | | a.payManner as payManner, |
| | | a.thankYouFee, |
| | | a.trackId as trackId, |
| | | b.nickName as userName, |
| | | b.phone as userPhone, |
| | | a.recipient as nickName, |
| | | a.recipientPhone as phone, |
| | | a.urgent as urgent, |
| | |
| | | c.remark as cancelRemark, |
| | | c.money as cancelPayMoney, |
| | | if(c.userType = 1, '用户取消', '平台取消') as cancelUser, |
| | | (select isSpecialCar from t_sys_reformist where companyId = a.companyId) as reassign, |
| | | a.userImg, |
| | | a.driverImg, |
| | | a.timeOutMoney, |
| | | DATE_FORMAT(a.arriveTimeExpect, '%m月%d日 %H:%i') as arriveTimeExpect |
| | | (select isSpecialCar from t_sys_reformist where companyId = a.companyId) as reassign |
| | | from t_order_logistics a |
| | | left join t_user b on (a.userId = b.id) |
| | | left join t_order_cancel c on (a.id = c.orderId and c.orderType = a.type and c.state = 2) |
| | |
| | | startAddress as startAddress, |
| | | endAddress as endAddress, |
| | | state as state, |
| | | CONCAT(recipient, '-', if(null != telX, telX, recipientPhone)) as `user`, |
| | | CONCAT(recipient, '-', recipientPhone) as `user`, |
| | | CONCAT(if(cargoType = 1, '普通货物 x ', '贵重货物 x '), cargoNumber) as cargoNumber, |
| | | driverId as driverId, |
| | | tipMoney as redMoney, |
| | | userImg, |
| | | driverImg, |
| | | DATE_FORMAT(arriveTimeExpect, '%Y年%m月%d日 %H:%i') as arriveTimeExpect |
| | | tipMoney as redMoney |
| | | from t_order_logistics where 1 = 1 |
| | | <if test="null != driverId"> |
| | | and driverId = #{driverId} |
| | |
| | | payManner as payManner, |
| | | UNIX_TIMESTAMP(travelTime) as travelTime, |
| | | remark as remark, |
| | | tipMoney as redMoney, |
| | | userImg, |
| | | driverImg, |
| | | DATE_FORMAT(arriveTimeExpect, '%Y年%m月%d日 %H:%i') as arriveTimeExpect, |
| | | DATE_FORMAT(arriveTimeExpect, '%Y-%m-%d %H:%i:%s') as arriveTimeExpects, |
| | | DATE_FORMAT(endServiceTime, '%Y-%m-%d %H:%i:%s') as endServiceTime |
| | | tipMoney as redMoney |
| | | from t_order_logistics where driverId = #{uid} |
| | | <if test="state == 1"> |
| | | and state not in (1, 7) |
| | |
| | | isReassign as isReassign, |
| | | trackId as trackId |
| | | from t_order_logistics where state = 2 and (UNIX_TIMESTAMP(travelTime) - UNIX_TIMESTAMP(now())) between 1710 and 1800 |
| | | </select> |
| | | |
| | | |
| | | <select id="taskMidAxbUnBindSend" resultType="OrderLogistics"> |
| | | select * from t_order_logistics where (state in (9) and telX != '' and telX is not null and (UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP(endServiceTime)) > 1800) or (state = 10 and telX != '' and telX is not null) |
| | | </select> |
| | | </mapper> |
| | |
| | | */ |
| | | @TableField("cargoNumber") |
| | | private Integer cargoNumber; |
| | | //用户上传的图片,多个英文分号分隔 |
| | | @TableField("userImg") |
| | | private String userImg; |
| | | //司机上传的图片,多个英文分号分隔 |
| | | @TableField("driverImg") |
| | | private String driverImg; |
| | | /** |
| | | * 备注信息 |
| | | */ |
| | |
| | | */ |
| | | @TableField("payMoney") |
| | | private Double payMoney; |
| | | //感谢费 |
| | | @TableField("thankYouFee") |
| | | private Double thankYouFee; |
| | | /** |
| | | * 状态(1=待接单,2=待出发,3=待到达预约地点,4=待取货,5=送货中,6=已送达,7=待支付,8=需补差价,9=已取货,10=已取消,11=改派中,12=已支付差价) |
| | | */ |
| | |
| | | */ |
| | | @TableField("reassignNotice") |
| | | private Integer reassignNotice; |
| | | /** |
| | | * 需要送达时间 |
| | | */ |
| | | @TableField("arriveTimeExpect") |
| | | private Date arriveTimeExpect; |
| | | /** |
| | | * 超时扣款 |
| | | */ |
| | | @TableField("timeOutMoney") |
| | | private Double timeOutMoney; |
| | | |
| | | public Double getTimeOutMoney() { |
| | | return timeOutMoney; |
| | | } |
| | | |
| | | public void setTimeOutMoney(Double timeOutMoney) { |
| | | this.timeOutMoney = timeOutMoney; |
| | | } |
| | | |
| | | public Date getArriveTimeExpect() { |
| | | return arriveTimeExpect; |
| | | } |
| | | |
| | | public void setArriveTimeExpect(Date arriveTimeExpect) { |
| | | this.arriveTimeExpect = arriveTimeExpect; |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | this.payMoney = payMoney; |
| | | } |
| | | |
| | | public Double getThankYouFee() { |
| | | return thankYouFee; |
| | | } |
| | | |
| | | public void setThankYouFee(Double thankYouFee) { |
| | | this.thankYouFee = thankYouFee; |
| | | } |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | |
| | | |
| | | public void setReassignNotice(Integer reassignNotice) { |
| | | this.reassignNotice = reassignNotice; |
| | | } |
| | | |
| | | public String getUserImg() { |
| | | return userImg; |
| | | } |
| | | |
| | | public void setUserImg(String userImg) { |
| | | this.userImg = userImg; |
| | | } |
| | | |
| | | public String getDriverImg() { |
| | | return driverImg; |
| | | } |
| | | |
| | | public void setDriverImg(String driverImg) { |
| | | this.driverImg = driverImg; |
| | | } |
| | | |
| | | @Override |
| | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.TimeOutWarpper; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address, String driverImg) throws Exception; |
| | | ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | List<OrderLogistics> queryMaturity() throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 获取需要解绑小号的数据 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<OrderLogistics> taskMidAxbUnBindSend() throws Exception; |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.smallLogistics.server.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.smallLogistics.dao.OrderLogisticsMapper; |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; |
| | |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsSpreadService; |
| | | import com.stylefeng.guns.modular.system.dao.RegionMapper; |
| | | import com.stylefeng.guns.modular.system.dao.UserInfoMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.model.Company; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.Income; |
| | | import com.stylefeng.guns.modular.system.model.Region; |
| | | import com.stylefeng.guns.modular.system.service.ICompanyService; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IIncomeService; |
| | | import com.stylefeng.guns.modular.system.service.ISystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.warpper.MerchantCouponListWarpper; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | @Service |
| | |
| | | |
| | | @Autowired |
| | | private ALiSendSms aLiSendSms; |
| | | |
| | | @Resource |
| | | private UserInfoMapper userInfoMapper; |
| | | |
| | | @Autowired |
| | | private IMerchantActivityService merchantActivityService; |
| | | |
| | | @Autowired |
| | | private IMerchantActivitySlaveService merchantActivitySlaveService; |
| | | |
| | | @Autowired |
| | | private IUserMerchantCouponService userMerchantCouponService; |
| | | |
| | | @Autowired |
| | | private IMerchantCouponService merchantCouponService; |
| | | |
| | | @Autowired |
| | | private IAgreementService agreementService; |
| | | |
| | | |
| | | |
| | |
| | | orderLogistics.setTrackId(track); |
| | | |
| | | //调用移动的小号接口 |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderLogistics.getRecipientPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderLogistics.getStartLon().toString(), orderLogistics.getStartLat().toString()); |
| | | Region region = regionMapper.query(geocode.get("districtCode")); |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderLogistics.getRecipientPhone(), driver.getPhone(), Integer.valueOf(region.getCitycode().substring(1))); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderLogistics.setTelX(map.get("telX")); |
| | | orderLogistics.setBindId(map.get("bindId")); |
| | |
| | | } |
| | | incomeService.saveData(1, orderLogistics.getCompanyId(), 2, orderLogistics.getId(), orderLogistics.getType(), d.doubleValue()); |
| | | incomeService.saveData(2, orderLogistics.getDriverId(), 2, orderLogistics.getId(), orderLogistics.getType(), c.doubleValue()); |
| | | /*driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver);*/ |
| | | driverService.updateById(driver); |
| | | |
| | | |
| | | |
| | |
| | | } |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(2, "您已成功抢得小件物流订单,请及时联系客户!", orderLogistics.getDriverId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getName().substring(0, 1) + "师傅,请保持电话畅通!", orderLogistics.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(2, "您已成功抢得小件物流订单,请及时联系客户!", orderLogistics.getDriverId()); |
| | | systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getName().substring(0, 1) + "师傅,请保持电话畅通!", orderLogistics.getUserId()); |
| | | |
| | | |
| | | if (this.selectList(new EntityWrapper<OrderLogistics>().eq("driverId",uid)).size() == 1){ |
| | | return ResultUtil.success(agreementService.selectOne(new EntityWrapper<Agreement>().eq("type",17))); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address, String driverImg) throws Exception { |
| | | public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address) throws Exception { |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | UserInfo userInfo = userInfoMapper.selectById(orderLogistics.getUserId()); |
| | | switch (state){ |
| | | case 3://出发前往预约点 |
| | | orderLogistics.setState(3); |
| | | orderLogistics.setSetOutTime(new Date()); |
| | | systemNoticeService.addSystemNotice(1, "司机已出发,请耐心等待", orderLogistics.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "司机已出发,请耐心等待", orderLogistics.getUserId()); |
| | | break; |
| | | case 4://到达预约点,等待客户上车 |
| | | orderLogistics.setState(4); |
| | | orderLogistics.setArriveTime(new Date()); |
| | | systemNoticeService.addSystemNotice(1, "司机已到达您设置的预约地点。", orderLogistics.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "司机已到达您设置的预约地点。", orderLogistics.getUserId()); |
| | | break; |
| | | case 5://开始服务 |
| | | orderLogistics.setBoardingLon(lon); |
| | |
| | | pushUtil.pushDriverPosition(orderLogistics.getId(), orderLogistics.getType());//主动推送司机定位 |
| | | break; |
| | | case 6://结束服务(专车可以返回继续服务)不修改状态 |
| | | if(orderLogistics.getState()!=6){ |
| | | orderLogistics.setGetoffLon(lon); |
| | | orderLogistics.setGetoffLat(lat); |
| | | orderLogistics.setGetoffAddress(address); |
| | | orderLogistics.setGetoffTime(new Date()); |
| | | orderLogistics.setEndServiceTime(new Date()); |
| | | orderLogistics.setState(6); |
| | | orderLogistics.setDriverImg(driverImg); |
| | | orderLogistics.setGetoffLon(lon); |
| | | orderLogistics.setGetoffLat(lat); |
| | | orderLogistics.setGetoffAddress(address); |
| | | orderLogistics.setGetoffTime(new Date()); |
| | | orderLogistics.setEndServiceTime(new Date()); |
| | | orderLogistics.setState(6); |
| | | |
| | | //添加已收入明细 |
| | | // TODO: 2022/3/19 抽成按照订单金额计算,优先保证司机的收入,用户支付金额不够,则在平台收入中补贴司机收入 |
| | | //例如:订单金额10元,优惠3元,司机收入比例80%,平台收入比例20%。 |
| | | //司机收入:10 * 0.8 = 8 |
| | | //平台收入:7 - 8 = -1 |
| | | Company company = companyService.selectById(orderLogistics.getCompanyId()); |
| | | Double speMoney = orderLogistics.getType() == 4 ? company.getSameLogisticsMoney() : company.getCrossLogisticsMoney(); |
| | | Double orderMoney = orderLogistics.getOrderMoney(); |
| | | BigDecimal d = null; |
| | | BigDecimal c = null; |
| | | if(company.getIsSpeFixedOrProportional() == 2){//固定 |
| | | d = new BigDecimal(speMoney.compareTo(orderMoney) > 0 ? orderMoney : speMoney); |
| | | c = new BigDecimal(orderMoney).subtract(d); |
| | | } |
| | | if(company.getIsSpeFixedOrProportional() == 1){//比例 |
| | | c = new BigDecimal(orderMoney).multiply(new BigDecimal(1 - (speMoney / 100))).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | d = new BigDecimal(orderLogistics.getPayMoney()).subtract(c).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | |
| | | Income income = incomeService.selectOne(new EntityWrapper<Income>().eq("userType", 1).eq("objectId", orderLogistics.getCompanyId()).eq("type", 2).eq("incomeId", orderLogistics.getId()).eq("orderType", orderLogistics.getType())); |
| | | income.setMoney(d.doubleValue()); |
| | | incomeService.updateById(income); |
| | | income = incomeService.selectOne(new EntityWrapper<Income>().eq("userType", 2).eq("objectId", orderLogistics.getDriverId()).eq("type", 2).eq("incomeId", orderLogistics.getId()).eq("orderType", orderLogistics.getType())); |
| | | income.setMoney(c.doubleValue()); |
| | | incomeService.updateById(income); |
| | | Driver driver = driverService.selectById(orderLogistics.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | |
| | | |
| | | //记录添加用户商家优惠券 |
| | | //订单数要加1,因为这里是后修改订单状态 |
| | | List<OrderLogistics> list = this.selectList(new EntityWrapper<OrderLogistics>().eq("userId", userInfo.getId()).eq("type", orderLogistics.getType()).eq("state", 9).eq("isDelete", 1)); |
| | | List<MerchantActivity> merchantActivities = merchantActivityService.selectList(new EntityWrapper<MerchantActivity>().eq("companyId", orderLogistics.getCompanyId()).eq("activityType", 1).eq("auditStatus", 2).eq("status", 1) |
| | | .eq("state", 1).like("orderType", "%" + orderLogistics.getType() + "%").where("((orderAmountFull is not null and orderAmountFull <= " + orderLogistics.getOrderMoney() + ") or (orderNumber is not null and orderNumber <= " + (list.size() + 1) + "))") |
| | | .in("id", merchantActivitySlaveService.selectList(new EntityWrapper<MerchantActivitySlave>().gt("laveNumber", 0)).stream().map(MerchantActivitySlave::getMerchantActivityId).collect(Collectors.toList())) |
| | | .notIn("id", userMerchantCouponService.selectList(new EntityWrapper<UserMerchantCoupon>().eq("userType", 1).eq("userId", userInfo.getId()).eq("state", 1)).stream().map(UserMerchantCoupon::getMerchantActivityId).collect(Collectors.toList())) |
| | | ); |
| | | List<MerchantCouponListWarpper> listWarppers = new ArrayList<>(); |
| | | if(merchantActivities.size() > 0){ |
| | | for(MerchantActivity merchantActivity :merchantActivities){ |
| | | List<MerchantActivitySlave> merchantActivitySlaves = merchantActivitySlaveService.selectList(new EntityWrapper<MerchantActivitySlave>().eq("merchantActivityId", merchantActivity.getId()).gt("laveNumber", 0)); |
| | | |
| | | for(MerchantActivitySlave merchantActivitySlave : merchantActivitySlaves){ |
| | | UserMerchantCoupon userMerchantCoupon = new UserMerchantCoupon(); |
| | | try { |
| | | userMerchantCoupon.setCode(UUIDUtil.getRandomCode(16)); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | userMerchantCoupon.setUserType(1); |
| | | userMerchantCoupon.setUserId(userInfo.getId()); |
| | | userMerchantCoupon.setMerchantActivityId(merchantActivity.getId()); |
| | | userMerchantCoupon.setMerchantCouponId(merchantActivitySlave.getMerchantCouponId()); |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(new Date()); |
| | | calendar.set(Calendar.DAY_OF_YEAR, calendar.get(Calendar.DAY_OF_YEAR) + merchantActivity.getEffectiveDays()); |
| | | userMerchantCoupon.setEndTime(calendar.getTime()); |
| | | userMerchantCoupon.setStatus(1); |
| | | userMerchantCoupon.setState(1); |
| | | userMerchantCoupon.setCreateTime(new Date()); |
| | | userMerchantCouponService.insert(userMerchantCoupon); |
| | | |
| | | MerchantCoupon merchantCoupon = merchantCouponService.selectById(merchantActivitySlave.getMerchantCouponId()); |
| | | MerchantCouponListWarpper merchantCouponListWarpper = new MerchantCouponListWarpper(); |
| | | merchantCouponListWarpper.setId(merchantActivitySlave.getMerchantCouponId()); |
| | | merchantCouponListWarpper.setName(merchantCoupon.getName()); |
| | | merchantCouponListWarpper.setType(merchantCoupon.getType()); |
| | | merchantCouponListWarpper.setFullAmount(merchantCoupon.getFullAmount()); |
| | | merchantCouponListWarpper.setDiscount(merchantCoupon.getDiscount()); |
| | | listWarppers.add(merchantCouponListWarpper); |
| | | |
| | | merchantActivitySlave.setLaveNumber(merchantActivitySlave.getLaveNumber() - 1); |
| | | if(merchantActivitySlave.getLaveNumber() == 0){ |
| | | merchantActivity.setStatus(2); |
| | | } |
| | | } |
| | | if(merchantActivitySlaves.size() > 0){ |
| | | merchantActivitySlaveService.updateBatchById(merchantActivitySlaves); |
| | | } |
| | | } |
| | | merchantActivityService.updateBatchById(merchantActivities); |
| | | } |
| | | String value = redisUtil.getValue("merchantVoucher"); |
| | | JSONObject jsonObject = JSON.parseObject(value); |
| | | if(null == jsonObject){ |
| | | jsonObject = new JSONObject(); |
| | | } |
| | | jsonObject.put(userInfo.getPhone(), listWarppers); |
| | | redisUtil.setStrValue("merchantVoucher", jsonObject.toJSONString()); |
| | | Double orderMoney = orderLogistics.getOrderMoney(); |
| | | //添加已收入明细 |
| | | Company company = companyService.selectById(orderLogistics.getCompanyId()); |
| | | Double speMoney = orderLogistics.getType() == 4 ? company.getSameLogisticsMoney() : company.getCrossLogisticsMoney(); |
| | | BigDecimal d = null; |
| | | BigDecimal c = null; |
| | | if(company.getIsSpeFixedOrProportional() == 2){//固定 |
| | | d = new BigDecimal(speMoney); |
| | | c = new BigDecimal(orderMoney).subtract(d); |
| | | } |
| | | if(company.getIsSpeFixedOrProportional() == 1){//比例 |
| | | d = new BigDecimal(orderMoney).multiply(new BigDecimal(speMoney).divide(new BigDecimal(100))).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | c = new BigDecimal(orderMoney).subtract(d).setScale(2, BigDecimal.ROUND_HALF_EVEN); |
| | | } |
| | | |
| | | Income income = incomeService.selectOne(new EntityWrapper<Income>().eq("userType", 1).eq("objectId", orderLogistics.getCompanyId()).eq("type", 2).eq("incomeId", orderLogistics.getId()).eq("orderType", orderLogistics.getType())); |
| | | income.setMoney(income.getMoney() + d.doubleValue()); |
| | | incomeService.updateById(income); |
| | | income = incomeService.selectOne(new EntityWrapper<Income>().eq("userType", 2).eq("objectId", orderLogistics.getDriverId()).eq("type", 2).eq("incomeId", orderLogistics.getId()).eq("orderType", orderLogistics.getType())); |
| | | income.setMoney(income.getMoney() + c.doubleValue()); |
| | | incomeService.updateById(income); |
| | | Driver driver = driverService.selectById(orderLogistics.getDriverId()); |
| | | driver.setBusinessMoney(new BigDecimal(null != driver.getBusinessMoney() ? driver.getBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveBusinessMoney(new BigDecimal(null != driver.getLaveBusinessMoney() ? driver.getLaveBusinessMoney() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(new BigDecimal(null != driver.getBalance() ? driver.getBalance() : 0).add(c).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | |
| | | break; |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private ISysWithdrawalPoundageService sysWithdrawalPoundageService; |
| | | |
| | | @Autowired |
| | | private ISysTimeoutMoneyService sysTimeoutMoneyService; |
| | | |
| | | /** |
| | | * 验证取件码(小件物流) |
| | | * @param orderId |
| | |
| | | return ResultUtil.error("验证失败"); |
| | | } |
| | | orderLogistics.setState(9); |
| | | orderLogistics.setEndServiceTime(DateUtil.parseTime(DateUtil.getTime())); |
| | | |
| | | /// 超时,扣款订单的%费用 |
| | | SysTimeoutMoney sysTimeoutMoney = sysTimeoutMoneyService.selectOne(null); |
| | | if(orderLogistics.getArriveTimeExpect()!=null){ |
| | | if (new Date().getTime() > (orderLogistics.getArriveTimeExpect().getTime() + sysTimeoutMoney.getTimeOut())){ |
| | | double timeOutMoney = sysTimeoutMoney.getDeductMoney()*orderLogistics.getOrderMoney()/100; |
| | | orderLogistics.setTimeOutMoney(timeOutMoney); |
| | | |
| | | /// 超时扣款扣除司机余额和剩余业务金额 |
| | | Driver driver = driverService.selectById(orderLogistics.getDriverId()); |
| | | driver.setLaveBusinessMoney(driver.getLaveBusinessMoney() - timeOutMoney); |
| | | driver.setBalance(driver.getBalance() - timeOutMoney); |
| | | driverService.updateById(driver); |
| | | |
| | | |
| | | /// 存入平台收入 |
| | | Income income = new Income(); |
| | | income.setIncomeId(orderId); |
| | | income.setOrderType(orderLogistics.getType()); |
| | | income.setInsertTime(new Date()); |
| | | income.setMoney(timeOutMoney); |
| | | income.setUserType(1); |
| | | income.setType(7); |
| | | income.setObjectId(orderLogistics.getCompanyId()); |
| | | incomeService.insert(income); |
| | | } |
| | | } |
| | | |
| | | this.updateById(orderLogistics); |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | } |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(2, "您已成功抢得出租车订单,请及时联系客户!", orderLogistics.getDriverId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getName().substring(0, 1) + "师傅,请保持电话畅通!", orderLogistics.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(2, "您已成功抢得出租车订单,请及时联系客户!", orderLogistics.getDriverId()); |
| | | systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getName().substring(0, 1) + "师傅,请保持电话畅通!", orderLogistics.getUserId()); |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public void sendVerificationCode(Integer orderId) throws Exception { |
| | | // OrderLogistics orderLogistics = this.selectById(orderId); |
| | | // String random = ""; |
| | | // for(int i = 0; i < 6; i++){ |
| | | // random += Double.valueOf(Math.random() * 10).intValue(); |
| | | // } |
| | | // orderLogistics.setPickUpCode(random); |
| | | // this.updateById(orderLogistics); |
| | | OrderLogistics orderLogistics = this.selectById(orderId); |
| | | String random = ""; |
| | | for(int i = 0; i < 6; i++){ |
| | | random += Double.valueOf(Math.random() * 10).intValue(); |
| | | } |
| | | orderLogistics.setPickUpCode(random); |
| | | this.updateById(orderLogistics); |
| | | //发送短信 |
| | | // aLiSendSms.sendSms(orderLogistics.getRecipientPhone(), "SMS_229715276", "{\"code\":\"" + random + "\"}"); |
| | | aLiSendSms.sendSms(orderLogistics.getRecipientPhone(), "SMS_206737941", "{\"code\":\"" + random + "\"}"); |
| | | } |
| | | |
| | | @Override |
| | | public List<OrderLogistics> queryMaturity() throws Exception { |
| | | return orderLogisticsMapper.queryMaturity(); |
| | | } |
| | | |
| | | @Override |
| | | public List<OrderLogistics> taskMidAxbUnBindSend() throws Exception { |
| | | return this.baseMapper.taskMidAxbUnBindSend(); |
| | | } |
| | | } |
| | |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | List<Map<String, Object>> queryOrderInfo(@Param("orderId") Integer orderId, |
| | | @Param("state") Integer state, |
| | | @Param("lon") String lon, |
| | | @Param("lat") String lat); |
| | | Map<String, Object> queryOrderInfo2(@Param("orderId") Integer orderId); |
| | | |
| | | Map<String, Object> queryOrderInfo(@Param("orderId") Integer orderId); |
| | | |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | List<OrderPrivateCar> queryMaturity(); |
| | | |
| | | |
| | | List<OrderPrivateCar> taskMidAxbUnBindSend(); |
| | | } |
| | |
| | | <result column="longDistanceMoney" property="longDistanceMoney"/> |
| | | <result column="parkMoney" property="parkMoney"/> |
| | | <result column="roadTollMoney" property="roadTollMoney"/> |
| | | <result column="holidayFee" property="holidayFee"/> |
| | | <result column="redPacketMoney" property="redPacketMoney"/> |
| | | <result column="couponMoney" property="couponMoney"/> |
| | | <result column="redPacketId" property="redPacketId"/> |
| | |
| | | <result column="activityId" property="activityId"/> |
| | | <result column="companyId" property="companyId"/> |
| | | <result column="payMoney" property="payMoney"/> |
| | | <result column="thankYouFee" property="thankYouFee"/> |
| | | <result column="substitute" property="substitute"/> |
| | | <result column="passengers" property="passengers"/> |
| | | <result column="passengersPhone" property="passengersPhone"/> |
| | |
| | | <result column="endServiceTime" property="endServiceTime"/> |
| | | <result column="orderType" property="orderType"/> |
| | | <result column="orderSource" property="orderSource"/> |
| | | <result column="deviceCode" property="deviceCode"/> |
| | | <result column="invoiceId" property="invoiceId"/> |
| | | <result column="isReassign" property="isReassign"/> |
| | | <result column="reassignNotice" property="reassignNotice"/> |
| | |
| | | select |
| | | id as id, |
| | | (1) as type, |
| | | ('快车订单') as `name`, |
| | | ('专车订单') as `name`, |
| | | DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i:%s') as time, |
| | | startAddress as startAddress, |
| | | endAddress as endAddress, |
| | | state as state, |
| | | orderType as reservation, |
| | | rideType as rideType, |
| | | spellSuccess, |
| | | totalPeopleNum as peopleNumber, |
| | | driverId as driverId |
| | | from t_order_private_car where 1 = 1 and pid is null |
| | | from t_order_private_car where 1 = 1 |
| | | <if test="null != driverId"> |
| | | and driverId = #{driverId} |
| | | </if> |
| | |
| | | select |
| | | id as id, |
| | | (1) as type, |
| | | ('快车订单') as `name`, |
| | | ('专车订单') as `name`, |
| | | DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i:%s') as time, |
| | | startAddress as startAddress, |
| | | endAddress as endAddress, |
| | | state as state, |
| | | orderType as reservation, |
| | | rideType as rideType, |
| | | spellSuccess, |
| | | totalPeopleNum as peopleNumber, |
| | | driverId as driverId |
| | | from t_order_private_car where 1 = 1 and pid is null |
| | | from t_order_private_car where 1 = 1 |
| | | <if test="null != driverId"> |
| | | and driverId = #{driverId} |
| | | </if> |
| | | and state in (3, 4, 5, 6, 11) |
| | | |
| | | UNION ALL |
| | | |
| | | select |
| | | id as id, |
| | | (1) as type, |
| | | ('快车订单') as `name`, |
| | | DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i:%s') as time, |
| | | startAddress as startAddress, |
| | | endAddress as endAddress, |
| | | state as state, |
| | | orderType as reservation, |
| | | rideType as rideType, |
| | | spellSuccess, |
| | | totalPeopleNum as peopleNumber, |
| | | driverId as driverId |
| | | from t_order_private_car where 1 = 1 and pid is not null |
| | | <if test="null != driverId"> |
| | | and driverId = #{driverId} |
| | | </if> |
| | | and pid not in ( |
| | | select |
| | | GROUP_CONCAT(id) |
| | | from t_order_private_car where 1 = 1 and pid is null |
| | | <if test="null != driverId"> |
| | | and driverId = #{driverId} |
| | | </if> |
| | | and state = 2 and (UNIX_TIMESTAMP(travelTime) - UNIX_TIMESTAMP(now())) < 1800 |
| | | |
| | | ) |
| | | and state = 2 and (UNIX_TIMESTAMP(travelTime) - UNIX_TIMESTAMP(now())) < 1800 group by pid |
| | | |
| | | UNION ALL |
| | | |
| | | select |
| | | id as id, |
| | | (1) as type, |
| | | ('快车订单') as `name`, |
| | | DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i:%s') as time, |
| | | startAddress as startAddress, |
| | | endAddress as endAddress, |
| | | state as state, |
| | | orderType as reservation, |
| | | rideType as rideType, |
| | | spellSuccess, |
| | | totalPeopleNum as peopleNumber, |
| | | driverId as driverId |
| | | from t_order_private_car where 1 = 1 and pid is not null |
| | | <if test="null != driverId"> |
| | | and driverId = #{driverId} |
| | | </if> |
| | | and pid not in ( |
| | | select |
| | | GROUP_CONCAT(id) |
| | | from t_order_private_car where 1 = 1 and pid is null |
| | | <if test="null != driverId"> |
| | | and driverId = #{driverId} |
| | | </if> |
| | | and state in (3, 4, 5, 6, 11) |
| | | |
| | | ) |
| | | and state in (3, 4, 5, 6, 11) group by pid |
| | | </if> |
| | | <if test="state == 2"> |
| | | select |
| | | id as id, |
| | | (1) as type, |
| | | ('快车订单') as `name`, |
| | | ('专车订单') as `name`, |
| | | DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i:%s') as time, |
| | | startAddress as startAddress, |
| | | endAddress as endAddress, |
| | | state as state, |
| | | orderType as reservation, |
| | | rideType as rideType, |
| | | spellSuccess, |
| | | totalPeopleNum as peopleNumber, |
| | | driverId as driverId |
| | | from t_order_private_car where 1 = 1 and pid is null |
| | | from t_order_private_car where 1 = 1 |
| | | <if test="null != driverId"> |
| | | and driverId = #{driverId} |
| | | </if> |
| | | and state = 2 and (UNIX_TIMESTAMP(travelTime) - UNIX_TIMESTAMP(now())) >= 1800 |
| | | |
| | | UNION ALL |
| | | |
| | | select |
| | | id as id, |
| | | (1) as type, |
| | | ('快车订单') as `name`, |
| | | DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i:%s') as time, |
| | | startAddress as startAddress, |
| | | endAddress as endAddress, |
| | | state as state, |
| | | orderType as reservation, |
| | | rideType as rideType, |
| | | spellSuccess, |
| | | totalPeopleNum as peopleNumber, |
| | | driverId as driverId |
| | | from t_order_private_car where 1 = 1 and pid is not null |
| | | <if test="null != driverId"> |
| | | and driverId = #{driverId} |
| | | </if> |
| | | and pid not in ( |
| | | select |
| | | GROUP_CONCAT(id) |
| | | from t_order_private_car where 1 = 1 and pid is null |
| | | <if test="null != driverId"> |
| | | and driverId = #{driverId} |
| | | </if> |
| | | and state = 2 and (UNIX_TIMESTAMP(travelTime) - UNIX_TIMESTAMP(now())) >= 1800 |
| | | |
| | | ) |
| | | and state = 2 and (UNIX_TIMESTAMP(travelTime) - UNIX_TIMESTAMP(now())) >= 1800 group by pid |
| | | </if> |
| | | </select> |
| | | |
| | |
| | | select |
| | | id as id, |
| | | (1) as type, |
| | | ('快车订单') as `name`, |
| | | ('专车订单') as `name`, |
| | | DATE_FORMAT(travelTime, '%Y-%m-%d %H:%i:%s') as time, |
| | | startAddress as startAddress, |
| | | endAddress as endAddress, |
| | | state as state, |
| | | peopleNum as peopleNumber, |
| | | rideType as rideType, |
| | | spellSuccess, |
| | | orderType as reservation, |
| | | orderMoney as orderMoney, |
| | | payManner as payManner, |
| | |
| | | select |
| | | id as orderId, |
| | | state as orderState, |
| | | ('快车订单') as orderName, |
| | | ('专车订单') as orderName, |
| | | DATE_FORMAT(travelTime, '%m月%d日 %H:%i') as travelTime, |
| | | startAddress as startAddress, |
| | | endAddress as endAddress, |
| | |
| | | orderSource as orderSource, |
| | | orderType as orderType, |
| | | isReassign as isReassign, |
| | | rideType as rideType, |
| | | spellSuccess, |
| | | peopleNum as peopleNumber, |
| | | companyId as companyId |
| | | from t_order_private_car where id = #{orderId} |
| | | </select> |
| | | |
| | | |
| | | <select id="queryOrderInfo2" resultType="map"> |
| | | select |
| | | a.id as orderId, |
| | | a.userId as userId, |
| | | a.driverId as driverId, |
| | | a.state as orderState, |
| | | DATE_FORMAT(a.travelTime, '%m月%d日 %H:%i') as travelTime_, |
| | | DATE_FORMAT(a.travelTime, '%Y-%m-%d %H:%i:%s') as travelTime, |
| | | DATE_FORMAT(a.arriveTime, '%Y-%m-%d %H:%i:%s') as arriveTime, |
| | | a.startAddress as startAddress, |
| | | a.endAddress as endAddress, |
| | | a.startLon as startLon, |
| | | a.startLat as startLat, |
| | | a.endLon as endLon, |
| | | a.endLat as endLat, |
| | | a.orderMoney as orderMoney, |
| | | a.payManner as payManner, |
| | | a.thankYouFee, |
| | | a.trackId as trackId, |
| | | b.nickName as nickName, |
| | | a.passengersPhone as phone, |
| | | a.orderType as reservation, |
| | | a.telX as telX, |
| | | a.peopleNum as peopleNumber, |
| | | a.rideType as rideType, |
| | | a.spellSuccess as spellSuccess, |
| | | a.bindId as bindId, |
| | | ( |
| | | (select count(id) from t_order_private_car where userId = b.id and state in (8, 9)) + |
| | | (select count(id) from t_order_taxi where userId = b.id and state in (8, 9)) + |
| | | (select count(id) from t_order_cross_city where userId = b.id and state in (8, 9)) |
| | | ) as historyNum, |
| | | (select phone from t_phone where companyId = a.companyId and `type` = 1) as emergencyCall, |
| | | c.reason as cancelReason, |
| | | c.remark as cancelRemark, |
| | | c.money as cancelPayMoney, |
| | | if(c.userType = 1, '用户取消', '平台取消') as cancelUser, |
| | | (select isSpecialCar from t_sys_reformist where companyId = a.companyId) as reassign |
| | | from t_order_private_car a |
| | | left join t_user b on (a.userId = b.id) |
| | | left join t_order_cancel c on (a.id = c.orderId and c.orderType = 1 and c.state = 2) |
| | | where a.id = #{orderId} |
| | | |
| | | |
| | | </select> |
| | | <select id="queryOrderInfo" resultType="map"> |
| | | select |
| | | a.id as orderId, |
| | |
| | | a.endLat as endLat, |
| | | a.orderMoney as orderMoney, |
| | | a.payManner as payManner, |
| | | a.thankYouFee, |
| | | a.trackId as trackId, |
| | | b.nickName as nickName, |
| | | a.passengersPhone as phone, |
| | | a.orderType as reservation, |
| | | a.telX as telX, |
| | | a.peopleNum as peopleNumber, |
| | | a.rideType as rideType, |
| | | a.bindId as bindId, |
| | | ( |
| | | (select count(id) from t_order_private_car where userId = b.id and state in (8, 9)) + |
| | |
| | | from t_order_private_car a |
| | | left join t_user b on (a.userId = b.id) |
| | | left join t_order_cancel c on (a.id = c.orderId and c.orderType = 1 and c.state = 2) |
| | | where (a.id = #{orderId} or a.pid=#{orderId}) |
| | | <if test="state==4"> |
| | | and (a.state=2 or a.state=3 or a.state=4 ) |
| | | order by a.insertTime |
| | | </if> |
| | | <if test="state==5"> |
| | | and a.state=5 |
| | | order by ROUND( |
| | | 6378.138 * 2 * ASIN( |
| | | SQRT( |
| | | POW( |
| | | SIN(( |
| | | #{lat} * PI()/ 180-endLat * PI()/ 180 |
| | | )/ 2 |
| | | ), |
| | | 2 |
| | | )+ COS( #{lat} * PI()/ 180 )* COS( endLat * PI()/ 180 )* POW( |
| | | SIN(( |
| | | #{lon} * PI()/ 180-endLon * PI()/ 180 |
| | | )/ 2 |
| | | ), |
| | | 2 |
| | | )))* 1000 |
| | | ) asc |
| | | </if> |
| | | <if test="state!=4 and state!=5"> |
| | | and a.state!=2 |
| | | and a.state!=3 |
| | | and a.state!=4 |
| | | and a.state!=5 |
| | | order by a.endServiceTime |
| | | </if> |
| | | |
| | | where a.id = #{orderId} |
| | | </select> |
| | | |
| | | |
| | |
| | | telX as telX, |
| | | bindId as bindId |
| | | from t_order_private_car where orderType = 2 and state = 2 and (UNIX_TIMESTAMP(travelTime) - UNIX_TIMESTAMP(now())) between 1710 and 1800 |
| | | </select> |
| | | |
| | | |
| | | <select id="taskMidAxbUnBindSend" resultType="OrderPrivateCar"> |
| | | select * from t_order_private_car where (state in (8, 9) and telX != '' and telX is not null and (UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP(endServiceTime)) > 1800) or (state = 10 and telX != '' and telX is not null) |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | */ |
| | | @TableField("roadTollMoney") |
| | | private Double roadTollMoney; |
| | | //节假日费 |
| | | @TableField("holidayFee") |
| | | private Double holidayFee; |
| | | /** |
| | | * 红包抵扣金额 |
| | | */ |
| | |
| | | */ |
| | | @TableField("payMoney") |
| | | private Double payMoney; |
| | | //感谢费 |
| | | @TableField("thankYouFee") |
| | | private Double thankYouFee; |
| | | /** |
| | | * 是否是代下单(0:否,1:是) |
| | | */ |
| | |
| | | @TableField("orderSource") |
| | | private Integer orderSource; |
| | | /** |
| | | * 设备号 |
| | | */ |
| | | @TableField("deviceCode") |
| | | private String deviceCode; |
| | | /** |
| | | * 发票id |
| | | */ |
| | | @TableField("invoiceId") |
| | |
| | | */ |
| | | @TableField("bindId") |
| | | private String bindId; |
| | | |
| | | /** |
| | | * 乘车人数 |
| | | */ |
| | | @TableField("peopleNum") |
| | | private Integer peopleNum; |
| | | /** |
| | | * 乘车类型(1=独享,2=一口价,3=拼车) |
| | | */ |
| | | @TableField("rideType") |
| | | private Integer rideType; |
| | | |
| | | @TableField("pid") |
| | | private Integer pid; |
| | | |
| | | private Integer totalPeopleNum; |
| | | |
| | | /** |
| | | * 预估里程(米) |
| | | */ |
| | | private Double estimateMileage; |
| | | |
| | | private Double estimateTime; |
| | | |
| | | private Integer spellSuccess; |
| | | |
| | | private String waitRule; |
| | | private String chargeRule; |
| | | private String chargeRules; |
| | | |
| | | private Integer driverCancle; |
| | | |
| | | public String getChargeRules() { |
| | | return chargeRules; |
| | | } |
| | | |
| | | public void setChargeRules(String chargeRules) { |
| | | this.chargeRules = chargeRules; |
| | | } |
| | | |
| | | public Integer getDriverCancle() { |
| | | return driverCancle; |
| | | } |
| | | |
| | | public void setDriverCancle(Integer driverCancle) { |
| | | this.driverCancle = driverCancle; |
| | | } |
| | | |
| | | public String getWaitRule() { |
| | | return waitRule; |
| | | } |
| | | |
| | | public void setWaitRule(String waitRule) { |
| | | this.waitRule = waitRule; |
| | | } |
| | | |
| | | public String getChargeRule() { |
| | | return chargeRule; |
| | | } |
| | | |
| | | public void setChargeRule(String chargeRule) { |
| | | this.chargeRule = chargeRule; |
| | | } |
| | | |
| | | public Integer getSpellSuccess() { |
| | | return spellSuccess; |
| | | } |
| | | |
| | | public void setSpellSuccess(Integer spellSuccess) { |
| | | this.spellSuccess = spellSuccess; |
| | | } |
| | | |
| | | public Double getEstimateTime() { |
| | | return estimateTime; |
| | | } |
| | | |
| | | public void setEstimateTime(Double estimateTime) { |
| | | this.estimateTime = estimateTime; |
| | | } |
| | | |
| | | public Double getEstimateMileage() { |
| | | return estimateMileage; |
| | | } |
| | | |
| | | public void setEstimateMileage(Double estimateMileage) { |
| | | this.estimateMileage = estimateMileage; |
| | | } |
| | | |
| | | public Integer getPeopleNum() { |
| | | return peopleNum; |
| | | } |
| | | |
| | | public void setPeopleNum(Integer peopleNum) { |
| | | this.peopleNum = peopleNum; |
| | | } |
| | | |
| | | public Integer getRideType() { |
| | | return rideType; |
| | | } |
| | | |
| | | public void setRideType(Integer rideType) { |
| | | this.rideType = rideType; |
| | | } |
| | | |
| | | public Integer getPid() { |
| | | return pid; |
| | | } |
| | | |
| | | public void setPid(Integer pid) { |
| | | this.pid = pid; |
| | | } |
| | | |
| | | public Integer getTotalPeopleNum() { |
| | | return totalPeopleNum; |
| | | } |
| | | |
| | | public void setTotalPeopleNum(Integer totalPeopleNum) { |
| | | this.totalPeopleNum = totalPeopleNum; |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | this.roadTollMoney = roadTollMoney; |
| | | } |
| | | |
| | | public Double getHolidayFee() { |
| | | return holidayFee; |
| | | } |
| | | |
| | | public void setHolidayFee(Double holidayFee) { |
| | | this.holidayFee = holidayFee; |
| | | } |
| | | |
| | | public Double getRedPacketMoney() { |
| | | return redPacketMoney; |
| | | } |
| | |
| | | |
| | | public void setPayMoney(Double payMoney) { |
| | | this.payMoney = payMoney; |
| | | } |
| | | |
| | | public Double getThankYouFee() { |
| | | return thankYouFee; |
| | | } |
| | | |
| | | public void setThankYouFee(Double thankYouFee) { |
| | | this.thankYouFee = thankYouFee; |
| | | } |
| | | |
| | | public Integer getSubstitute() { |
| | |
| | | this.startMileage = startMileage; |
| | | } |
| | | |
| | | public String getDeviceCode() { |
| | | return deviceCode; |
| | | } |
| | | |
| | | public void setDeviceCode(String deviceCode) { |
| | | this.deviceCode = deviceCode; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "OrderPrivateCar{" + |
| | |
| | | * @throws Exception |
| | | */ |
| | | Map<String, Object> queryOrderInfo(Integer orderId) throws Exception; |
| | | Map<String, Object> queryOrderInfo2(Integer orderId) throws Exception; |
| | | |
| | | |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil confirmFees(Integer orderId, Integer type, Double parkingFee, Double crossingFee) throws Exception; |
| | | ResultUtil cancleOrder(Integer orderId) throws Exception; |
| | | ResultUtil updatePeopleNum(Integer orderId, Integer peopleNum) throws Exception; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 确认费用操作 |
| | | * @param orderId |
| | | * @param type |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil confirmFees1(Integer orderId, Integer type, String additionalFee) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | List<OrderPrivateCar> queryMaturity() throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 获取结束订单30分钟后的数据 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<OrderPrivateCar> taskMidAxbUnBindSend() throws Exception; |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.specialTrain.server.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.specialTrain.dao.OrderPrivateCarMapper; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.dao.CarServiceMapper; |
| | | import com.stylefeng.guns.modular.system.dao.RegionMapper; |
| | | import com.stylefeng.guns.modular.system.dao.SystemPriceMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.model.CarService; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.OrderPosition; |
| | | import com.stylefeng.guns.modular.system.model.Region; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IOrderPositionService; |
| | | import com.stylefeng.guns.modular.system.service.ISystemNoticeService; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | |
| | | @Autowired |
| | | private GeodesyUtil geodesyUtil; |
| | | |
| | | @Autowired |
| | | private IOrderAdditionalFeeService orderAdditionalFeeService; |
| | | |
| | | @Autowired |
| | | private IAdditionalFeeService additionalFeeService; |
| | | |
| | | @Autowired |
| | | private ICompanyService companyService; |
| | | @Resource |
| | | private CarServiceMapper carServiceMapper; |
| | | |
| | | @Value("${pushMinistryOfTransport}") |
| | | private boolean pushMinistryOfTransport; |
| | |
| | | orderPrivateCar.setTrackId(track); |
| | | |
| | | //调用移动的小号接口 |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | 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(), Integer.valueOf(region.getCitycode().substring(1))); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderPrivateCar.setTelX(map.get("telX")); |
| | | orderPrivateCar.setBindId(map.get("bindId")); |
| | | } |
| | | |
| | | //智慧屏订单 |
| | | if(orderPrivateCar.getOrderSource() == 6){ |
| | | CarService query = carServiceMapper.query(1, driver.getCarId()); |
| | | orderPrivateCar.setServerCarModelId(query.getServerCarModelId()); |
| | | } |
| | | this.updateById(orderPrivateCar); |
| | | |
| | | //处理摆渡车的情况 |
| | |
| | | .eq("userId", orderPrivateCar.getUserId()) |
| | | .ne("state", 1) |
| | | .eq("crossCityOrderId", orderPrivateCar.getCrossCityOrderId()) |
| | | .eq("place", orderPrivateCar.getPlace()).ne("id", orderPrivateCar.getId()) |
| | | .eq("place", orderPrivateCar.getPlace()) |
| | | ); |
| | | List<OrderTaxi> list1 = orderTaxiService.selectList( |
| | | new EntityWrapper<OrderTaxi>() |
| | |
| | | } |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(2, "您已成功抢得快车订单,请及时联系客户!", orderPrivateCar.getDriverId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getName().substring(0, 1) + "师傅,请保持电话畅通!", orderPrivateCar.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(2, "您已成功抢得专车订单,请及时联系客户!", orderPrivateCar.getDriverId()); |
| | | systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getName().substring(0, 1) + "师傅,请保持电话畅通!", orderPrivateCar.getUserId()); |
| | | |
| | | new Thread(new Runnable() { |
| | | @Override |
| | |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | /** |
| | | * 获取订单详情页(服务中的页面) |
| | |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryOrderInfo(Integer orderId) throws Exception { |
| | | List<Map<String, Object>> orders = new ArrayList<>(); |
| | | |
| | | OrderPrivateCar orderPrivateCar = this.baseMapper.selectById(orderId); |
| | | if(orderPrivateCar.getPid()==null){ |
| | | List<Map<String, Object>> order = this.baseMapper.queryOrderInfo(orderId,4,null,null); |
| | | if(order!=null){ |
| | | orders.addAll(order); |
| | | } |
| | | String value = redisUtil.getValue("DRIVER" + String.valueOf(orderPrivateCar.getDriverId())); |
| | | order = this.baseMapper.queryOrderInfo(orderId,5,value.split(",")[0],value.split(",")[1]); |
| | | if(order!=null){ |
| | | orders.addAll(order); |
| | | } |
| | | |
| | | order = this.baseMapper.queryOrderInfo(orderId,6,null,null); |
| | | if(order!=null){ |
| | | orders.addAll(order); |
| | | } |
| | | }else{ |
| | | List<Map<String, Object>> order = this.baseMapper.queryOrderInfo(orderPrivateCar.getPid(),4,null,null); |
| | | if(order!=null){ |
| | | orders.addAll(order); |
| | | } |
| | | String value = redisUtil.getValue("DRIVER" + String.valueOf(orderPrivateCar.getDriverId())); |
| | | order = this.baseMapper.queryOrderInfo(orderPrivateCar.getPid(),5,value.split(",")[0],value.split(",")[1]); |
| | | if(order!=null){ |
| | | orders.addAll(order); |
| | | } |
| | | |
| | | order = this.baseMapper.queryOrderInfo(orderPrivateCar.getPid(),6,null,null); |
| | | if(order!=null){ |
| | | orders.addAll(order); |
| | | } |
| | | } |
| | | |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("line", ""); |
| | | map.put("peopleNumber", 0); |
| | | map.put("orderNumber",""); |
| | | map.put("totalMoney", 0d); |
| | | map.put("serverMoney", 0d); |
| | | map.put("emergencyCall", "110"); |
| | | map.put("orders", JSON.toJSONString(orders)); |
| | | return map; |
| | | //return orderPrivateCarMapper.queryOrderInfo(orderId); |
| | | return orderPrivateCarMapper.queryOrderInfo(orderId); |
| | | } |
| | | |
| | | @Override |
| | | public Map<String, Object> queryOrderInfo2(Integer orderId) throws Exception { |
| | | /*List<Map<String, Object>> orders = new ArrayList<>(); |
| | | |
| | | List<Map<String, Object>> order = this.baseMapper.queryOrderInfo(orderId,4,null,null); |
| | | if(order!=null){ |
| | | orders.addAll(order); |
| | | } |
| | | OrderPrivateCar orderPrivateCar = this.baseMapper.selectById(orderId); |
| | | String value = redisUtil.getValue("DRIVER" + String.valueOf(orderPrivateCar.getDriverId())); |
| | | order = this.baseMapper.queryOrderInfo(orderId,5,value.split(",")[0],value.split(",")[1]); |
| | | if(order!=null){ |
| | | orders.addAll(order); |
| | | } |
| | | |
| | | order = this.baseMapper.queryOrderInfo(orderId,6,null,null); |
| | | if(order!=null){ |
| | | orders.addAll(order); |
| | | } |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("line", ""); |
| | | map.put("peopleNumber", 0); |
| | | map.put("orderNumber",""); |
| | | map.put("totalMoney", 0d); |
| | | map.put("serverMoney", 0d); |
| | | map.put("emergencyCall", "110"); |
| | | map.put("orders", JSON.toJSONString(orders)); |
| | | return map;*/ |
| | | Map<String,Object> map = orderPrivateCarMapper.queryOrderInfo2(orderId); |
| | | OrderPrivateCar orderPrivateCar = this.baseMapper.selectById(orderId); |
| | | Integer canOperation=1; |
| | | if(orderPrivateCar.getState()<5){ |
| | | if(orderPrivateCar.getPid()==null) { |
| | | List<Map<String, Object>> order = this.baseMapper.queryOrderInfo(orderId, 4, null, null); |
| | | if (order != null && order.size()>0) { |
| | | if(!order.get(0).get("orderId").equals(orderId)){ |
| | | canOperation=0; |
| | | } |
| | | } |
| | | }else { |
| | | List<Map<String, Object>> order = this.baseMapper.queryOrderInfo(orderPrivateCar.getPid(),4,null,null); |
| | | if(order!=null && order.size()>0){ |
| | | if(!order.get(0).get("orderId").equals(orderId)){ |
| | | canOperation=0; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | map.put("canOperation",canOperation); |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | * 走订单流程操作 |
| | |
| | | @Override |
| | | public ResultUtil process(Integer orderId, Integer state, Double lon, Double lat, String address) throws Exception { |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | Integer canOperation=1; |
| | | if(state<5){ |
| | | if(orderPrivateCar.getPid()==null) { |
| | | List<Map<String, Object>> order = this.baseMapper.queryOrderInfo(orderId, 4, null, null); |
| | | if (order != null && order.size()>0) { |
| | | if(!order.get(0).get("orderId").equals(orderId)){ |
| | | canOperation=0; |
| | | } |
| | | } |
| | | }else { |
| | | List<Map<String, Object>> order = this.baseMapper.queryOrderInfo(orderPrivateCar.getPid(),4,null,null); |
| | | if(order!=null && order.size()>0){ |
| | | if(!order.get(0).get("orderId").equals(orderId)){ |
| | | canOperation=0; |
| | | } |
| | | } |
| | | } |
| | | if(canOperation==0){ |
| | | return ResultUtil.error("当前订单不能操作"); |
| | | } |
| | | } |
| | | switch (state){ |
| | | case 3://出发前往预约点 |
| | | orderPrivateCar.setState(3); |
| | | orderPrivateCar.setSetOutTime(new Date()); |
| | | systemNoticeService.addSystemNotice(1, "司机已出发,请耐心等待", orderPrivateCar.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "司机已出发,请耐心等待", orderPrivateCar.getUserId()); |
| | | break; |
| | | case 4://到达预约点,等待客户上车 |
| | | orderPrivateCar.setState(4); |
| | | orderPrivateCar.setArriveTime(new Date()); |
| | | systemNoticeService.addSystemNotice(1, "司机已到达您设置的预约地点,请及时上车", orderPrivateCar.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "司机已到达您设置的预约地点,请及时上车", orderPrivateCar.getUserId()); |
| | | break; |
| | | case 5://开始服务 |
| | | orderPrivateCar.setBoardingLon(lon); |
| | |
| | | orderPrivateCar.setStartServiceTime(new Date()); |
| | | |
| | | pushUtil.pushDriverPosition(orderPrivateCar.getId(), 1);//主动推送司机定位 |
| | | |
| | | break; |
| | | case 6://结束服务(专车可以返回继续服务)不修改状态 |
| | | orderPrivateCar.setGetoffLon(lon); |
| | |
| | | pushUtil.pushOrderState(2, finalOrderPrivateCar.getDriverId(), finalOrderPrivateCar.getId(), 1, finalOrderPrivateCar.getState()); |
| | | if(finalOrderPrivateCar.getState() == 5 && pushMinistryOfTransport){//上传数据 |
| | | pushMinistryOfTransportUtil.operateDepart(orderId); |
| | | } |
| | | if(finalOrderPrivateCar.getState()==5 || finalOrderPrivateCar.getState()==6){ |
| | | if(finalOrderPrivateCar.getSpellSuccess()==1){ |
| | | if(finalOrderPrivateCar.getPid()==null){ |
| | | List<OrderPrivateCar> orderList1 = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().eq("pid",finalOrderPrivateCar.getId())); |
| | | for(OrderPrivateCar orderPrivateCar3:orderList1){ |
| | | pushUtil.pushOrderState(1, orderPrivateCar3.getUserId(), orderPrivateCar3.getId(), 1, 13); |
| | | } |
| | | }else{ |
| | | List<OrderPrivateCar> orderList1 = orderPrivateCarMapper.selectList(new EntityWrapper<OrderPrivateCar>().eq("pid",finalOrderPrivateCar.getPid())); |
| | | for(OrderPrivateCar orderPrivateCar3:orderList1){ |
| | | pushUtil.pushOrderState(1, orderPrivateCar3.getUserId(), orderPrivateCar3.getId(), 1, 13); |
| | | } |
| | | OrderPrivateCar orderPrivateCar3 = orderPrivateCarMapper.selectById(finalOrderPrivateCar.getPid()); |
| | | pushUtil.pushOrderState(1, orderPrivateCar3.getUserId(), orderPrivateCar3.getId(), 1, 13); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }).start(); |
| | |
| | | this.updateById(orderPrivateCar); |
| | | |
| | | pushUtil.removeTask(orderId, 1);//删除定时任务,结束推送数据 |
| | | systemNoticeService.addSystemNotice(1, "司机已结束本次行程,谢谢使用", orderPrivateCar.getUserId(), 1); |
| | | |
| | | //回滚司机状态为空闲 |
| | | if(orderPrivateCar.getSpellSuccess()==0){ |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setState(2); |
| | | driverService.updateById(driver); |
| | | }else{ |
| | | if(orderPrivateCar.getPid()==null){ |
| | | Integer number = this.selectCount(new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar.getPid()==null?orderPrivateCar.getId():orderPrivateCar.getPid()).lt("state",6)); |
| | | if(number<=0){ |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setState(2); |
| | | driverService.updateById(driver); |
| | | } |
| | | }else{ |
| | | Integer number = this.selectCount(new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar.getPid()==null?orderPrivateCar.getId():orderPrivateCar.getPid()).lt("state",6)); |
| | | Integer number1 = this.selectCount(new EntityWrapper<OrderPrivateCar>().eq("id",orderPrivateCar.getPid()).lt("state",6)); |
| | | if(number<=0 && number1<=0){ |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setState(2); |
| | | driverService.updateById(driver); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //修改总订单人数 |
| | | OrderPrivateCar orderPrivateCar2 = new OrderPrivateCar(); |
| | | orderPrivateCar2.setTotalPeopleNum(orderPrivateCar.getTotalPeopleNum()-orderPrivateCar.getPeopleNum()); |
| | | this.update(orderPrivateCar2,new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar.getPid()==null?orderPrivateCar.getId():orderPrivateCar.getPid()).lt("state",6)); |
| | | this.update(orderPrivateCar2,new EntityWrapper<OrderPrivateCar>().eq("id",orderPrivateCar.getPid()==null?orderPrivateCar.getId():orderPrivateCar.getPid()).lt("state",6)); |
| | | // |
| | | OrderPrivateCar finalOrderTaxi = orderPrivateCar; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 1, finalOrderTaxi.getState()); |
| | | pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 1, finalOrderTaxi.getState()); |
| | | } |
| | | }).start(); |
| | | if(orderPrivateCar.getSpellSuccess()==1){ |
| | | List<OrderPrivateCar> orderList1 = this.selectList(new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar.getPid())); |
| | | for(OrderPrivateCar orderPrivateCar3:orderList1){ |
| | | pushUtil.pushOrderState(1, orderPrivateCar3.getUserId(), orderPrivateCar3.getId(), 1, 13); |
| | | } |
| | | OrderPrivateCar orderPrivateCar3 = this.selectById(orderPrivateCar.getPid()); |
| | | pushUtil.pushOrderState(1, orderPrivateCar3.getUserId(), orderPrivateCar3.getId(), 1, 13); |
| | | } |
| | | OrderPrivateCar finalOrderPrivateCar = orderPrivateCar; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | if(pushMinistryOfTransport){//上传交通数据 |
| | | pushMinistryOfTransportUtil.baseInfoVehicleTotalMile(finalOrderPrivateCar.getCarId()); |
| | | pushMinistryOfTransportUtil.operateArrive(orderId); |
| | | } |
| | | } |
| | | }).start(); |
| | | |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | @Override |
| | | public ResultUtil cancleOrder(Integer orderId) throws Exception { |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | orderPrivateCar.setState(10); |
| | | orderPrivateCar.setDriverCancle(1); |
| | | this.updateById(orderPrivateCar); |
| | | |
| | | pushUtil.removeTask(orderId, 1);//删除定时任务,结束推送数据 |
| | | systemNoticeService.addSystemNotice(1, "司机已结束本次行程,谢谢使用", orderPrivateCar.getUserId(), 1); |
| | | |
| | | //回滚司机状态为空闲 |
| | | if(orderPrivateCar.getSpellSuccess()==0){ |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setState(2); |
| | | driverService.updateById(driver); |
| | | }else{ |
| | | if(orderPrivateCar.getPid()==null){ |
| | | Integer number = this.selectCount(new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar.getPid()==null?orderPrivateCar.getId():orderPrivateCar.getPid()).lt("state",6)); |
| | | if(number<=0){ |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setState(2); |
| | | driverService.updateById(driver); |
| | | } |
| | | }else{ |
| | | Integer number = this.selectCount(new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar.getPid()==null?orderPrivateCar.getId():orderPrivateCar.getPid()).lt("state",6)); |
| | | Integer number1 = this.selectCount(new EntityWrapper<OrderPrivateCar>().eq("id",orderPrivateCar.getPid()).lt("state",6)); |
| | | if(number<=0 && number1<=0){ |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | driver.setState(2); |
| | | driverService.updateById(driver); |
| | | } |
| | | } |
| | | } |
| | | |
| | | Integer number1 = this.selectCount(new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar.getPid()==null?orderPrivateCar.getId():orderPrivateCar.getPid()).lt("state",6)); |
| | | Integer number2 = this.selectCount(new EntityWrapper<OrderPrivateCar>().eq("id",orderPrivateCar.getPid()==null?orderPrivateCar.getId():orderPrivateCar.getPid()).lt("state",6)); |
| | | if(number1+number2==1){ |
| | | OrderPrivateCar orderPrivateCar2 = new OrderPrivateCar(); |
| | | orderPrivateCar2.setTotalPeopleNum(orderPrivateCar.getTotalPeopleNum()-orderPrivateCar.getPeopleNum()); |
| | | orderPrivateCar2.setSpellSuccess(0); |
| | | this.update(orderPrivateCar2,new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar.getPid()==null?orderPrivateCar.getId():orderPrivateCar.getPid()).lt("state",6)); |
| | | this.update(orderPrivateCar2,new EntityWrapper<OrderPrivateCar>().eq("id",orderPrivateCar.getPid()==null?orderPrivateCar.getId():orderPrivateCar.getPid()).lt("state",6)); |
| | | |
| | | }else{ |
| | | OrderPrivateCar orderPrivateCar2 = new OrderPrivateCar(); |
| | | orderPrivateCar2.setTotalPeopleNum(orderPrivateCar.getTotalPeopleNum()-orderPrivateCar.getPeopleNum()); |
| | | this.update(orderPrivateCar2,new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar.getPid()==null?orderPrivateCar.getId():orderPrivateCar.getPid()).lt("state",6)); |
| | | this.update(orderPrivateCar2,new EntityWrapper<OrderPrivateCar>().eq("id",orderPrivateCar.getPid()==null?orderPrivateCar.getId():orderPrivateCar.getPid()).lt("state",6)); |
| | | } |
| | | OrderPrivateCar finalOrderTaxi = orderPrivateCar; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 1, finalOrderTaxi.getState()); |
| | | //pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 1, finalOrderTaxi.getState()); |
| | | } |
| | | }).start(); |
| | | if(orderPrivateCar.getSpellSuccess()==1){ |
| | | if(orderPrivateCar.getPid()==null){ |
| | | List<OrderPrivateCar> orderList1 = this.selectList(new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar.getId())); |
| | | for(OrderPrivateCar orderPrivateCar3:orderList1){ |
| | | pushUtil.pushOrderState(1, orderPrivateCar3.getUserId(), orderPrivateCar3.getId(), 1, 13); |
| | | } |
| | | // pushUtil.pushOrderState(1, orderPrivateCar.getUserId(), orderPrivateCar.getId(), 1, 13); |
| | | }else{ |
| | | List<OrderPrivateCar> orderList1 = this.selectList(new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar.getPid())); |
| | | for(OrderPrivateCar orderPrivateCar3:orderList1){ |
| | | pushUtil.pushOrderState(1, orderPrivateCar3.getUserId(), orderPrivateCar3.getId(), 1, 13); |
| | | } |
| | | OrderPrivateCar orderPrivateCar3 = this.selectById(orderPrivateCar.getPid()); |
| | | pushUtil.pushOrderState(1, orderPrivateCar3.getUserId(), orderPrivateCar3.getId(), 1, 13); |
| | | } |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public ResultUtil updatePeopleNum(Integer orderId, Integer peopleNum) throws Exception { |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | orderPrivateCar.setPeopleNum(peopleNum); |
| | | if(peopleNum==4){ |
| | | orderPrivateCar.setRideType(1); |
| | | } |
| | | this.updateById(orderPrivateCar); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | @Override |
| | | public ResultUtil confirmFees1(Integer orderId, Integer type, String additionalFee) throws Exception { |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | orderPrivateCar = this.setMoney(orderPrivateCar, 0D, 0D);//计算费用 |
| | | orderPrivateCar.setPayManner(type); |
| | | orderPrivateCar.setParkMoney(0D); |
| | | orderPrivateCar.setRoadTollMoney(0D); |
| | | Company company = companyService.selectById(orderPrivateCar.getCompanyId()); |
| | | orderPrivateCar.setHolidayFee(null == company.getHolidayFee() ? 0D : company.getHolidayFee()); |
| | | |
| | | Double t = 0D; |
| | | if(ToolUtil.isNotEmpty(additionalFee)){//附加费 |
| | | JSONArray jsonArray = JSON.parseArray(additionalFee); |
| | | for(int i = 0; i < jsonArray.size(); i++){ |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | Integer id = jsonObject.getInteger("id"); |
| | | Double amount = jsonObject.getDouble("amount"); |
| | | OrderAdditionalFee orderAdditionalFee = new OrderAdditionalFee(); |
| | | orderAdditionalFee.setOrderType(1); |
| | | orderAdditionalFee.setOrderId(orderId); |
| | | orderAdditionalFee.setAdditionalFeeId(id); |
| | | orderAdditionalFee.setAmount(amount); |
| | | orderAdditionalFeeService.insert(orderAdditionalFee); |
| | | t += amount; |
| | | } |
| | | } |
| | | orderPrivateCar.setOrderMoney(orderPrivateCar.getOrderMoney() + orderPrivateCar.getParkMoney() + orderPrivateCar.getRoadTollMoney() + orderPrivateCar.getHolidayFee() + t); |
| | | orderPrivateCar.setState(7); |
| | | this.updateById(orderPrivateCar); |
| | | |
| | | pushUtil.removeTask(orderId, 1);//删除定时任务,结束推送数据 |
| | | systemNoticeService.addSystemNotice(1, "司机已结束本次行程,谢谢使用", orderPrivateCar.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "司机已结束本次行程,谢谢使用", orderPrivateCar.getUserId()); |
| | | |
| | | //回滚司机状态为空闲 |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取订单费用明细 |
| | | * @param orderId |
| | |
| | | public Map<String, Object> queryMoneyInfo(Integer orderId) throws Exception { |
| | | OrderPrivateCar orderPrivateCar = this.selectById(orderId); |
| | | if(orderPrivateCar.getState() == 5){//服务中的时候获取实时费用数据 |
| | | orderPrivateCar=this.setMoney(orderPrivateCar, 0D, 0D); |
| | | this.setMoney(orderPrivateCar, 0D, 0D); |
| | | } |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | |
| | | map.put("couponMoney", orderPrivateCar.getCouponMoney());//优惠券抵扣金额 |
| | | map.put("discountMoney", orderPrivateCar.getDiscountMoney());//折扣抵扣金额 |
| | | map.put("discount", orderPrivateCar.getDiscount());//折扣 |
| | | map.put("holidayFee", orderPrivateCar.getHolidayFee());//节假日费 |
| | | |
| | | List<OrderAdditionalFee> orderAdditionalFees = orderAdditionalFeeService.selectList(new EntityWrapper<OrderAdditionalFee>().eq("orderType", 1).eq("orderId", orderId)); |
| | | List<Map<String, Object>> list = new ArrayList<>(); |
| | | orderAdditionalFees.forEach(orderAdditionalFee -> { |
| | | AdditionalFee additionalFee = additionalFeeService.selectById(orderAdditionalFee.getAdditionalFeeId()); |
| | | Map<String, Object> map1 = new HashMap<>(); |
| | | map1.put("name", additionalFee.getName()); |
| | | map1.put("amount", orderAdditionalFee.getAmount()); |
| | | list.add(map1); |
| | | }); |
| | | map.put("additionalFee", list); |
| | | return map; |
| | | } |
| | | |
| | |
| | | return orderPrivateCarMapper.queryMaturity(); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<OrderPrivateCar> taskMidAxbUnBindSend() throws Exception { |
| | | return this.baseMapper.taskMidAxbUnBindSend(); |
| | | } |
| | | |
| | | /** |
| | | * 计算价格 |
| | | * @param orderPrivateCar |
| | |
| | | * @throws Exception |
| | | */ |
| | | public OrderPrivateCar setMoney(OrderPrivateCar orderPrivateCar, Double parkingFee, Double crossingFee) throws Exception { |
| | | |
| | | Map<String, Object> query1 = systemPriceMapper.query(orderPrivateCar.getCompanyId(), 1, orderPrivateCar.getServerCarModelId()); |
| | | //开始根据不同的方式计算金额 |
| | | double amount = 0; |
| | | JSONObject jsonObject = JSON.parseObject(query1.get("content").toString()); |
| | | Double num1 = jsonObject.getDouble("num1");//起步价(元) |
| | | Double num2 = jsonObject.getDouble("num2");//起步公里(公里) |
| | | Double num3 = jsonObject.getDouble("num3");//起步时间(分钟) |
| | | Double num4 = jsonObject.getDouble("num4");//里程费(元) |
| | | Double num5 = jsonObject.getDouble("num5");//时长费(分钟) |
| | | Double num6 = jsonObject.getDouble("num6");//等待费(分钟) |
| | | Double num7 = jsonObject.getDouble("num7");//等待费(元) |
| | | Double num8 = jsonObject.getDouble("num8");//远途费(公里) |
| | | Double num9 = jsonObject.getDouble("num9");//远途费(公里) |
| | | Double num10 = jsonObject.getDouble("num10");//远途费(元) |
| | | Double num11 = jsonObject.getDouble("num11");//远途费(公里) |
| | | Double num12 = jsonObject.getDouble("num12");//远途费(公里) |
| | | Double num13 = jsonObject.getDouble("num13");//远途费(元) |
| | | Double num14 = jsonObject.getDouble("num14");//远途费(公里) |
| | | Double num15 = jsonObject.getDouble("num15");//远途费(元) |
| | | String num16 = jsonObject.getString("num16");//夜间费(开始时间) |
| | | Double num17 = jsonObject.getDouble("num17");//夜间费(元) |
| | | Double num18 = jsonObject.getDouble("num18");//夜间费(元) |
| | | Double num19 = jsonObject.getDouble("num19");//夜间费(元) |
| | | Double num20 = jsonObject.getDouble("num20");//夜间费(元) |
| | | Double num21 = jsonObject.getDouble("num21");//夜间费(元) |
| | | Double num22 = jsonObject.getDouble("num22");//夜间费(元) |
| | | String num23 = jsonObject.getString("num23");//高峰费(开始时间) |
| | | String num24 = jsonObject.getString("num24");//高峰费(开始时间) |
| | | Double num25 = jsonObject.getDouble("num25");//高峰费(元) |
| | | Double num26 = jsonObject.getDouble("num26");//高峰费(元) |
| | | Double num27 = jsonObject.getDouble("num27");//高峰费(元) |
| | | Double num28 = jsonObject.getDouble("num28");//高峰费(元) |
| | | Double num29 = jsonObject.getDouble("num29");//高峰费(元) |
| | | Double num30 = jsonObject.getDouble("num30");//高峰费(元) |
| | | |
| | | JSONObject contentPutOne = JSON.parseObject(query1.get("contentPutOne").toString());//一人拼成 |
| | | JSONObject contentNotOne = JSON.parseObject(query1.get("contentNotOne").toString());//一人未拼成 |
| | | JSONObject contentPutTwo = JSON.parseObject(query1.get("contentPutTwo").toString());//2人拼成 |
| | | JSONObject contentNotTwo = JSON.parseObject(query1.get("contentNotTwo").toString());//2人未拼成 |
| | | JSONObject contentPutThree = JSON.parseObject(query1.get("contentPutThree").toString());//3人拼成 |
| | | JSONObject contentNotThree = JSON.parseObject(query1.get("contentNotThree").toString());//3人未拼成 |
| | | JSONObject contentExclusive = JSON.parseObject(query1.get("contentExclusive").toString());//独享 |
| | | JSONObject contentPrice = JSON.parseObject(query1.get("contentPrice").toString());//一口价 |
| | | //乘车类型(1=独享,2=一口价,3=拼车) |
| | | orderPrivateCar.setWaitRule(jsonObject.toJSONString()); |
| | | if(orderPrivateCar.getRideType()==1){ |
| | | orderPrivateCar = calculationPrice(orderPrivateCar,contentExclusive,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | }else if(orderPrivateCar.getRideType()==2){ |
| | | double d = (null == orderPrivateCar.getMileage() ? 0D : orderPrivateCar.getMileage()); |
| | | double estimateMileage = (null == orderPrivateCar.getEstimateMileage() ? 0D : orderPrivateCar.getEstimateMileage()); |
| | | //在价格区间按照一口价算,不在区间按实时价格算 |
| | | if(d<estimateMileage+contentPrice.getDouble("num29")*1000 && d>estimateMileage-contentPrice.getDouble("num32")*1000){ |
| | | orderPrivateCar = calculationPrice1(orderPrivateCar,contentPrice,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | }else{ |
| | | orderPrivateCar = calculationPrice(orderPrivateCar,contentExclusive,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | } |
| | | }else{ |
| | | //判断是否是拼单 |
| | | if(orderPrivateCar.getSpellSuccess()==0){ |
| | | if(orderPrivateCar.getPeopleNum()==1){ |
| | | orderPrivateCar = calculationPrice(orderPrivateCar,contentNotOne,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | orderPrivateCar.setChargeRules(contentPutOne.toJSONString()); |
| | | }else if(orderPrivateCar.getPeopleNum()==2){ |
| | | orderPrivateCar = calculationPrice(orderPrivateCar,contentNotTwo,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | orderPrivateCar.setChargeRules(contentPutTwo.toJSONString()); |
| | | }else{ |
| | | orderPrivateCar = calculationPrice(orderPrivateCar,contentNotThree,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | orderPrivateCar.setChargeRules(contentPutThree.toJSONString()); |
| | | } |
| | | }else{ |
| | | if(orderPrivateCar.getPeopleNum()==1){ |
| | | orderPrivateCar = calculationPrice(orderPrivateCar,contentPutOne,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | orderPrivateCar.setChargeRules(contentNotOne.toJSONString()); |
| | | }else if(orderPrivateCar.getPeopleNum()==2){ |
| | | orderPrivateCar = calculationPrice(orderPrivateCar,contentPutTwo,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | orderPrivateCar.setChargeRules(contentNotTwo.toJSONString()); |
| | | }else{ |
| | | orderPrivateCar = calculationPrice(orderPrivateCar,contentPutThree,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | orderPrivateCar.setChargeRules(contentNotThree.toJSONString()); |
| | | } |
| | | } |
| | | /*if(orderPrivateCar.getPid()==null){ |
| | | Integer number = orderPrivateCarMapper.selectCount(new EntityWrapper<OrderPrivateCar>().eq("pid",orderPrivateCar.getId()).ne("state",10).ne("state",12)); |
| | | if(number<=0){ |
| | | if(orderPrivateCar.getPeopleNum()==1){ |
| | | orderPrivateCar = calculationPrice(orderPrivateCar,contentNotOne,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | }else if(orderPrivateCar.getPeopleNum()==2){ |
| | | orderPrivateCar = calculationPrice(orderPrivateCar,contentNotTwo,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | }else{ |
| | | orderPrivateCar = calculationPrice(orderPrivateCar,contentNotThree,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | } |
| | | }else{ |
| | | if(orderPrivateCar.getPeopleNum()==1){ |
| | | orderPrivateCar = calculationPrice(orderPrivateCar,contentPutOne,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | }else if(orderPrivateCar.getPeopleNum()==2){ |
| | | orderPrivateCar = calculationPrice(orderPrivateCar,contentPutTwo,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | }else{ |
| | | orderPrivateCar = calculationPrice(orderPrivateCar,contentPutThree,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | } |
| | | } |
| | | }else{ |
| | | if(orderPrivateCar.getPeopleNum()==1){ |
| | | orderPrivateCar = calculationPrice(orderPrivateCar,contentPutOne,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | }else if(orderPrivateCar.getPeopleNum()==2){ |
| | | orderPrivateCar = calculationPrice(orderPrivateCar,contentPutTwo,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | }else{ |
| | | orderPrivateCar = calculationPrice(orderPrivateCar,contentPutThree,jsonObject.getLongValue("num1"),jsonObject.getDouble("num2"),parkingFee,crossingFee); |
| | | } |
| | | }*/ |
| | | } |
| | | return orderPrivateCar; |
| | | } |
| | | |
| | | public OrderPrivateCar calculationPrice(OrderPrivateCar orderPrivateCar,JSONObject rule, long wait,Double waitMoney, Double parkingFee, Double crossingFee) throws Exception { |
| | | orderPrivateCar.setChargeRule(rule.toJSONString()); |
| | | double amount = 0; |
| | | //等待费 |
| | | Date date = new Date(); |
| | | if(orderPrivateCar.getEndServiceTime()==null)orderPrivateCar.setEndServiceTime(date); |
| | | double d = (null == orderPrivateCar.getMileage() ? 0D : orderPrivateCar.getMileage()) / 1000;//实际公里 |
| | | double t = ((orderPrivateCar.getEndServiceTime().getTime() - orderPrivateCar.getStartServiceTime().getTime()) / 60000) + 1;//实际时间(不满一分钟按一分钟算) |
| | | double d1 = (d - rule.getDouble("num2")) < 0 ? 0 : d - rule.getDouble("num2");//超出起步里程的公里 |
| | | double t1 = (t - rule.getDouble("num3")) < 0 ? 0 : t - rule.getDouble("num3");//超过起步分钟数的时间 |
| | | double w = ((orderPrivateCar.getStartServiceTime().getTime() - orderPrivateCar.getArriveTime().getTime()) / 60000) + 1;//等待分钟(不满一分钟按一分钟算) |
| | | double w1 = (w - wait) < 0 ? 0 : new BigDecimal(w - wait).setScale(0, BigDecimal.ROUND_UP).doubleValue();//超出等待时间的时间 |
| | | double d1 = (d - num2) < 0 ? 0 : d - num2;//超出起步里程的公里 |
| | | double t1 = (t - num3) < 0 ? 0 : new BigDecimal(t - num3).setScale(0, BigDecimal.ROUND_UP).doubleValue();//超过起步分钟数的时间 |
| | | double w1 = (w - num6) < 0 ? 0 : new BigDecimal(w - num6).setScale(0, BigDecimal.ROUND_UP).doubleValue();//超出等待时间的时间 |
| | | double yt1 = 0;//远途1段 |
| | | double yt2 = 0;//远途2段 |
| | | double yt3 = 0;//远途3段 |
| | |
| | | //夜间服务处理逻辑 |
| | | Calendar s = Calendar.getInstance(); |
| | | s.setTime(date); |
| | | s.set(Calendar.HOUR_OF_DAY, Integer.valueOf(rule.getString("num14").split(" - ")[0].split(":")[0])); |
| | | s.set(Calendar.MINUTE, Integer.valueOf(rule.getString("num14").split(" - ")[0].split(":")[1])); |
| | | s.set(Calendar.HOUR_OF_DAY, Integer.valueOf(num16.split(" - ")[0].split(":")[0])); |
| | | s.set(Calendar.MINUTE, Integer.valueOf(num16.split(" - ")[0].split(":")[1])); |
| | | |
| | | Calendar e = Calendar.getInstance(); |
| | | e.setTime(date); |
| | | e.set(Calendar.HOUR_OF_DAY, Integer.valueOf(rule.getString("num14").split(" - ")[1].split(":")[0])); |
| | | e.set(Calendar.MINUTE, Integer.valueOf(rule.getString("num14").split(" - ")[1].split(":")[1])); |
| | | e.set(Calendar.HOUR_OF_DAY, Integer.valueOf(num16.split(" - ")[1].split(":")[0])); |
| | | e.set(Calendar.MINUTE, Integer.valueOf(num16.split(" - ")[1].split(":")[1])); |
| | | |
| | | if(date.getTime() > s.getTimeInMillis() && date.getTime() < e.getTimeInMillis()){ |
| | | if(d > rule.getDouble("num6")){ |
| | | yt1 = rule.getDouble("num18") * (rule.getDouble("num7") - rule.getDouble("num6")); |
| | | if(d > num8.doubleValue() && d <= num9.doubleValue()){ |
| | | yt1 = num20 * (d - num8); |
| | | } |
| | | if(d > rule.getDouble("num9")){ |
| | | yt2 = rule.getDouble("num19") * (rule.getDouble("num10") - rule.getDouble("num9")); |
| | | if(d > num9.doubleValue()){ |
| | | yt1 = num20 * (num9 - num8); |
| | | } |
| | | if(d > rule.getDouble("num12")){ |
| | | yt3 = rule.getDouble("num20") * (d - rule.getDouble("num12")); |
| | | if(d > num11.doubleValue() && d <= num12.doubleValue()){ |
| | | yt2 = num21 * (d - num11); |
| | | } |
| | | amount = rule.getDouble("num15") + (d1 * rule.getDouble("num16")) + (t1 * rule.getDouble("num17")) + (w1 * waitMoney) + yt1 + yt2 + yt3; |
| | | orderPrivateCar.setStartMileage(rule.getDouble("num2")); |
| | | orderPrivateCar.setStartMoney(rule.getDouble("num15"));//起步价 |
| | | if(d > num12.doubleValue()){ |
| | | yt2 = num21 * (num12 - num11); |
| | | } |
| | | if(d > num14.doubleValue()){ |
| | | yt3 = num22 * (d - num14); |
| | | } |
| | | amount = num17 + (d1 * num18) + (t1 * num19) + (w1 * num7) + yt1 + yt2 + yt3; |
| | | orderPrivateCar.setStartMileage(num2); |
| | | orderPrivateCar.setStartMoney(num17);//起步价 |
| | | orderPrivateCar.setMileageKilometers(new BigDecimal(d1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setMileageMoney(new BigDecimal(d1 * rule.getDouble("num16")).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//里程费 |
| | | orderPrivateCar.setMileageMoney(new BigDecimal(d1 * num18).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//里程费 |
| | | orderPrivateCar.setDuration(new BigDecimal(t1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setDurationMoney(new BigDecimal(t1 * rule.getDouble("num17")).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//时长费 |
| | | orderPrivateCar.setDurationMoney(new BigDecimal(t1 * num19).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//时长费 |
| | | orderPrivateCar.setWait(new BigDecimal(w1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setWaitMoney(new BigDecimal(w1 * waitMoney).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//等待费 |
| | | orderPrivateCar.setLongDistance(new BigDecimal((d > rule.getDouble("num6")) ? d - rule.getDouble("num6") : 0).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setWaitMoney(new BigDecimal(w1 * num7).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//等待费 |
| | | orderPrivateCar.setLongDistance(new BigDecimal((d > num8) ? d - num8 : 0).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setLongDistanceMoney(new BigDecimal(yt1 + yt2 + yt3).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//远途费 |
| | | orderPrivateCar.setParkMoney(parkingFee);//停车费 |
| | | orderPrivateCar.setRoadTollMoney(crossingFee);//过路费 |
| | |
| | | orderPrivateCar.setDiscount(0D);//优惠抵扣 |
| | | orderPrivateCar.setPayMoney(0D);//支付金额 |
| | | orderPrivateCar.setOrderMoney(new BigDecimal(amount + parkingFee + crossingFee).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | }else{ |
| | | Calendar s1 = Calendar.getInstance(); |
| | | s1.setTime(date); |
| | | s1.set(Calendar.HOUR_OF_DAY, Integer.valueOf(rule.getString("num21").split(" - ")[0].split(":")[0])); |
| | | s1.set(Calendar.MINUTE, Integer.valueOf(rule.getString("num21").split(" - ")[0].split(":")[1])); |
| | | |
| | | Calendar e1 = Calendar.getInstance(); |
| | | e1.setTime(date); |
| | | e1.set(Calendar.HOUR_OF_DAY, Integer.valueOf(rule.getString("num21").split(" - ")[1].split(":")[0])); |
| | | e1.set(Calendar.MINUTE, Integer.valueOf(rule.getString("num21").split(" - ")[1].split(":")[1])); |
| | | |
| | | Calendar s2 = Calendar.getInstance(); |
| | | s2.setTime(date); |
| | | s2.set(Calendar.HOUR_OF_DAY, Integer.valueOf(rule.getString("num22").split(" - ")[0].split(":")[0])); |
| | | s2.set(Calendar.MINUTE, Integer.valueOf(rule.getString("num22").split(" - ")[0].split(":")[1])); |
| | | |
| | | Calendar e2 = Calendar.getInstance(); |
| | | e2.setTime(date); |
| | | e2.set(Calendar.HOUR_OF_DAY, Integer.valueOf(rule.getString("num22").split(" - ")[1].split(":")[0])); |
| | | e2.set(Calendar.MINUTE, Integer.valueOf(rule.getString("num22").split(" - ")[1].split(":")[1])); |
| | | //高峰时段处理逻辑 |
| | | if((date.getTime() > s1.getTimeInMillis() && date.getTime() < e1.getTimeInMillis()) || (date.getTime() > s2.getTimeInMillis() && date.getTime() < e2.getTimeInMillis())){ |
| | | if(d > rule.getDouble("num6")){ |
| | | yt1 = rule.getDouble("num26") * (rule.getDouble("num7") - rule.getDouble("num6")); |
| | | } |
| | | if(d > rule.getDouble("num9")){ |
| | | yt2 = rule.getDouble("num27") * (rule.getDouble("num10") - rule.getDouble("num9")); |
| | | } |
| | | if(d > rule.getDouble("num12")){ |
| | | yt3 = rule.getDouble("num28") * (d - rule.getDouble("num12")); |
| | | } |
| | | amount = rule.getDouble("num23") + (d1 * rule.getDouble("num24")) + (t1 * rule.getDouble("num25")) + (w1 * waitMoney) + yt1 + yt2 + yt3; |
| | | orderPrivateCar.setStartMileage(rule.getDouble("num2")); |
| | | orderPrivateCar.setStartMoney(rule.getDouble("num23"));//起步价 |
| | | orderPrivateCar.setMileageKilometers(new BigDecimal(d1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setMileageMoney(new BigDecimal(d1 * rule.getDouble("num24")).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//里程费 |
| | | orderPrivateCar.setDuration(new BigDecimal(t1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setDurationMoney(new BigDecimal(t1 * rule.getDouble("num25")).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//时长费 |
| | | orderPrivateCar.setWait(new BigDecimal(w1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setWaitMoney(new BigDecimal(w1 * waitMoney).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//等待费 |
| | | orderPrivateCar.setLongDistance(new BigDecimal((d > rule.getDouble("num6")) ? d - rule.getDouble("num6") : 0).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setLongDistanceMoney(new BigDecimal(yt1 + yt2 + yt3).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//远途费 |
| | | orderPrivateCar.setParkMoney(parkingFee);//停车费 |
| | | orderPrivateCar.setRoadTollMoney(crossingFee);//过路费 |
| | | orderPrivateCar.setRedPacketMoney(0D);//红包抵扣 |
| | | orderPrivateCar.setCouponMoney(0D);//优惠券抵扣 |
| | | orderPrivateCar.setDiscount(0D);//优惠抵扣 |
| | | orderPrivateCar.setPayMoney(0D);//支付金额 |
| | | orderPrivateCar.setOrderMoney(new BigDecimal(amount + parkingFee + crossingFee).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | }else{ |
| | | //其他时间段的计算 |
| | | if(d > rule.getDouble("num6")){ |
| | | yt1 = rule.getDouble("num8") * (rule.getDouble("num7") - rule.getDouble("num6")); |
| | | } |
| | | if(d > rule.getDouble("num9")){ |
| | | yt2 = rule.getDouble("num11") * (rule.getDouble("num10") - rule.getDouble("num9")); |
| | | } |
| | | if(d > rule.getDouble("num12")){ |
| | | yt3 = rule.getDouble("num13") * (d - rule.getDouble("num12")); |
| | | } |
| | | amount = rule.getDouble("num1") + (d1 * rule.getDouble("num4")) + (t1 * rule.getDouble("num5")) + (w1 * waitMoney) + yt1 + yt2 + yt3; |
| | | orderPrivateCar.setStartMileage(rule.getDouble("num2")); |
| | | orderPrivateCar.setStartMoney(rule.getDouble("num1"));//起步价 |
| | | orderPrivateCar.setMileageKilometers(new BigDecimal(d1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setMileageMoney(new BigDecimal(d1 * rule.getDouble("num4")).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//里程费 |
| | | orderPrivateCar.setDuration(new BigDecimal(t1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setDurationMoney(new BigDecimal(t1 * rule.getDouble("num5")).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//时长费 |
| | | orderPrivateCar.setWait(new BigDecimal(w1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setWaitMoney(new BigDecimal(w1 * waitMoney).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//等待费 |
| | | orderPrivateCar.setLongDistance(new BigDecimal((d > rule.getDouble("num6")) ? d - rule.getDouble("num6") : 0).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setLongDistanceMoney(new BigDecimal(yt1 + yt2 + yt3).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//远途费 |
| | | orderPrivateCar.setParkMoney(parkingFee);//停车费 |
| | | orderPrivateCar.setRoadTollMoney(crossingFee);//过路费 |
| | | orderPrivateCar.setRedPacketMoney(0D);//红包抵扣 |
| | | orderPrivateCar.setCouponMoney(0D);//优惠券抵扣 |
| | | orderPrivateCar.setDiscount(0D);//优惠抵扣 |
| | | orderPrivateCar.setPayMoney(0D);//支付金额 |
| | | orderPrivateCar.setOrderMoney(new BigDecimal(amount + parkingFee + crossingFee).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | } |
| | | return orderPrivateCar; |
| | | } |
| | | return orderPrivateCar; |
| | | } |
| | | |
| | | |
| | | //高峰时段处理逻辑 |
| | | Calendar s1 = Calendar.getInstance(); |
| | | s1.setTime(date); |
| | | s1.set(Calendar.HOUR_OF_DAY, Integer.valueOf(num23.split(" - ")[0].split(":")[0])); |
| | | s1.set(Calendar.MINUTE, Integer.valueOf(num23.split(" - ")[0].split(":")[1])); |
| | | |
| | | public OrderPrivateCar calculationPrice1(OrderPrivateCar orderPrivateCar,JSONObject rule, long wait,Double waitMoney, Double parkingFee, Double crossingFee) throws Exception { |
| | | double amount = 0; |
| | | //等待费 |
| | | Date date = new Date(); |
| | | double d = (null == orderPrivateCar.getEstimateMileage() ? 0D : orderPrivateCar.getEstimateMileage()) / 1000;//实际公里 |
| | | double t = orderPrivateCar.getEstimateTime();//实际时间(不满一分钟按一分钟算) |
| | | double d1 = (d - rule.getDouble("num1")) < 0 ? 0 : d - rule.getDouble("num1");//超出起步里程的公里 |
| | | double t1 = (t - rule.getDouble("num2")) < 0 ? 0 : t - rule.getDouble("num2");//超过起步分钟数的时间 |
| | | double w = ((orderPrivateCar.getStartServiceTime().getTime() - orderPrivateCar.getArriveTime().getTime()) / 60000) + 1;//等待分钟(不满一分钟按一分钟算) |
| | | double w1 = (w - wait) < 0 ? 0 : new BigDecimal(w - wait).setScale(0, BigDecimal.ROUND_UP).doubleValue();//超出等待时间的时间 |
| | | double yt1 = 0;//远途1段 |
| | | double yt2 = 0;//远途2段 |
| | | double yt3 = 0;//远途3段 |
| | | Calendar e1 = Calendar.getInstance(); |
| | | e1.setTime(date); |
| | | e1.set(Calendar.HOUR_OF_DAY, Integer.valueOf(num23.split(" - ")[1].split(":")[0])); |
| | | e1.set(Calendar.MINUTE, Integer.valueOf(num23.split(" - ")[1].split(":")[1])); |
| | | |
| | | Calendar s2 = Calendar.getInstance(); |
| | | s2.setTime(date); |
| | | s2.set(Calendar.HOUR_OF_DAY, Integer.valueOf(num24.split(" - ")[0].split(":")[0])); |
| | | s2.set(Calendar.MINUTE, Integer.valueOf(num24.split(" - ")[0].split(":")[1])); |
| | | |
| | | //夜间服务处理逻辑 |
| | | Calendar s = Calendar.getInstance(); |
| | | s.setTime(date); |
| | | s.set(Calendar.HOUR_OF_DAY, Integer.valueOf(rule.getString("num14").split(" - ")[0].split(":")[0])); |
| | | s.set(Calendar.MINUTE, Integer.valueOf(rule.getString("num14").split(" - ")[0].split(":")[1])); |
| | | Calendar e2 = Calendar.getInstance(); |
| | | e2.setTime(date); |
| | | e2.set(Calendar.HOUR_OF_DAY, Integer.valueOf(num24.split(" - ")[1].split(":")[0])); |
| | | e2.set(Calendar.MINUTE, Integer.valueOf(num24.split(" - ")[1].split(":")[1])); |
| | | |
| | | Calendar e = Calendar.getInstance(); |
| | | e.setTime(date); |
| | | e.set(Calendar.HOUR_OF_DAY, Integer.valueOf(rule.getString("num14").split(" - ")[1].split(":")[0])); |
| | | e.set(Calendar.MINUTE, Integer.valueOf(rule.getString("num14").split(" - ")[1].split(":")[1])); |
| | | |
| | | if(date.getTime() > s.getTimeInMillis() && date.getTime() < e.getTimeInMillis()){ |
| | | if(d > rule.getDouble("num6")){ |
| | | yt1 = rule.getDouble("num18") * (rule.getDouble("num7") - rule.getDouble("num6")); |
| | | if((date.getTime() > s1.getTimeInMillis() && date.getTime() < e1.getTimeInMillis()) || (date.getTime() > s2.getTimeInMillis() && date.getTime() < e2.getTimeInMillis())){ |
| | | if(d > num8.doubleValue() && d <= num9.doubleValue()){ |
| | | yt1 = num28 * (d - num8); |
| | | } |
| | | if(d > rule.getDouble("num9")){ |
| | | yt2 = rule.getDouble("num19") * (rule.getDouble("num10") - rule.getDouble("num9")); |
| | | if(d > num9.doubleValue()){ |
| | | yt1 = num28 * (num9 - num8); |
| | | } |
| | | if(d > rule.getDouble("num12")){ |
| | | yt3 = rule.getDouble("num20") * (d - rule.getDouble("num12")); |
| | | if(d > num11.doubleValue() && d <= num12.doubleValue()){ |
| | | yt2 = num29 * (d - num11); |
| | | } |
| | | amount = rule.getDouble("num15") + (d1 * rule.getDouble("num16")) + (t1 * rule.getDouble("num17")) + (w1 * waitMoney) + yt1 + yt2 + yt3; |
| | | orderPrivateCar.setStartMileage(rule.getDouble("num2")); |
| | | orderPrivateCar.setStartMoney(rule.getDouble("num15"));//起步价 |
| | | if(d > num12.doubleValue()){ |
| | | yt2 = num29 * (num12 - num11); |
| | | } |
| | | if(d > num14.doubleValue()){ |
| | | yt3 = num30 * (d - num14); |
| | | } |
| | | amount = num25 + (d1 * num26) + (t1 * num27) + (w1 * num7) + yt1 + yt2 + yt3; |
| | | orderPrivateCar.setStartMileage(num2); |
| | | orderPrivateCar.setStartMoney(num25);//起步价 |
| | | orderPrivateCar.setMileageKilometers(new BigDecimal(d1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setMileageMoney(new BigDecimal(d1 * rule.getDouble("num16")).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//里程费 |
| | | orderPrivateCar.setMileageMoney(new BigDecimal(d1 * num26).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//里程费 |
| | | orderPrivateCar.setDuration(new BigDecimal(t1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setDurationMoney(new BigDecimal(t1 * rule.getDouble("num17")).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//时长费 |
| | | orderPrivateCar.setDurationMoney(new BigDecimal(t1 * num27).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//时长费 |
| | | orderPrivateCar.setWait(new BigDecimal(w1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setWaitMoney(new BigDecimal(w1 * waitMoney).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//等待费 |
| | | orderPrivateCar.setLongDistance(new BigDecimal((d > rule.getDouble("num6")) ? d - rule.getDouble("num6") : 0).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setWaitMoney(new BigDecimal(w1 * num7).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//等待费 |
| | | orderPrivateCar.setLongDistance(new BigDecimal((d > num8) ? d - num8 : 0).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setLongDistanceMoney(new BigDecimal(yt1 + yt2 + yt3).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//远途费 |
| | | orderPrivateCar.setParkMoney(parkingFee);//停车费 |
| | | orderPrivateCar.setRoadTollMoney(crossingFee);//过路费 |
| | |
| | | orderPrivateCar.setDiscount(0D);//优惠抵扣 |
| | | orderPrivateCar.setPayMoney(0D);//支付金额 |
| | | orderPrivateCar.setOrderMoney(new BigDecimal(amount + parkingFee + crossingFee).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | }else{ |
| | | Calendar s1 = Calendar.getInstance(); |
| | | s1.setTime(date); |
| | | s1.set(Calendar.HOUR_OF_DAY, Integer.valueOf(rule.getString("num21").split(" - ")[0].split(":")[0])); |
| | | s1.set(Calendar.MINUTE, Integer.valueOf(rule.getString("num21").split(" - ")[0].split(":")[1])); |
| | | |
| | | Calendar e1 = Calendar.getInstance(); |
| | | e1.setTime(date); |
| | | e1.set(Calendar.HOUR_OF_DAY, Integer.valueOf(rule.getString("num21").split(" - ")[1].split(":")[0])); |
| | | e1.set(Calendar.MINUTE, Integer.valueOf(rule.getString("num21").split(" - ")[1].split(":")[1])); |
| | | |
| | | Calendar s2 = Calendar.getInstance(); |
| | | s2.setTime(date); |
| | | s2.set(Calendar.HOUR_OF_DAY, Integer.valueOf(rule.getString("num22").split(" - ")[0].split(":")[0])); |
| | | s2.set(Calendar.MINUTE, Integer.valueOf(rule.getString("num22").split(" - ")[0].split(":")[1])); |
| | | |
| | | Calendar e2 = Calendar.getInstance(); |
| | | e2.setTime(date); |
| | | e2.set(Calendar.HOUR_OF_DAY, Integer.valueOf(rule.getString("num22").split(" - ")[1].split(":")[0])); |
| | | e2.set(Calendar.MINUTE, Integer.valueOf(rule.getString("num22").split(" - ")[1].split(":")[1])); |
| | | //高峰时段处理逻辑 |
| | | if((date.getTime() > s1.getTimeInMillis() && date.getTime() < e1.getTimeInMillis()) || (date.getTime() > s2.getTimeInMillis() && date.getTime() < e2.getTimeInMillis())){ |
| | | if(d > rule.getDouble("num6")){ |
| | | yt1 = rule.getDouble("num26") * (rule.getDouble("num7") - rule.getDouble("num6")); |
| | | } |
| | | if(d > rule.getDouble("num9")){ |
| | | yt2 = rule.getDouble("num27") * (rule.getDouble("num10") - rule.getDouble("num9")); |
| | | } |
| | | if(d > rule.getDouble("num12")){ |
| | | yt3 = rule.getDouble("num28") * (d - rule.getDouble("num12")); |
| | | } |
| | | amount = rule.getDouble("num23") + (d1 * rule.getDouble("num24")) + (t1 * rule.getDouble("num25")) + (w1 * waitMoney) + yt1 + yt2 + yt3; |
| | | orderPrivateCar.setStartMileage(rule.getDouble("num2")); |
| | | orderPrivateCar.setStartMoney(rule.getDouble("num23"));//起步价 |
| | | orderPrivateCar.setMileageKilometers(new BigDecimal(d1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setMileageMoney(new BigDecimal(d1 * rule.getDouble("num24")).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//里程费 |
| | | orderPrivateCar.setDuration(new BigDecimal(t1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setDurationMoney(new BigDecimal(t1 * rule.getDouble("num25")).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//时长费 |
| | | orderPrivateCar.setWait(new BigDecimal(w1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setWaitMoney(new BigDecimal(w1 * waitMoney).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//等待费 |
| | | orderPrivateCar.setLongDistance(new BigDecimal((d > rule.getDouble("num6")) ? d - rule.getDouble("num6") : 0).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setLongDistanceMoney(new BigDecimal(yt1 + yt2 + yt3).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//远途费 |
| | | orderPrivateCar.setParkMoney(parkingFee);//停车费 |
| | | orderPrivateCar.setRoadTollMoney(crossingFee);//过路费 |
| | | orderPrivateCar.setRedPacketMoney(0D);//红包抵扣 |
| | | orderPrivateCar.setCouponMoney(0D);//优惠券抵扣 |
| | | orderPrivateCar.setDiscount(0D);//优惠抵扣 |
| | | orderPrivateCar.setPayMoney(0D);//支付金额 |
| | | orderPrivateCar.setOrderMoney(new BigDecimal(amount + parkingFee + crossingFee).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | }else{ |
| | | //其他时间段的计算 |
| | | if(d > rule.getDouble("num6")){ |
| | | yt1 = rule.getDouble("num8") * (rule.getDouble("num7") - rule.getDouble("num6")); |
| | | } |
| | | if(d > rule.getDouble("num9")){ |
| | | yt2 = rule.getDouble("num11") * (rule.getDouble("num10") - rule.getDouble("num9")); |
| | | } |
| | | if(d > rule.getDouble("num12")){ |
| | | yt3 = rule.getDouble("num13") * (d - rule.getDouble("num12")); |
| | | } |
| | | amount = rule.getDouble("num1") + (d1 * rule.getDouble("num4")) + (t1 * rule.getDouble("num5")) + (w1 * waitMoney) + yt1 + yt2 + yt3; |
| | | orderPrivateCar.setStartMileage(rule.getDouble("num2")); |
| | | orderPrivateCar.setStartMoney(rule.getDouble("num1"));//起步价 |
| | | orderPrivateCar.setMileageKilometers(new BigDecimal(d1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setMileageMoney(new BigDecimal(d1 * rule.getDouble("num4")).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//里程费 |
| | | orderPrivateCar.setDuration(new BigDecimal(t1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setDurationMoney(new BigDecimal(t1 * rule.getDouble("num5")).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//时长费 |
| | | orderPrivateCar.setWait(new BigDecimal(w1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setWaitMoney(new BigDecimal(w1 * waitMoney).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//等待费 |
| | | orderPrivateCar.setLongDistance(new BigDecimal((d > rule.getDouble("num6")) ? d - rule.getDouble("num6") : 0).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setLongDistanceMoney(new BigDecimal(yt1 + yt2 + yt3).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//远途费 |
| | | orderPrivateCar.setParkMoney(parkingFee);//停车费 |
| | | orderPrivateCar.setRoadTollMoney(crossingFee);//过路费 |
| | | orderPrivateCar.setRedPacketMoney(0D);//红包抵扣 |
| | | orderPrivateCar.setCouponMoney(0D);//优惠券抵扣 |
| | | orderPrivateCar.setDiscount(0D);//优惠抵扣 |
| | | orderPrivateCar.setPayMoney(0D);//支付金额 |
| | | orderPrivateCar.setOrderMoney(new BigDecimal(amount + parkingFee + crossingFee).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | } |
| | | return orderPrivateCar; |
| | | } |
| | | |
| | | //其他时间段的计算 |
| | | if(d > num8.doubleValue() && d <= num9.doubleValue()){ |
| | | yt1 = num10 * (d - num8); |
| | | } |
| | | if(d > num9.doubleValue()){ |
| | | yt1 = num10 * (num9 - num8); |
| | | } |
| | | if(d > num11.doubleValue() && d <= num12.doubleValue()){ |
| | | yt2 = num13 * (d - num11); |
| | | } |
| | | if(d > num12.doubleValue()){ |
| | | yt2 = num13 * (num12 - num11); |
| | | } |
| | | if(d > num14.doubleValue()){ |
| | | yt3 = num15 * (d - num14); |
| | | } |
| | | amount = num1 + (d1 * num4) + (t1 * num5) + (w1 * num7) + yt1 + yt2 + yt3; |
| | | orderPrivateCar.setStartMileage(num2); |
| | | orderPrivateCar.setStartMoney(num1);//起步价 |
| | | orderPrivateCar.setMileageKilometers(new BigDecimal(d1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setMileageMoney(new BigDecimal(d1 * num4).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//里程费 |
| | | orderPrivateCar.setDuration(new BigDecimal(t1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setDurationMoney(new BigDecimal(t1 * num5).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//时长费 |
| | | orderPrivateCar.setWait(new BigDecimal(w1).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setWaitMoney(new BigDecimal(w1 * num7).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//等待费 |
| | | orderPrivateCar.setLongDistance(new BigDecimal((d > num8) ? d - num8 : 0).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | orderPrivateCar.setLongDistanceMoney(new BigDecimal(yt1 + yt2 + yt3).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue());//远途费 |
| | | orderPrivateCar.setParkMoney(parkingFee);//停车费 |
| | | orderPrivateCar.setRoadTollMoney(crossingFee);//过路费 |
| | | orderPrivateCar.setRedPacketMoney(0D);//红包抵扣 |
| | | orderPrivateCar.setCouponMoney(0D);//优惠券抵扣 |
| | | orderPrivateCar.setDiscount(0D);//优惠抵扣 |
| | | orderPrivateCar.setPayMoney(0D);//支付金额 |
| | | orderPrivateCar.setOrderMoney(new BigDecimal(amount + parkingFee + crossingFee).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | return orderPrivateCar; |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 跳转到主页 |
| | | */ |
| | | @RequestMapping(value = "/", method = RequestMethod.GET) |
| | | // @RequestMapping(value = "/", method = RequestMethod.GET) |
| | | public String index(Model model) { |
| | | //获取菜单列表 |
| | | List<Integer> roleList = ShiroKit.getUser().getRoleList(); |
| | |
| | | /** |
| | | * 跳转到登录页面 |
| | | */ |
| | | @RequestMapping(value = "/login", method = RequestMethod.GET) |
| | | // @RequestMapping(value = "/login", method = RequestMethod.GET) |
| | | public String login() { |
| | | if (ShiroKit.isAuthenticated() || ShiroKit.getUser() != null) { |
| | | return REDIRECT + "/"; |
| | |
| | | /** |
| | | * 点击登录执行的动作 |
| | | */ |
| | | @RequestMapping(value = "/login", method = RequestMethod.POST) |
| | | // @RequestMapping(value = "/login", method = RequestMethod.POST) |
| | | public String loginVali() { |
| | | |
| | | String username = super.getPara("username").trim(); |
| | |
| | | Subject currentUser = ShiroKit.getSubject(); |
| | | UsernamePasswordToken token = new UsernamePasswordToken(username, password.toCharArray()); |
| | | |
| | | if ("on".equals(remember)) { |
| | | token.setRememberMe(true); |
| | | } else { |
| | | token.setRememberMe(false); |
| | | } |
| | | token.setRememberMe(false); |
| | | |
| | | currentUser.login(token); |
| | | |
| | |
| | | |
| | | |
| | | |
| | | BankCard query(@Param("driverId") Integer driverId, @Param("code") String code); |
| | | BankCard query(@Param("userType") Integer userType, @Param("userId") Integer userId, @Param("code") String code); |
| | | |
| | | |
| | | |
| | | List<BankCard> queryBankCard(@Param("pageNum") Integer pageNum, @Param("size") Integer size, |
| | | @Param("driverId") Integer driverId); |
| | | @Param("userType") Integer userType, @Param("userId") Integer userId); |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import com.stylefeng.guns.modular.system.model.OfflineTravelPayment; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface OfflineTravelPaymentMapper extends BaseMapper<OfflineTravelPayment> { |
| | | |
| | | |
| | | |
| | | List<BaseWarpper> queryOfflineTravelPaymentList(@Param("driverId") Integer driverId, @Param("start") String start, |
| | | @Param("end") String end, @Param("pageNum") Integer pageNum, |
| | | @Param("size") Integer size); |
| | | |
| | | |
| | | |
| | | Double getTotalMoney(@Param("driverId") Integer driverId, @Param("start") String start, |
| | | @Param("end") String end); |
| | | } |
| | |
| | | <result column="bank" property="bank"/> |
| | | <result column="name" property="name"/> |
| | | <result column="code" property="code"/> |
| | | <result column="driverId" property="driverId"/> |
| | | <result column="acctNumSuffix" property="acctNumSuffix"/> |
| | | <result column="phone" property="phone"/> |
| | | <result column="userType" property="userType"/> |
| | | <result column="userId" property="userId"/> |
| | | <result column="signNum" property="signNum"/> |
| | | <result column="insertTime" property="insertTime"/> |
| | | </resultMap> |
| | | |
| | |
| | | bank as bank, |
| | | `name` as `name`, |
| | | `code` as `code`, |
| | | driverId as driverId, |
| | | userId as userId, |
| | | insertTime as insertTime |
| | | from t_bank_card where driverId = #{driverId} and `code` = #{code} |
| | | from t_bank_card where userType = #{userType} and userId = #{userId} and `code` = #{code} |
| | | </select> |
| | | |
| | | |
| | |
| | | id as id, |
| | | bank as bank, |
| | | `name` as `name`, |
| | | `code` as `code`, |
| | | driverId as driverId, |
| | | CONCAT('************', acctNumSuffix) as `code`, |
| | | userId as userId, |
| | | insertTime as insertTime |
| | | from t_bank_card where driverId = #{driverId} order by insertTime limit #{pageNum}, #{size} |
| | | from t_bank_card where userType = #{userType} and userId = #{userId} order by insertTime limit #{pageNum}, #{size} |
| | | </select> |
| | | </mapper> |
| | |
| | | <result column="flag" property="flag"/> |
| | | <result column="upload" property="upload"/> |
| | | <result column="insertTime" property="insertTime"/> |
| | | <result column="holidayFee" property="holidayFee"/> |
| | | |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | and provinceCode = #{province} and cityCode = #{city} and (areaCode = '' or areaCode is null) |
| | | </if> |
| | | <if test="null != province and null == city and null == code"> |
| | | and provinceCode = #{province} and (cityCode = '' or cityCode is null) and (areaCode = '' or areaCode is null) |
| | | and provinceCode = #{province} and (cityCode == '' or cityCode is null) and (areaCode = '' or areaCode is null) |
| | | </if> |
| | | ) |
| | | </select> |
| | |
| | | <result column="laveBusinessMoney" property="laveBusinessMoney" /> |
| | | <result column="placeOfPractice" property="placeOfPractice"/> |
| | | <result column="appletsOpenId" property="appletsOpenId"/> |
| | | <result column="mchtNo" property="mchtNo"/> |
| | | |
| | | <result column="flag" property="flag"/> |
| | | <result column="insertTime" property="insertTime"/> |
| | |
| | | (select count(id) from t_order_cross_city where driverId = a.id and state in (6, 8, 9)) + |
| | | (select count(id) from t_order_logistics where driverId = a.id and state in (6, 9)) |
| | | ) as orderNum, |
| | | ((select sum(fraction) from t_order_evaluate where driverId = a.id) / (select count(fraction) from t_order_evaluate where driverId = a.id)) as score, |
| | | if((select id from t_merchant where auditStatus = 2 and userType = 2 and userId = a.id and state = 1) is null, 0, 1) as merchant |
| | | ((select sum(fraction) from t_order_evaluate where driverId = a.id) / (select count(fraction) from t_order_evaluate where driverId = a.id)) as score |
| | | from t_driver a |
| | | left join t_car b on (a.carId = b.id) |
| | | left join t_car_model c on (b.carModelId = c.id) |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.stylefeng.guns.modular.system.dao.OfflineTravelPaymentMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.stylefeng.guns.modular.system.model.OfflineTravelPayment"> |
| | | <id column="id" property="id"/> |
| | | <result column="orderId" property="orderId"/> |
| | | <result column="payType" property="payType"/> |
| | | <result column="payMoney" property="payMoney"/> |
| | | <result column="payTime" property="payTime"/> |
| | | <result column="driverId" property="driverId"/> |
| | | <result column="status" property="status"/> |
| | | <result column="insertTime" property="insertTime"/> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="queryOfflineTravelPaymentList" resultType="com.stylefeng.guns.modular.system.warpper.BaseWarpper"> |
| | | select |
| | | id, |
| | | payMoney as amount, |
| | | if(status = 1, '未到账', '已到账') as content, |
| | | DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i') as `day`, |
| | | DATE_FORMAT(payTime, '%H:%i:%s') as `data` |
| | | from t_offline_travel_payment where driverId = #{driverId} |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(payTime, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | | order by insertTime desc limit #{pageNum}, #{size} |
| | | </select> |
| | | |
| | | |
| | | <select id="getTotalMoney" resultType="double"> |
| | | select ifnull(sum(payMoney), 0) from t_offline_travel_payment where driverId = #{driverId} and status = 2 |
| | | <if test="null != start and '' != start and null != end and '' != end"> |
| | | and DATE_FORMAT(payTime, '%Y-%m-%d') between #{start} and #{end} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | select |
| | | (money * -1) as money, |
| | | DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i') as time, |
| | | CONCAT(if(orderType = 1, '快车', if(orderType = 2, '出租车', if(orderType = 3, '跨城', if(orderType = 4, '同城小件物流', if(orderType = 5, '跨城小件物流', '包车'))))), '订单取消') as name, |
| | | CONCAT(if(orderType = 1, '专车', if(orderType = 2, '出租车', if(orderType = 3, '跨城', if(orderType = 4, '同城小件物流', if(orderType = 5, '跨城小件物流', '包车'))))), '订单取消') as name, |
| | | UNIX_TIMESTAMP(insertTime) as insertTime |
| | | from t_order_cancel where state = 2 and userType = 1 and money is not null and userId = #{uid} |
| | | <choose> |
| | |
| | | <result column="state" property="state"/> |
| | | <result column="reason" property="reason"/> |
| | | <result column="remark" property="remark"/> |
| | | <result column="refundState" property="refundState"/> |
| | | <result column="refundCode" property="refundCode"/> |
| | | <result column="completeTime" property="completeTime"/> |
| | | </resultMap> |
| | | |
| | |
| | | <id column="id" property="id"/> |
| | | <result column="type" property="type"/> |
| | | <result column="userType" property="userType"/> |
| | | <result column="noticeType" property="noticeType"/> |
| | | <result column="noticesId" property="noticesId"/> |
| | | <result column="content" property="content"/> |
| | | <result column="userId" property="userId"/> |
| | |
| | | <select id="query" resultType="map"> |
| | | select |
| | | id as id, |
| | | content as content, |
| | | contentPutOne as contentPutOne, |
| | | contentNotOne as contentNotOne, |
| | | contentPutTwo as contentPutTwo, |
| | | contentNotTwo as contentNotTwo, |
| | | contentPutThree as contentPutThree, |
| | | contentNotThree as contentNotThree, |
| | | contentExclusive as contentExclusive, |
| | | contentPrice as contentPrice, |
| | | isOpen as isOpen |
| | | content as content |
| | | from t_system_price where companyId = #{companyId} |
| | | <if test="null != type"> |
| | | and `type` = #{type} |
| | |
| | | <result column="money" property="money" /> |
| | | <result column="state" property="state" /> |
| | | <result column="remark" property="remark" /> |
| | | <result column="bankName" property="bankName"/> |
| | | <result column="code" property="code" /> |
| | | <result column="name" property="name" /> |
| | | <result column="userType" property="userType" /> |
| | |
| | | select |
| | | id as id, |
| | | DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i') as insertTime, |
| | | bankName as bankName, |
| | | money as money, |
| | | ('银行卡提现') as name, |
| | | remark as remark, |
| | |
| | | @TableField("name") |
| | | private String name; |
| | | /** |
| | | * 银行卡号 |
| | | * 银行卡号(密文) |
| | | */ |
| | | @TableField("code") |
| | | private String code; |
| | | /** |
| | | * 司机id |
| | | * 银行卡号后四位 |
| | | */ |
| | | @TableField("acctNumSuffix") |
| | | private String acctNumSuffix; |
| | | /** |
| | | * 银行预留手机号 |
| | | */ |
| | | @TableField("phone") |
| | | private String phone; |
| | | /** |
| | | * 身份证号码 |
| | | */ |
| | | @TableField("IdNum") |
| | | private String IdNum; |
| | | /** |
| | | * 用户类型(1=乘客,2=司机) |
| | | * @return |
| | | */ |
| | | @TableField("driverId") |
| | | private Integer driverId; |
| | | @TableField("userType") |
| | | private Integer userType; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @TableField("userId") |
| | | private Integer userId; |
| | | /** |
| | | * 签约协议号 |
| | | */ |
| | | @TableField("signNum") |
| | | private String signNum; |
| | | /** |
| | | * 添加时间 |
| | | * @return |
| | |
| | | this.code = code; |
| | | } |
| | | |
| | | public Integer getDriverId() { |
| | | return driverId; |
| | | public String getAcctNumSuffix() { |
| | | return acctNumSuffix; |
| | | } |
| | | |
| | | public void setDriverId(Integer driverId) { |
| | | this.driverId = driverId; |
| | | public void setAcctNumSuffix(String acctNumSuffix) { |
| | | this.acctNumSuffix = acctNumSuffix; |
| | | } |
| | | |
| | | public String getPhone() { |
| | | return phone; |
| | | } |
| | | |
| | | public void setPhone(String phone) { |
| | | this.phone = phone; |
| | | } |
| | | |
| | | public String getIdNum() { |
| | | return IdNum; |
| | | } |
| | | |
| | | public void setIdNum(String idNum) { |
| | | IdNum = idNum; |
| | | } |
| | | |
| | | public Integer getUserType() { |
| | | return userType; |
| | | } |
| | | |
| | | public void setUserType(Integer userType) { |
| | | this.userType = userType; |
| | | } |
| | | |
| | | public Integer getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(Integer userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public String getSignNum() { |
| | | return signNum; |
| | | } |
| | | |
| | | public void setSignNum(String signNum) { |
| | | this.signNum = signNum; |
| | | } |
| | | |
| | | public Date getInsertTime() { |
| | |
| | | |
| | | public void setInsertTime(Date insertTime) { |
| | | this.insertTime = insertTime; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "BankCard{" + |
| | | "id=" + id + |
| | | ", bank='" + bank + '\'' + |
| | | ", name='" + name + '\'' + |
| | | ", code='" + code + '\'' + |
| | | ", driverId=" + driverId + |
| | | ", insertTime=" + insertTime + |
| | | '}'; |
| | | } |
| | | } |
| | |
| | | @TableField("carId") |
| | | private Integer carId; |
| | | /** |
| | | * 服务类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行) |
| | | * 服务类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | |
| | | */ |
| | | @TableField("insertTime") |
| | | private Date insertTime; |
| | | //节假费 |
| | | @TableField("holidayFee") |
| | | private Double holidayFee; |
| | | |
| | | private String detailAddress; |
| | | |
| | | private String scale; |
| | | |
| | | private String companyInfo; |
| | | |
| | | public String getDetailAddress() { |
| | | return detailAddress; |
| | | } |
| | | |
| | | public void setDetailAddress(String detailAddress) { |
| | | this.detailAddress = detailAddress; |
| | | } |
| | | |
| | | public String getScale() { |
| | | return scale; |
| | | } |
| | | |
| | | public void setScale(String scale) { |
| | | this.scale = scale; |
| | | } |
| | | |
| | | public String getCompanyInfo() { |
| | | return companyInfo; |
| | | } |
| | | |
| | | public void setCompanyInfo(String companyInfo) { |
| | | this.companyInfo = companyInfo; |
| | | } |
| | | |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | |
| | | public void setInsertTime(Date insertTime) { |
| | | this.insertTime = insertTime; |
| | | } |
| | | |
| | | public Double getHolidayFee() { |
| | | return holidayFee; |
| | | } |
| | | |
| | | public void setHolidayFee(Double holidayFee) { |
| | | this.holidayFee = holidayFee; |
| | | } |
| | | |
| | | @Override |
| | |
| | | */ |
| | | @TableField("appletsOpenId") |
| | | private String appletsOpenId; |
| | | /** |
| | | * 银行商户号 |
| | | */ |
| | | @TableField("mchtNo") |
| | | private String mchtNo; |
| | | |
| | | @Override |
| | | public Integer getId() { |
| | |
| | | this.withdrawPassword = withdrawPassword; |
| | | } |
| | | |
| | | public String getMchtNo() { |
| | | return mchtNo; |
| | | } |
| | | |
| | | public void setMchtNo(String mchtNo) { |
| | | this.mchtNo = mchtNo; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "Driver{" + |
| | |
| | | @TableField("driverId") |
| | | private Integer driverId; |
| | | /** |
| | | * 允许接单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行) |
| | | * 允许接单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | |
| | | @TableField("driverId") |
| | | private Integer driverId; |
| | | /** |
| | | * 业务类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行) |
| | | * 业务类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | |
| | | @TableField("endTime") |
| | | private Date endTime; |
| | | /** |
| | | * 业务类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行) |
| | | * 业务类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车) |
| | | */ |
| | | @TableField("type") |
| | | private String type; |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 线下出行支付记录 |
| | | * @author pzb |
| | | * @Date 2022/11/30 9:00 |
| | | */ |
| | | @TableName("t_offline_travel_payment") |
| | | public class OfflineTravelPayment { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableField("id") |
| | | private Integer id; |
| | | /** |
| | | * 下单唯一标识 |
| | | */ |
| | | @TableField("orderId") |
| | | private String orderId; |
| | | /** |
| | | * 支付方式(1=微信,2=支付宝) |
| | | */ |
| | | @TableField("payType") |
| | | private Integer payType; |
| | | /** |
| | | * 支付金额 |
| | | */ |
| | | @TableField("payMoney") |
| | | private Double payMoney; |
| | | /** |
| | | * 支付时间 |
| | | */ |
| | | @TableField("payTime") |
| | | private Date payTime; |
| | | /** |
| | | * 支付流水号 |
| | | */ |
| | | @TableField("payNumber") |
| | | private String payNumber; |
| | | /** |
| | | * 服务司机id |
| | | */ |
| | | @TableField("driverId") |
| | | private Integer driverId; |
| | | /** |
| | | * 状态(1=待支付,2=已支付) |
| | | */ |
| | | @TableField("status") |
| | | private Integer status; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | private Date insertTime; |
| | | |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Integer id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getOrderId() { |
| | | return orderId; |
| | | } |
| | | |
| | | public void setOrderId(String orderId) { |
| | | this.orderId = orderId; |
| | | } |
| | | |
| | | public Integer getPayType() { |
| | | return payType; |
| | | } |
| | | |
| | | public void setPayType(Integer payType) { |
| | | this.payType = payType; |
| | | } |
| | | |
| | | public Double getPayMoney() { |
| | | return payMoney; |
| | | } |
| | | |
| | | public void setPayMoney(Double payMoney) { |
| | | this.payMoney = payMoney; |
| | | } |
| | | |
| | | public Date getPayTime() { |
| | | return payTime; |
| | | } |
| | | |
| | | public void setPayTime(Date payTime) { |
| | | this.payTime = payTime; |
| | | } |
| | | |
| | | public String getPayNumber() { |
| | | return payNumber; |
| | | } |
| | | |
| | | public void setPayNumber(String payNumber) { |
| | | this.payNumber = payNumber; |
| | | } |
| | | |
| | | public Integer getDriverId() { |
| | | return driverId; |
| | | } |
| | | |
| | | public void setDriverId(Integer driverId) { |
| | | this.driverId = driverId; |
| | | } |
| | | |
| | | public Integer getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(Integer status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public Date getInsertTime() { |
| | | return insertTime; |
| | | } |
| | | |
| | | public void setInsertTime(Date insertTime) { |
| | | this.insertTime = insertTime; |
| | | } |
| | | } |
| | |
| | | @TableField("orderId") |
| | | private Integer orderId; |
| | | /** |
| | | * 订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行) |
| | | * 订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车) |
| | | */ |
| | | @TableField("orderType") |
| | | private Integer orderType; |
| | |
| | | @TableField("id") |
| | | private Integer id; |
| | | /** |
| | | * 订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行) |
| | | * 订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车) |
| | | */ |
| | | @TableField("orderType") |
| | | private Integer orderType; |
| | |
| | | @TableField("id") |
| | | private Integer id; |
| | | /** |
| | | * 类别(1=订单相关支付,2=充值支付,3=感谢费支付,4=购买打车卡) |
| | | * 支付类别(1=订单相关支付,2=其他支付) |
| | | */ |
| | | @TableField("category") |
| | | private Integer category; |
| | |
| | | @TableField("id") |
| | | private Integer id; |
| | | /** |
| | | * 订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行) |
| | | * 订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车) |
| | | */ |
| | | @TableField("orderType") |
| | | private Integer orderType; |
| | |
| | | */ |
| | | @TableField("remark") |
| | | private String remark; |
| | | /** |
| | | * 退款状态(1=退款中,2=已退款) |
| | | */ |
| | | @TableField("refundState") |
| | | private Integer refundState; |
| | | /** |
| | | * 退款单号 |
| | | */ |
| | | @TableField("refundCode") |
| | | private String refundCode; |
| | | /** |
| | | * 改派完成时间 |
| | | */ |
| | |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public Integer getRefundState() { |
| | | return refundState; |
| | | } |
| | | |
| | | public void setRefundState(Integer refundState) { |
| | | this.refundState = refundState; |
| | | } |
| | | |
| | | public String getRefundCode() { |
| | | return refundCode; |
| | | } |
| | | |
| | | public void setRefundCode(String refundCode) { |
| | | this.refundCode = refundCode; |
| | | } |
| | | |
| | | public Date getCompleteTime() { |
| | | return completeTime; |
| | | } |
| | |
| | | @TableField("type") |
| | | private Integer type; |
| | | /** |
| | | * 系统消息类型(1=打车业务,2=优惠券,3=其他) |
| | | */ |
| | | @TableField("noticeType") |
| | | private Integer noticeType; |
| | | /** |
| | | * 用户类型(1=用户,2=司机) |
| | | */ |
| | | @TableField("userType") |
| | |
| | | |
| | | public void setUserId(Integer userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Integer getNoticeType() { |
| | | return noticeType; |
| | | } |
| | | |
| | | public void setNoticeType(Integer noticeType) { |
| | | this.noticeType = noticeType; |
| | | } |
| | | |
| | | public Date getInsertTime() { |
| | |
| | | @TableField("id") |
| | | private Integer id; |
| | | /** |
| | | * 业务类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行) |
| | | * 业务类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | |
| | | */ |
| | | @TableField("activityType") |
| | | private Integer activityType; |
| | | /** |
| | | * 使用结束时间 |
| | | */ |
| | | @TableField("endTime") |
| | | private Date endTime; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | this.activityType = activityType; |
| | | } |
| | | |
| | | public Date getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(Date endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "UserCouponRecord{" + |
| | |
| | | @TableField("orderType") |
| | | private Integer orderType; |
| | | /** |
| | | * 使用结束时间 |
| | | */ |
| | | @TableField("endTime") |
| | | private Date endTime; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @TableField("userId") |
| | |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Date getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(Date endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "UserRedPacketRecord{" + |
| | |
| | | @TableField("remark") |
| | | private String remark; |
| | | /** |
| | | * 银行名称 |
| | | */ |
| | | @TableField("bankName") |
| | | private String bankName; |
| | | /** |
| | | * 银行账户 |
| | | */ |
| | | @TableField("code") |
| | |
| | | */ |
| | | @TableField("serialNo") |
| | | private String serialNo; |
| | | /** |
| | | * 实际到账金额 |
| | | */ |
| | | @TableField("realGetMoney") |
| | | private Double realGetMoney; |
| | | |
| | | public Double getRealGetMoney() { |
| | | return realGetMoney; |
| | | } |
| | | |
| | | public void setRealGetMoney(Double realGetMoney) { |
| | | this.realGetMoney = realGetMoney; |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public String getBankName() { |
| | | return bankName; |
| | | } |
| | | |
| | | public void setBankName(String bankName) { |
| | | this.bankName = bankName; |
| | | } |
| | | |
| | | public String getCode() { |
| | |
| | | ResultUtil saveBankCard(String bank, String name, String code, Integer driverId) throws Exception; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存银行卡信息 |
| | | * @param code |
| | | * @param driverId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil saveBankCard1(Integer driverId, String IdNum, String phone, String acctName, String acctNum, String code) throws Exception; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 删除银行卡号 |
| | | * @param id |
| | |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil loginOut(Integer id) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 获取收款二维码 |
| | | * @param driverId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil getMoneyReceivingQRCode(Integer driverId) throws Exception; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import com.stylefeng.guns.modular.system.model.OfflineTravelPayment; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface IOfflineTravelPaymentService extends IService<OfflineTravelPayment> { |
| | | |
| | | |
| | | /** |
| | | * 获取支付记录 |
| | | * @param driverId |
| | | * @param start |
| | | * @param end |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<BaseWarpper> queryOfflineTravelPaymentList(Integer driverId, String start, String end, Integer pageNum, Integer size) throws Exception; |
| | | |
| | | |
| | | Double getTotalMoney(Integer driverId, String start, String end) throws Exception; |
| | | } |
| | |
| | | |
| | | import com.stylefeng.guns.modular.system.model.OrderPosition; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.OrderListWarpper; |
| | | |
| | | import java.util.Date; |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil process(Integer orderId, Integer orderType, Integer state, Integer uid, Double lon, Double lat, String driverImg) throws Exception; |
| | | ResultUtil process(Integer orderId, Integer orderType, Integer state, Integer uid, Double lon, Double lat) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil confirmFees(Integer orderId, Integer orderType, Integer type, Double travelFee, Double parkingFee, Double crossingFee) throws Exception; |
| | | ResultUtil cancleOrder(Integer orderId, Integer orderType) throws Exception; |
| | | ResultUtil updatePeopleNum(Integer orderId, Integer peopleNum) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 确认费用操作 |
| | | * @param orderId |
| | | * @param orderType |
| | | * @param type |
| | | * @param travelFee |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil confirmFees1(Integer orderId, Integer orderType, Integer type, Double travelFee, String additionalFee) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @throws Exception |
| | | */ |
| | | Map<String, Object> queryMoneyInfo(Integer orderId, Integer orderType) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 获取附加费配置 |
| | | * @param orderType |
| | | * @param orderId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<BaseWarpper> queryAdditionalFee(Integer orderType, Integer orderId, Integer uid) throws Exception; |
| | | } |
| | |
| | | * @param type 1=微信,2=支付宝 |
| | | * @throws Exception |
| | | */ |
| | | void payReassign(String id, String order_id, Integer type) throws Exception; |
| | | void payReassign(String id, Integer orderType, String order_id, Integer type) throws Exception; |
| | | } |
| | |
| | | * @param userId |
| | | * @throws Exception |
| | | */ |
| | | void addSystemNotice(Integer userType, String content, Integer userId, Integer noticeType) throws Exception; |
| | | void addSystemNotice(Integer userType, String content, Integer userId) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | * @param uid |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil withdrawal(Double money, String bankName, String code, String name, Integer uid, Integer type) throws Exception; |
| | | ResultUtil withdrawal(Double money, Integer bankCardId, String name, Integer uid, Integer type) throws Exception; |
| | | |
| | | |
| | | /** |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.dao.BankCardMapper; |
| | | import com.stylefeng.guns.modular.system.model.BankCard; |
| | | import com.stylefeng.guns.modular.system.service.IBankCardService; |
| | | import com.stylefeng.guns.modular.system.util.LiuZhouBank.ProtocolSignUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | @Service |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil saveBankCard(String bank, String name, String code, Integer driverId) throws Exception { |
| | | BankCard query = bankCardMapper.query(driverId, code); |
| | | BankCard query = bankCardMapper.query(2, driverId, code); |
| | | if(null != query){ |
| | | return ResultUtil.error("银行卡号已存在"); |
| | | } |
| | |
| | | bankCard.setBank(bank); |
| | | bankCard.setName(name); |
| | | bankCard.setCode(code); |
| | | bankCard.setDriverId(driverId); |
| | | bankCard.setUserType(2); |
| | | bankCard.setUserId(driverId); |
| | | bankCard.setInsertTime(new Date()); |
| | | this.insert(bankCard); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | @Override |
| | | public ResultUtil saveBankCard1(Integer driverId, String IdNum, String phone, String acctName, String acctNum, String code) throws Exception { |
| | | BankCard query = bankCardMapper.query(2, driverId, acctNum); |
| | | if(null != query){ |
| | | return ResultUtil.error("银行卡号已存在"); |
| | | } |
| | | // Map<String, String> map = ProtocolSignUtil.protocolSign(IdNum, phone, acctName, acctNum, code); |
| | | // String code1 = map.get("code"); |
| | | // if("01".equals(code1)){ |
| | | // String msg = map.get("msg"); |
| | | // return ResultUtil.error(msg); |
| | | // } |
| | | // String signNum = map.get("signNum"); |
| | | // String acctNumSuffix = map.get("acctNumSuffix"); |
| | | // |
| | | // BankCard bankCard = new BankCard(); |
| | | // bankCard.setBank("柳州银行"); |
| | | // bankCard.setName(acctName); |
| | | // bankCard.setCode(acctNum); |
| | | // bankCard.setAcctNumSuffix(acctNumSuffix); |
| | | // bankCard.setPhone(phone); |
| | | // bankCard.setIdNum(IdNum); |
| | | // bankCard.setUserType(2); |
| | | // bankCard.setUserId(driverId); |
| | | // bankCard.setSignNum(signNum); |
| | | // bankCard.setInsertTime(new Date()); |
| | | // this.insert(bankCard); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | /** |
| | | * 删除银行卡号 |
| | |
| | | @Override |
| | | public ResultUtil delBankCard(Integer id, Integer driverId) throws Exception { |
| | | BankCard bankCard = this.selectById(id); |
| | | if(bankCard.getDriverId().compareTo(driverId) != 0){ |
| | | return ResultUtil.error("你无权删除此卡号"); |
| | | } |
| | | this.deleteById(id); |
| | | // if(bankCard.getUserId().compareTo(driverId) != 0){ |
| | | // return ResultUtil.error("你无权删除此卡号"); |
| | | // } |
| | | // Map<String, String> map = ProtocolSignUtil.queryProtocolSign(bankCard.getSignNum(), bankCard.getCode()); |
| | | // String code1 = map.get("code"); |
| | | // if("01".equals(code1)){ |
| | | // String msg = map.get("msg"); |
| | | // return ResultUtil.error(msg); |
| | | // } |
| | | // String sugnNum = map.get("SignNum"); |
| | | // String signStatus = map.get("SignStatus"); |
| | | // Map<String, String> map1 = ProtocolSignUtil.protocolRescind(sugnNum); |
| | | // String code = map1.get("code"); |
| | | // if("01".equals(code)){ |
| | | // String msg = map.get("msg"); |
| | | // return ResultUtil.error(msg); |
| | | // } |
| | | // this.deleteById(id); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public List<BankCard> queryBankCard(Integer pageNum, Integer size, Integer driverId) throws Exception { |
| | | pageNum = (pageNum - 1) * size; |
| | | return bankCardMapper.queryBankCard(pageNum, size, driverId); |
| | | return bankCardMapper.queryBankCard(pageNum, size, 2, driverId); |
| | | } |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.CarBrandMapper; |
| | | import com.stylefeng.guns.modular.system.dao.CarMapper; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.*; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | @Service |
| | |
| | | */ |
| | | @Override |
| | | public boolean idle(Integer id) throws Exception { |
| | | Driver driver = driverService.selectOne(new EntityWrapper<Driver>().eq("carId", id).in("authState", Arrays.asList(1, 2)).ne("flag", 3)); |
| | | return null == driver ? true : false; |
| | | Car car = this.selectById(id); |
| | | List<Map<String, Object>> list = carMapper.queryIdleData(car.getFranchiseeId() != null && car.getFranchiseeId() != 0 ? car.getFranchiseeId() : ( |
| | | car.getCompanyId() != null && car.getCompanyId() != 0 ? car.getCompanyId() : 1)); |
| | | for(Map<String, Object> map : list){ |
| | | Integer carId = Integer.valueOf(String.valueOf(map.get("id"))); |
| | | if(carId.compareTo(id) == 0){ |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.util.LiuZhouBank.PayUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.ActivityWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.LoginWarpper; |
| | |
| | | |
| | | private String salt = "SA;d5#"; |
| | | |
| | | private Map<String, Long> loginTime = new HashMap<>();//登录时间 |
| | | |
| | | private Map<String, Integer> loginFailures = new HashMap<>();//登录失败次数 |
| | | |
| | | |
| | | |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil queryCaptcha(String phone, Integer type) throws Exception { |
| | | public ResultUtil queryCaptcha(String checkCaptcha, Integer type) throws Exception { |
| | | checkCaptcha = AESUtil.decrypt(checkCaptcha); |
| | | |
| | | Random random = new Random(); |
| | | StringBuffer sb = new StringBuffer(); |
| | | for(int i = 0; i < 4; i++){ |
| | |
| | | String sms = "短信验证码【" + authCode + "】已发到您的手机,验证码将在5分钟后失效,请及时登录!"; |
| | | |
| | | //发送验证码短信 |
| | | redisUtil.setStrValue(phone, authCode, 5 * 60);//设置五分钟过期 |
| | | redisUtil.setStrValue(checkCaptcha, authCode, 5 * 60);//设置五分钟过期 |
| | | String templateCode = ""; |
| | | switch (type){ |
| | | case 1: |
| | |
| | | templateCode = "SMS_154775431";//修改密码 |
| | | break; |
| | | } |
| | | String sData = aLiSendSms.sendSms(phone, "SMS_229715276", "{\"code\":\"" + authCode + "\"}"); |
| | | String sData = aLiSendSms.sendSms(checkCaptcha, templateCode, "{\"code\":\"" + authCode + "\"}"); |
| | | JSONObject jsonObject = JSON.parseObject(sData); |
| | | String message = jsonObject.getString("Message"); |
| | | if(!"OK".equals(message)){ |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil registeredDriver(String phone, String code, String password, Integer uid, Integer type, Integer userType) throws Exception { |
| | | phone = AESUtil.decrypt(phone); |
| | | ResultUtil<LoginWarpper> result = this.registeredDriver(phone, code, password); |
| | | if(result.getCode() == 200 && null != uid){ |
| | | if(type == 2){ |
| | |
| | | incomeService.saveData(2, driver.getId(), 1, Integer.valueOf(String.valueOf(map.get("id"))), null, Double.valueOf(String.valueOf(map.get("money")))); |
| | | } |
| | | } |
| | | driver.setActivityMoney(bigDecimal.add(new BigDecimal(null == driver.getActivityMoney() ? 0 : driver.getActivityMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveActivityMoney(bigDecimal.add(new BigDecimal(null == driver.getLaveActivityMoney() ? 0 : driver.getLaveActivityMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(bigDecimal.add(new BigDecimal(null == driver.getBalance() ? 0 : driver.getBalance())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setActivityMoney(bigDecimal.add(new BigDecimal(driver.getActivityMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveActivityMoney(bigDecimal.add(new BigDecimal(driver.getLaveActivityMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setBalance(bigDecimal.add(new BigDecimal(driver.getBalance())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverMapper.updateById(driver); |
| | | |
| | | Map<String, Date> date = dateUtil.getStartAndEndDate(new Date()); |
| | |
| | | return ResultUtil.error("验证码无效"); |
| | | } |
| | | |
| | | phone = AESUtil.encrypt(phone); |
| | | Driver driver1 = driverMapper.queryByPhone_(phone, 4);//获取审核不通过的数据 |
| | | if(null != driver1){ |
| | | driver1.setAuthState(1); |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil resetPassword(String phone, String code, String password) throws Exception { |
| | | phone = AESUtil.decrypt(phone); |
| | | boolean b = this.checkCaptcha(phone, code); |
| | | if(!b){ |
| | | return ResultUtil.error("验证码无效"); |
| | | } |
| | | Driver driver = driverMapper.queryByPhone(phone); |
| | | String encrypt = AESUtil.encrypt(phone); |
| | | Driver driver = driverMapper.queryByPhone(encrypt); |
| | | if(null == driver){ |
| | | return ResultUtil.error("电话号码未注册"); |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil<LoginWarpper> driverLogin(String phone, String password) throws Exception { |
| | | Driver driver = driverMapper.queryByPhone(phone); |
| | | System.err.println("前端原始加密数据---》" + phone); |
| | | phone = AESUtil.decrypt(phone); |
| | | System.err.println("后端解密数据---》" + phone); |
| | | Integer frequency = loginFailures.get(phone); |
| | | Long time = loginTime.get(phone); |
| | | if(null != time && System.currentTimeMillis() < (time + 1800000) && null != frequency && frequency >= 5){ |
| | | return ResultUtil.error("暂时无法登录,请30分钟后重试!"); |
| | | } |
| | | if(null != time && System.currentTimeMillis() >= (time + 1800000)){ |
| | | frequency = 0; |
| | | loginFailures.put(phone, frequency); |
| | | } |
| | | String encrypt = AESUtil.encrypt(phone); |
| | | Driver driver = driverMapper.queryByPhone(encrypt); |
| | | if(null == driver){ |
| | | return ResultUtil.error("账号未注册"); |
| | | } |
| | | if(ToolUtil.isNotEmpty(driver.getIdCard()) && driver.getAuthState() == 1){ |
| | | if(driver.getAuthState() == 1){ |
| | | return ResultUtil.error("账号正在审核中,请耐心等待"); |
| | | } |
| | | if(driver.getAuthState() == 3){ |
| | | return ResultUtil.error("账号已被冻结,请联系管理员"); |
| | | } |
| | | if(!driver.getPassword().equals(ShiroKit.md5(password, salt))){ |
| | | frequency = (null == frequency ? 0 : frequency) + 1; |
| | | loginFailures.put(phone, frequency); |
| | | if(frequency == 1){ |
| | | loginTime.put(phone, System.currentTimeMillis()); |
| | | } |
| | | return ResultUtil.error("密码错误"); |
| | | } |
| | | |
| | |
| | | loginWarpper.setId(driver.getId()); |
| | | loginWarpper.setToken(token); |
| | | loginWarpper.setAppid(UUIDUtil.getRandomCode()); |
| | | loginWarpper.setState(ToolUtil.isEmpty(driver.getIdCard()) ? 1 : 0); |
| | | |
| | | //创建高德猎鹰的终端数据 |
| | | String tid = gdFalconUtil.createTerminal(phone); |
| | |
| | | */ |
| | | @Override |
| | | public Map<String, Object> queryHomeData(Integer uid) throws Exception { |
| | | Map<String, Object> map = this.baseMapper.queryHomeData(uid); |
| | | Map<String, Object> map = driverMapper.queryHomeData(uid); |
| | | int size = this.queryMyActivity(uid, new Date()).size(); |
| | | map.put("activity", size); |
| | | return map; |
| | |
| | | } |
| | | }).start(); |
| | | }else{ |
| | | List<Driver> drivers = this.selectList(new EntityWrapper<Driver>().eq("carId", driver.getCarId()).eq("authState", 2).ne("flag", 3).ne("id", uid)); |
| | | for (Driver d : drivers){ |
| | | driverWork = driverWorkMapper.queryNewWork(d.getId(), null, 1); |
| | | if(null != driverWork){ |
| | | return ResultUtil.error("车辆正在使用中"); |
| | | } |
| | | } |
| | | driverWork = new DriverWork(); |
| | | driverWork.setState(1); |
| | | driverWork.setDriverId(uid); |
| | |
| | | @Override |
| | | public Map<String, Object> queryHomeNum(Integer uid) throws Exception { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //出租车 |
| | | List<Map<String, Object>> list = orderTaxiService.queryOrderList(1, uid); |
| | | map.put("service", list.size());//服务中 |
| | | list = orderTaxiService.queryOrderList(2, uid); |
| | |
| | | List<DriverService> list = driverServiceMapper.queryMyBusiness(uid); |
| | | List<BaseWarpper> maps = new ArrayList<>(); |
| | | for (DriverService d : list){ |
| | | if(d.getType() == 6){ |
| | | continue; |
| | | } |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | baseWarpper.setId(d.getType()); |
| | | switch (d.getType()){ |
| | | case 1: |
| | | baseWarpper.setName("快车/专车"); |
| | | baseWarpper.setName("专车"); |
| | | break; |
| | | case 2: |
| | | baseWarpper.setName("出租车"); |
| | | break; |
| | | case 3: |
| | | baseWarpper.setName("机场专线"); |
| | | baseWarpper.setName("跨城出行"); |
| | | break; |
| | | case 7: |
| | | baseWarpper.setName("景区直通车"); |
| | | case 4: |
| | | baseWarpper.setName("同城小件物流"); |
| | | break; |
| | | case 8: |
| | | baseWarpper.setName("公务出行"); |
| | | case 5: |
| | | baseWarpper.setName("跨城小件物流"); |
| | | break; |
| | | } |
| | | maps.add(baseWarpper); |
| | |
| | | if(null != driver){ |
| | | return ResultUtil.error("电话号码已被注册"); |
| | | } |
| | | phone = AESUtil.decrypt(phone); |
| | | boolean b = this.checkCaptcha(phone, code); |
| | | if(!b){ |
| | | return ResultUtil.error("验证码无效"); |
| | | } |
| | | String encrypt = AESUtil.encrypt(phone); |
| | | Driver driver1 = this.selectById(uid); |
| | | driver1.setAccount(phone); |
| | | driver1.setPhone(phone); |
| | | driver1.setAccount(encrypt); |
| | | driver1.setPhone(encrypt); |
| | | this.updateById(driver1); |
| | | |
| | | smsrecordService.saveData(7, phone, code, "短信验证码【" + code + "】已发到您的手机,验证码将在5分钟后失效,请及时登录!"); |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public synchronized ResultUtil replaceCar(Integer carId, Integer uid) throws Exception { |
| | | public ResultUtil replaceCar(Integer carId, Integer uid) throws Exception { |
| | | Driver driver = this.selectById(uid); |
| | | if(driver.getState() == 3){ |
| | | return ResultUtil.error("还在服务中,不能更换"); |
| | | } |
| | | // boolean idle = carService.idle(carId); |
| | | // if(!idle){ |
| | | // return ResultUtil.error("车辆已被绑定了"); |
| | | // } |
| | | boolean idle = carService.idle(carId); |
| | | if(!idle){ |
| | | return ResultUtil.error("车辆已被绑定了"); |
| | | } |
| | | driver.setCarId(carId); |
| | | this.updateById(driver); |
| | | return ResultUtil.success(); |
| | |
| | | } |
| | | switch (driverActivityOnline.getType()){ |
| | | case 1: |
| | | sb.append("快车"); |
| | | sb.append("专车"); |
| | | break; |
| | | case 2: |
| | | sb.append("出租车"); |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public ResultUtil getMoneyReceivingQRCode(Integer driverId) throws Exception { |
| | | Driver driver = this.selectById(driverId); |
| | | if(ToolUtil.isEmpty(driver.getMchtNo())){ |
| | | return ResultUtil.error("请先开通收款账户"); |
| | | } |
| | | String path = "https://okyueche.com:8443/h5/index.html?driverid=" + driverId; |
| | | return ResultUtil.success(path); |
| | | } |
| | | |
| | | /** |
| | | * 获取编号 |
| | | * @return |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.OfflineTravelPaymentMapper; |
| | | import com.stylefeng.guns.modular.system.model.OfflineTravelPayment; |
| | | import com.stylefeng.guns.modular.system.service.IOfflineTravelPaymentService; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class OfflineTravelPaymentServiceImpl extends ServiceImpl<OfflineTravelPaymentMapper, OfflineTravelPayment> implements IOfflineTravelPaymentService { |
| | | |
| | | @Override |
| | | public List<BaseWarpper> queryOfflineTravelPaymentList(Integer driverId, String start, String end, Integer pageNum, Integer size) throws Exception { |
| | | pageNum = (pageNum - 1) * size; |
| | | return this.baseMapper.queryOfflineTravelPaymentList(driverId, start, end, pageNum, size); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Double getTotalMoney(Integer driverId, String start, String end) throws Exception{ |
| | | return this.baseMapper.getTotalMoney(driverId, start, end); |
| | | } |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.call.model.OrderCall; |
| | | import com.stylefeng.guns.modular.call.server.IOrderCallService; |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; |
| | |
| | | import com.stylefeng.guns.modular.system.dao.PhoneMapper; |
| | | import com.stylefeng.guns.modular.system.dao.RegionMapper; |
| | | import com.stylefeng.guns.modular.system.dao.SysReformistMapper; |
| | | import com.stylefeng.guns.modular.system.model.AdditionalFee; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.OrderPosition; |
| | | import com.stylefeng.guns.modular.system.model.Region; |
| | | import com.stylefeng.guns.modular.system.service.IAdditionalFeeService; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IOrderService; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.system.warpper.BaseWarpper; |
| | | import com.stylefeng.guns.modular.system.warpper.OrderListWarpper; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | |
| | | |
| | | @Autowired |
| | | private PushMinistryOfTransportUtil pushMinistryOfTransportUtil; |
| | | |
| | | @Autowired |
| | | private IOrderCallService orderCallService; |
| | | |
| | | @Autowired |
| | | private IAdditionalFeeService additionalFeeService; |
| | | |
| | | |
| | | |
| | |
| | | datas.addAll(list2); |
| | | //小件物流 |
| | | List<Map<String, Object>> list3 = orderLogisticsService.queryMyAllOrder(state, uid); |
| | | for (Map<String, Object> map : list3) { |
| | | if (ToolUtil.isNotEmpty(map.get("endServiceTime")) && ToolUtil.isNotEmpty(map.get("arriveTimeExpects"))){ |
| | | if (DateUtil.parseTime(map.get("endServiceTime").toString()).getTime() > DateUtil.parseTime(map.get("arriveTimeExpects").toString()).getTime()){ |
| | | map.put("timeOutState",1); |
| | | }else { |
| | | map.put("timeOutState",2); |
| | | } |
| | | }else { |
| | | map.put("timeOutState",2); |
| | | } |
| | | } |
| | | datas.addAll(list3); |
| | | |
| | | List<OrderListWarpper> orderListWarpper = OrderListWarpper.getOrderListWarpper(datas); |
| | |
| | | |
| | | /** |
| | | * 获取司机端我的订单列表 |
| | | * @param state 1=全部,2=待支付,3=已取消,4=已完成 |
| | | * @param pageNum |
| | | * @param size |
| | | * @param uid |
| | |
| | | map.put("startDistance", ToolUtil.isNotEmpty(distance) ? Double.valueOf(distance) / 1000 : 0); |
| | | |
| | | //总距离 |
| | | String end = String.valueOf(map.get("endLon")) + "," + String.valueOf(map.get("endLat")); |
| | | distance = gdMapElectricFenceUtil.getDistance(end, order, 1).get("distance"); |
| | | map.put("totalDistance", ToolUtil.isNotEmpty(distance) ? Double.valueOf(distance) / 1000 : 0); |
| | | if(null == map.get("endLon")){ |
| | | map.put("totalDistance", 0); |
| | | }else{ |
| | | String end = String.valueOf(map.get("endLon")) + "," + String.valueOf(map.get("endLat")); |
| | | distance = gdMapElectricFenceUtil.getDistance(end, order, 1).get("distance"); |
| | | map.put("totalDistance", ToolUtil.isNotEmpty(distance) ? Double.valueOf(distance) / 1000 : 0); |
| | | } |
| | | |
| | | Integer orderSource = Integer.valueOf(String.valueOf(map.get("orderSource"))); |
| | | if(orderSource == 1 || orderSource == 2 || orderSource == 3){ |
| | |
| | | if(Integer.valueOf(String.valueOf(map.get("orderType"))) == 2 && Integer.valueOf(String.valueOf(map.get("isReassign"))) == 2){ |
| | | map.put("type", "改派"); |
| | | } |
| | | } |
| | | if(orderSource == 6){ |
| | | map.put("type", "乘客下单"); |
| | | } |
| | | break; |
| | | case 2://出租 |
| | |
| | | Map<String, Object> map = null; |
| | | switch (orderType){ |
| | | case 1://专车 |
| | | map = orderPrivateCarService.queryOrderInfo2(orderId); |
| | | map = orderPrivateCarService.queryOrderInfo(orderId); |
| | | break; |
| | | case 2://出租 |
| | | map = orderTaxiService.queryOrderInfo(orderId); |
| | |
| | | map = orderLogisticsService.queryOrderInfo(orderId); |
| | | break; |
| | | case 6: |
| | | break; |
| | | case 7: |
| | | map = orderPrivateCarService.queryOrderInfo(orderId); |
| | | break; |
| | | } |
| | | if(null != map.get("telX")){ |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil process(Integer orderId, Integer orderType, Integer state, Integer uid, Double lon, Double lat, String driverImg) throws Exception { |
| | | public ResultUtil process(Integer orderId, Integer orderType, Integer state, Integer uid, Double lon, Double lat) throws Exception { |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(String.valueOf(lon), String.valueOf(lat)); |
| | | String address = geocode.get("address"); |
| | | switch (orderType){ |
| | |
| | | case 3://城际 |
| | | return orderCrossCityService.process(orderId, state, lon, lat, address); |
| | | case 4://同城小件 |
| | | return orderLogisticsService.process(orderId, state, lon, lat, address, driverImg); |
| | | return orderLogisticsService.process(orderId, state, lon, lat, address); |
| | | case 5://跨城小件 |
| | | return orderLogisticsService.process(orderId, state, lon, lat, address, driverImg); |
| | | return orderLogisticsService.process(orderId, state, lon, lat, address); |
| | | case 6: |
| | | break; |
| | | } |
| | |
| | | } |
| | | return null; |
| | | } |
| | | @Override |
| | | public ResultUtil cancleOrder(Integer orderId, Integer orderType) throws Exception { |
| | | switch (orderType){ |
| | | case 1://专车 |
| | | return orderPrivateCarService.cancleOrder(orderId); |
| | | case 2://出租 |
| | | break; |
| | | case 3://城际(没有此流程) |
| | | break; |
| | | case 4:// |
| | | break; |
| | | case 5: |
| | | break; |
| | | case 6: |
| | | break; |
| | | } |
| | | return null; |
| | | } |
| | | @Override |
| | | public ResultUtil updatePeopleNum(Integer orderId, Integer peopleNum) throws Exception { |
| | | return orderPrivateCarService.updatePeopleNum(orderId,peopleNum); |
| | | } |
| | | @Override |
| | | public ResultUtil confirmFees1(Integer orderId, Integer orderType, Integer type, Double travelFee, String additionalFee) throws Exception { |
| | | switch (orderType){ |
| | | case 1://专车 |
| | | return orderPrivateCarService.confirmFees1(orderId, type, additionalFee); |
| | | case 2://出租 |
| | | return orderTaxiService.confirmFees1(orderId, type, travelFee, additionalFee); |
| | | case 3://城际(没有此流程) |
| | | break; |
| | | case 4:// |
| | | break; |
| | | case 5: |
| | | break; |
| | | case 6: |
| | | break; |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 确认费用(车载端) |
| | |
| | | @Override |
| | | public Integer queryOrderNum(Integer driverId, Date start, Date end) throws Exception { |
| | | //出租车 |
| | | Integer[] state = new Integer[]{8, 9}; |
| | | int i = orderTaxiService.selectCount(new EntityWrapper<OrderTaxi>().eq("driverId", driverId).ne("payManner",2).between("insertTime", start, end).in("state", state)); |
| | | Integer[] state = new Integer[]{6, 7, 8, 9}; |
| | | int i = orderTaxiService.selectCount(new EntityWrapper<OrderTaxi>().eq("driverId", driverId).between("insertTime", start, end).in("state", state)); |
| | | return i; |
| | | } |
| | | |
| | |
| | | |
| | | Integer muoth = Long.valueOf((orderTaxi.getTravelTime().getTime() - System.currentTimeMillis()) / (1000 * 60)).intValue(); |
| | | //发送短信提醒 |
| | | aLiSendSms.sendSms(driver.getPhone(), "SMS_229613325", "{\"data\":\"" + orderTaxi.getStartAddress() + "\",\"data1\":\"" + orderTaxi.getEndAddress() + "\",\"data2\":\"" + muoth + "\"}"); |
| | | aLiSendSms.sendSms(driver.getPhone(), "SMS_207522070", "{\"data\":\"" + orderTaxi.getStartAddress() + "\",\"data1\":\"" + orderTaxi.getEndAddress() + "\",\"data2\":\"" + muoth + "\"}"); |
| | | } |
| | | //专车 |
| | | List<OrderPrivateCar> list1 = orderPrivateCarService.queryMaturity(); |
| | |
| | | |
| | | Integer muoth = Long.valueOf((orderPrivateCar.getTravelTime().getTime() - System.currentTimeMillis()) / (1000 * 60)).intValue(); |
| | | //发送短信提醒 |
| | | aLiSendSms.sendSms(driver.getPhone(), "SMS_229613325", "{\"data\":\"" + orderPrivateCar.getStartAddress() + "\",\"data1\":\"" + orderPrivateCar.getEndAddress() + "\",\"data2\":\"" + muoth + "\"}"); |
| | | aLiSendSms.sendSms(driver.getPhone(), "SMS_207522070", "{\"data\":\"" + orderPrivateCar.getStartAddress() + "\",\"data1\":\"" + orderPrivateCar.getEndAddress() + "\",\"data2\":\"" + muoth + "\"}"); |
| | | } |
| | | //跨城 |
| | | List<OrderCrossCity> orderCrossCities = orderCrossCityService.queryMaturity(); |
| | |
| | | |
| | | Integer muoth = Long.valueOf((orderCrossCity.getTravelTime().getTime() - System.currentTimeMillis()) / (1000 * 60)).intValue(); |
| | | //发送短信提醒 |
| | | aLiSendSms.sendSms(driver.getPhone(), "SMS_229613325", "{\"data\":\"" + orderCrossCity.getStartAddress() + "\",\"data1\":\"" + orderCrossCity.getEndAddress() + "\",\"data2\":\"" + muoth + "\"}"); |
| | | aLiSendSms.sendSms(driver.getPhone(), "SMS_207522070", "{\"data\":\"" + orderCrossCity.getStartAddress() + "\",\"data1\":\"" + orderCrossCity.getEndAddress() + "\",\"data2\":\"" + muoth + "\"}"); |
| | | } |
| | | //小件物流 |
| | | List<OrderLogistics> orderLogistics = orderLogisticsService.queryMaturity(); |
| | |
| | | |
| | | Integer muoth = Long.valueOf((orderLogistics1.getTravelTime().getTime() - System.currentTimeMillis()) / (1000 * 60)).intValue(); |
| | | //发送短信提醒 |
| | | aLiSendSms.sendSms(driver.getPhone(), "SMS_229613325", "{\"data\":\"" + orderLogistics1.getStartAddress() + "\",\"data1\":\"" + orderLogistics1.getEndAddress() + "\",\"data2\":\"" + muoth + "\"}"); |
| | | aLiSendSms.sendSms(driver.getPhone(), "SMS_207522070", "{\"data\":\"" + orderLogistics1.getStartAddress() + "\",\"data1\":\"" + orderLogistics1.getEndAddress() + "\",\"data2\":\"" + muoth + "\"}"); |
| | | } |
| | | if(drivers.size() > 0){ |
| | | driverService.updateBatchById(drivers);//批量修改状态为服务中 |
| | |
| | | public void taskMidAxbUnBindSend() throws Exception { |
| | | List<OrderTaxi> list = orderTaxiService.taskMidAxbUnBindSend(); |
| | | for(OrderTaxi orderTaxi : list){ |
| | | Map<String, String> map = chinaMobileUtil.midAxbUnBindSend(orderTaxi.getBindId(), orderTaxi.getTelX(), (System.currentTimeMillis() + 600000)); |
| | | Map<String, String> map = chinaMobileUtil.midAxbUnBindSend(orderTaxi.getBindId()); |
| | | if(!String.valueOf(map.get("code")).equals("200")){ |
| | | System.err.println(String.valueOf(map.get("msg"))); |
| | | } |
| | |
| | | } |
| | | if(list.size() > 0){ |
| | | orderTaxiService.updateBatchById(list); |
| | | } |
| | | |
| | | List<OrderPrivateCar> list1 = orderPrivateCarService.taskMidAxbUnBindSend(); |
| | | for(OrderPrivateCar orderTaxi : list1){ |
| | | Map<String, String> map = chinaMobileUtil.midAxbUnBindSend(orderTaxi.getBindId(), orderTaxi.getTelX(), (System.currentTimeMillis() + 600000)); |
| | | if(!String.valueOf(map.get("code")).equals("200")){ |
| | | System.err.println(String.valueOf(map.get("msg"))); |
| | | } |
| | | orderTaxi.setTelX(""); |
| | | orderTaxi.setBindId(""); |
| | | } |
| | | if(list1.size() > 0){ |
| | | orderPrivateCarService.updateBatchById(list1); |
| | | } |
| | | |
| | | List<OrderCrossCity> orderCrossCities = orderCrossCityService.taskMidAxbUnBindSend(); |
| | | for(OrderCrossCity orderTaxi : orderCrossCities){ |
| | | Map<String, String> map = chinaMobileUtil.midAxbUnBindSend(orderTaxi.getBindId(), orderTaxi.getTelX(), (System.currentTimeMillis() + 600000)); |
| | | if(!String.valueOf(map.get("code")).equals("200")){ |
| | | System.err.println(String.valueOf(map.get("msg"))); |
| | | } |
| | | orderTaxi.setTelX(""); |
| | | orderTaxi.setBindId(""); |
| | | } |
| | | if(orderCrossCities.size() > 0){ |
| | | orderCrossCityService.updateBatchById(orderCrossCities); |
| | | } |
| | | |
| | | List<OrderLogistics> orderLogistics = orderLogisticsService.taskMidAxbUnBindSend(); |
| | | for(OrderLogistics orderTaxi : orderLogistics){ |
| | | Map<String, String> map = chinaMobileUtil.midAxbUnBindSend(orderTaxi.getBindId(), orderTaxi.getTelX(), (System.currentTimeMillis() + 600000)); |
| | | if(!String.valueOf(map.get("code")).equals("200")){ |
| | | System.err.println(String.valueOf(map.get("msg"))); |
| | | } |
| | | orderTaxi.setTelX(""); |
| | | orderTaxi.setBindId(""); |
| | | } |
| | | if(orderLogistics.size() > 0){ |
| | | orderLogisticsService.updateBatchById(orderLogistics); |
| | | } |
| | | } |
| | | |
| | |
| | | case 1: |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); |
| | | if(ToolUtil.isNotEmpty(orderPrivateCar.getBindId())){ |
| | | Map<String, String> map1 = chinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId(), orderPrivateCar.getTelX(), (System.currentTimeMillis() + 600000)); |
| | | Map<String, String> map1 = chinaMobileUtil.midAxbUnBindSend(orderPrivateCar.getBindId()); |
| | | if(!String.valueOf(map1.get("code")).equals("200")){ |
| | | System.err.println(String.valueOf(map1.get("msg"))); |
| | | } |
| | | //调用移动的小号接口 |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderPrivateCar.getStartLon().toString(), orderPrivateCar.getStartLat().toString()); |
| | | Region region = regionMapper.query(geocode.get("districtCode")); |
| | | Driver driver = driverService.selectById(orderPrivateCar.getDriverId()); |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderPrivateCar.getPassengersPhone(), driver.getPhone(), Integer.valueOf(region.getCitycode().substring(1))); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderPrivateCar.setTelX(map.get("telX")); |
| | | orderPrivateCar.setBindId(map.get("bindId")); |
| | |
| | | case 2: |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(orderId); |
| | | if(ToolUtil.isNotEmpty(orderTaxi.getBindId())){ |
| | | Map<String, String> map1 = chinaMobileUtil.midAxbUnBindSend(orderTaxi.getBindId(), orderTaxi.getTelX(), (System.currentTimeMillis() + 600000)); |
| | | Map<String, String> map1 = chinaMobileUtil.midAxbUnBindSend(orderTaxi.getBindId()); |
| | | if(!String.valueOf(map1.get("code")).equals("200")){ |
| | | System.err.println(String.valueOf(map1.get("msg"))); |
| | | } |
| | | //调用移动的小号接口 |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | | Region region = regionMapper.query(geocode.get("districtCode")); |
| | | Driver driver = driverService.selectById(orderTaxi.getDriverId()); |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderTaxi.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderTaxi.getPassengersPhone(), driver.getPhone(), Integer.valueOf(region.getCitycode().substring(1))); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderTaxi.setTelX(map.get("telX")); |
| | | orderTaxi.setBindId(map.get("bindId")); |
| | |
| | | case 3: |
| | | OrderCrossCity orderCrossCity = orderCrossCityService.selectById(orderId); |
| | | if(ToolUtil.isNotEmpty(orderCrossCity.getBindId())){ |
| | | Map<String, String> map1 = chinaMobileUtil.midAxbUnBindSend(orderCrossCity.getBindId(), orderCrossCity.getTelX(), (System.currentTimeMillis() + 600000)); |
| | | Map<String, String> map1 = chinaMobileUtil.midAxbUnBindSend(orderCrossCity.getBindId()); |
| | | if(!String.valueOf(map1.get("code")).equals("200")){ |
| | | System.err.println(String.valueOf(map1.get("msg"))); |
| | | } |
| | | //调用移动的小号接口 |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderCrossCity.getStartLon().toString(), orderCrossCity.getStartLat().toString()); |
| | | Region region = regionMapper.query(geocode.get("districtCode")); |
| | | Driver driver = driverService.selectById(orderCrossCity.getDriverId()); |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderCrossCity.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderCrossCity.getPassengersPhone(), driver.getPhone(), Integer.valueOf(region.getCitycode().substring(1))); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderCrossCity.setTelX(map.get("telX")); |
| | | orderCrossCity.setBindId(map.get("bindId")); |
| | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public List<BaseWarpper> queryAdditionalFee(Integer orderType, Integer orderId, Integer uid) throws Exception { |
| | | Integer companyId = null; |
| | | if(orderType == 1){//专车 |
| | | OrderPrivateCar orderPrivateCar = orderPrivateCarService.selectById(orderId); |
| | | companyId = orderPrivateCar.getCompanyId(); |
| | | } |
| | | if(orderType == 2){//出租车 |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(orderId); |
| | | companyId = orderTaxi.getCompanyId(); |
| | | } |
| | | if(orderType == 3){//跨城出行 |
| | | Driver driver = driverService.selectById(uid); |
| | | companyId = driver.getCompanyId(); |
| | | } |
| | | if(orderType == 4){//同城小件 |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId); |
| | | companyId = orderLogistics.getCompanyId(); |
| | | } |
| | | if(orderType == 5){//跨城小件 |
| | | OrderLogistics orderLogistics = orderLogisticsService.selectById(orderId); |
| | | companyId = orderLogistics.getCompanyId(); |
| | | } |
| | | if(orderType == 6){//包车 |
| | | } |
| | | if(orderType == 7){//助老模式 |
| | | OrderCall orderCall = orderCallService.selectById(orderId); |
| | | companyId = orderCall.getCompanyId(); |
| | | } |
| | | List<AdditionalFee> additionalFees = additionalFeeService.selectList(new EntityWrapper<AdditionalFee>().eq("companyId", companyId).eq("state", 1)); |
| | | List<BaseWarpper> list = new ArrayList<>(); |
| | | additionalFees.forEach(additionalFee -> { |
| | | BaseWarpper baseWarpper = new BaseWarpper(); |
| | | baseWarpper.setId(additionalFee.getId()); |
| | | baseWarpper.setName(additionalFee.getName()); |
| | | list.add(baseWarpper); |
| | | }); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public ResultUtil saveData(Reassign reassign, Integer uid, Integer type) throws Exception { |
| | | type = null == type ? 2 : type;//现目前微信只支持小程序支付 |
| | | String content = reassign.getRemark(); |
| | | if(ToolUtil.isNotEmpty(content)){ |
| | | List<SensitiveWords> sensitiveWords = sensitiveWordsMapper.selectList(null); |
| | |
| | | reassign.setRemark(content); |
| | | ResultUtil resultUtil = ResultUtil.success(); |
| | | Driver driver = driverService.selectById(uid); |
| | | // TODO: 2020/11/12 司机端不控制重复提交(如果重复提交且未支付,直接将之前的数据删除) |
| | | // Reassign query = reassignMapper.query(uid, null, null, null, 1); |
| | | // if(null != query){ |
| | | // return ResultUtil.error("有未完成支付的改派申请"); |
| | | // } |
| | | Reassign query = reassignMapper.query(uid, null, reassign.getOrderId(), reassign.getOrderType(), 1); |
| | | if(null != query){ |
| | | // return ResultUtil.error("不能重复提交申请"); |
| | | reassignMapper.deleteById(query.getId()); |
| | | } |
| | | query = reassignMapper.query(uid, null, reassign.getOrderId(), reassign.getOrderType(), 2); |
| | |
| | | reassign.setInsertTime(new Date()); |
| | | this.insert(reassign); |
| | | |
| | | systemNoticeService.addSystemNotice(2, "您的改派申请已成功提交,我们会尽快为你处理!", uid, 1); |
| | | systemNoticeService.addSystemNotice(2, "您的改派申请已成功提交,我们会尽快为你处理!", uid); |
| | | |
| | | //开始支付 |
| | | if(null != reassign.getPayType()){ |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String out_trade_no = sdf.format(new Date()) + reassign.getOrderType() + reassign.getId(); |
| | | |
| | | if(reassign.getPayType() == 1){//微信支付 |
| | | reassign.setState(1); |
| | | |
| | | resultUtil = payMoneyUtil.weixinpay("改派订单", "", reassign.getId() + "_" + reassign.getOrderType() + "_" + UUIDUtil.getRandomCode(5), aDouble.toString(), "/base/wxReassign", "APP"); |
| | | paymentRecordService.saveData(1, uid, 2, reassign.getOrderId(), reassign.getOrderType(), 1, aDouble, "", 1);//添加预支付数据 |
| | | String appletsOpenId = ""; |
| | | String tradeType = "APP"; |
| | | resultUtil = payMoneyUtil.weixinpay("改派订单", "", out_trade_no, aDouble.toString(), callbackPath + "/base/wxReassign", tradeType, appletsOpenId, ""); |
| | | } |
| | | if(reassign.getPayType() == 2){//支付宝 |
| | | reassign.setState(1); |
| | | resultUtil = payMoneyUtil.alipay("改派订单", "改派订单", "", reassign.getId() + "_" + reassign.getOrderType() + "_" + UUIDUtil.getRandomCode(5), aDouble.toString(), "/base/aliReassign"); |
| | | paymentRecordService.saveData(1, uid, 2, reassign.getOrderId(), reassign.getOrderType(), 2, aDouble, "", 1);//添加预支付数据 |
| | | resultUtil = payMoneyUtil.alipay("改派订单", "支付订单", out_trade_no, aDouble.toString(), callbackPath + "/base/aliReassign"); |
| | | } |
| | | if(reassign.getPayType() == 3){//余额 |
| | | reassign.setState(2); |
| | |
| | | break; |
| | | } |
| | | |
| | | systemNoticeService.addSystemNotice(2, "您已使用余额成功支付改派申请费用!", uid, 1); |
| | | systemNoticeService.addSystemNotice(2, "您已使用余额成功支付改派申请费用!", uid); |
| | | //开始推送调度单 |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("orderId", reassign.getOrderId().toString()); |
| | |
| | | ids += reassign.getId() + ","; |
| | | } |
| | | ids = ids.substring(0, ids.length() - 1); |
| | | systemNoticeService.addSystemNotice(2, "您的改派申请已成功提交,我们会尽快为你处理!", uid, 1); |
| | | systemNoticeService.addSystemNotice(2, "您的改派申请已成功提交,我们会尽快为你处理!", uid); |
| | | |
| | | //开始支付 |
| | | if(null != reassign.getPayType()){ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String out_trade_no = sdf.format(new Date()) + 3 + ids; |
| | | |
| | | if(reassign.getPayType() == 1){//微信支付 |
| | | String[] split1 = ids.split(","); |
| | | |
| | | resultUtil = payMoneyUtil.weixinpay("改派订单", "", ids + "_3_" + UUIDUtil.getRandomCode(5), totalMoney.toString(), "/base/wxReassign", "APP"); |
| | | for(String id : split1){ |
| | | paymentRecordService.saveData(1, uid, 2, Integer.valueOf(id), 3, 1, aDouble, "", 1);//添加预支付数据 |
| | | String appletsOpenId = ""; |
| | | String tradeType = "APP"; |
| | | resultUtil = payMoneyUtil.weixinpay("改派订单", "", out_trade_no, totalMoney.toString(), callbackPath + "/base/wxReassign", tradeType, appletsOpenId, ""); |
| | | if(resultUtil.getCode() == 200){ |
| | | for(String id : split1){ |
| | | paymentRecordService.saveData(1, uid, 2, Integer.valueOf(id), 3, 1, aDouble, "", 1);//添加预支付数据 |
| | | } |
| | | } |
| | | |
| | | // Map<String, String> map = icbcPayUtil.placeAnOrder(ids + "_3", 9, 5, uid.toString(), "改派订单", totalMoney, callbackPath + "/base/wxReassign", "", type, driver.getAppletsOpenId()); |
| | | // if(map.get("code").equals("200")){ |
| | | // for(String id : split1){ |
| | | // paymentRecordService.saveData(1, uid, 2, Integer.valueOf(id), 3, 1, aDouble, map.get("order_id"), 1);//添加预支付数据 |
| | | // } |
| | | // resultUtil = ResultUtil.success(map.get("data")); |
| | | // }else{ |
| | | // resultUtil = ResultUtil.error(map.get("msg"), ""); |
| | | // } |
| | | } |
| | | if(reassign.getPayType() == 2){//支付宝 |
| | | String[] split1 = ids.split(","); |
| | | resultUtil = payMoneyUtil.alipay("改派订单", "改派订单", "", ids + "_3_" + UUIDUtil.getRandomCode(5), totalMoney.toString(), "/base/aliReassign"); |
| | | for(String id : split1){ |
| | | paymentRecordService.saveData(1, uid, 2, Integer.valueOf(id), 3, 2, aDouble, "", 1);//添加预支付数据 |
| | | resultUtil = payMoneyUtil.alipay("改派订单", "支付订单", out_trade_no, totalMoney.toString(), callbackPath + "/base/aliReassign"); |
| | | if(resultUtil.getCode() == 200){ |
| | | for(String id : split1){ |
| | | paymentRecordService.saveData(1, uid, 2, Integer.valueOf(id), 3, 2, aDouble, "", 1);//添加预支付数据 |
| | | } |
| | | } |
| | | |
| | | |
| | | // Map<String, String> map = icbcPayUtil.placeAnOrder(ids + "_3", 10, 5, uid.toString(), "改派订单", totalMoney, callbackPath + "/base/aliReassign", "", 2, ""); |
| | | // if(map.get("code").equals("200")){ |
| | | // for(String id : split1){ |
| | | // paymentRecordService.saveData(1, uid, 2, Integer.valueOf(id), 3, 2, aDouble, map.get("order_id"), 1);//添加预支付数据 |
| | | // } |
| | | // resultUtil = ResultUtil.success(map.get("data")); |
| | | // }else{ |
| | | // resultUtil = ResultUtil.error(map.get("msg"), ""); |
| | | // } |
| | | } |
| | | if(reassign.getPayType() == 3){//余额 |
| | | for(String id : split){ |
| | |
| | | transactionDetailsService.saveData(uid, "司机改派支付", aDouble, 2, 1, 2, 3, Integer.valueOf(id)); |
| | | } |
| | | Double balance = driver.getBalance(); |
| | | Double laveBusinessMoney = driver.getLaveBusinessMoney(); |
| | | Double laveActivityMoney = driver.getLaveActivityMoney(); |
| | | if(null == balance || balance < totalMoney){ |
| | | throw new SystemException("账户余额不足"); |
| | | } |
| | | if(null != laveBusinessMoney && laveBusinessMoney.compareTo(totalMoney) >= 0){ |
| | | driver.setLaveBusinessMoney(new BigDecimal(laveBusinessMoney).subtract(new BigDecimal(totalMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | }else if(null != laveActivityMoney && laveActivityMoney.compareTo(totalMoney) >= 0){ |
| | | driver.setLaveActivityMoney(new BigDecimal(laveActivityMoney).subtract(new BigDecimal(totalMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | } |
| | | driver.setBalance(new BigDecimal(balance).subtract(new BigDecimal(totalMoney)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | |
| | | //添加已收入明细 |
| | | incomeService.saveData(1, orderCrossCity.getCompanyId(), 4, orderCrossCity.getId(), 3, reassign.getMoney()); |
| | | } |
| | | systemNoticeService.addSystemNotice(2, "您已使用余额成功支付改派申请费用!", uid, 1); |
| | | systemNoticeService.addSystemNotice(2, "您已使用余额成功支付改派申请费用!", uid); |
| | | //开始推送调度单 |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("orderId", reassign.getOrderId().toString()); |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public void payReassign(String id, String order_id, Integer type) throws Exception { |
| | | String[] s = id.split("_"); |
| | | if(Integer.valueOf(s[1]) == 3){//跨城订单 |
| | | String[] split = s[0].split(","); |
| | | public void payReassign(String id, Integer orderType, String order_id, Integer type) throws Exception { |
| | | String[] split = id.split(","); |
| | | if(orderType == 3){//跨城订单 |
| | | List<Reassign> reassigns = this.selectBatchIds(Arrays.asList(split)); |
| | | Driver driver = driverService.selectById(reassigns.get(0).getOriginalDriverId()); |
| | | for(String key : split){ |
| | |
| | | //添加已收入明细 |
| | | incomeService.saveData(1, orderCrossCity1.getCompanyId(), 4, orderCrossCity1.getId(), 3, reassign.getMoney()); |
| | | } |
| | | systemNoticeService.addSystemNotice(2, "您已使用" + (type == 1 ? "微信" : "支付宝") + "成功支付改派申请费用!", reassigns.get(0).getOriginalDriverId(), 1); |
| | | systemNoticeService.addSystemNotice(2, "您已使用" + (type == 1 ? "微信" : "支付宝") + "成功支付改派申请费用!", reassigns.get(0).getOriginalDriverId()); |
| | | |
| | | }else{ |
| | | System.err.println("预支付数据异常(orderId = " + id + ")"); |
| | |
| | | |
| | | |
| | | }else{//其他订单 |
| | | Reassign reassign = this.selectById(s[0]); |
| | | Reassign reassign = this.selectById(split[0]); |
| | | Driver driver = driverService.selectById(reassign.getOriginalDriverId()); |
| | | PaymentRecord query = paymentRecordService.query(1, driver.getId(), 2, reassign.getOrderId(), reassign.getOrderType(), type, 1); |
| | | if(null != query){ |
| | |
| | | incomeService.saveData(1, orderLogistics1.getCompanyId(), 4, orderLogistics1.getId(), 5, reassign.getMoney()); |
| | | break; |
| | | } |
| | | systemNoticeService.addSystemNotice(2, "您已使用" + (type == 1 ? "微信" : "支付宝") + "成功支付改派申请费用!", reassign.getOriginalDriverId(), 1); |
| | | systemNoticeService.addSystemNotice(2, "您已使用" + (type == 1 ? "微信" : "支付宝") + "成功支付改派申请费用!", reassign.getOriginalDriverId()); |
| | | //开始推送调度单 |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("orderId", reassign.getOrderId().toString()); |
| | |
| | | |
| | | |
| | | @Override |
| | | public void addSystemNotice(Integer userType, String content, Integer userId, Integer noticeType) throws Exception { |
| | | public void addSystemNotice(Integer userType, String content, Integer userId) throws Exception { |
| | | SystemNotice systemNotice = new SystemNotice(); |
| | | systemNotice.setContent(content); |
| | | systemNotice.setInsertTime(new Date()); |
| | |
| | | systemNotice.setType(2); |
| | | systemNotice.setUserId(userId); |
| | | systemNotice.setUserType(userType); |
| | | systemNotice.setNoticeType(noticeType); |
| | | this.insert(systemNotice); |
| | | } |
| | | |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.system.dao.UserInfoMapper; |
| | | import com.stylefeng.guns.modular.system.dao.WithdrawalMapper; |
| | | import com.stylefeng.guns.modular.system.model.BankCard; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.SysWithdrawalPoundage; |
| | | import com.stylefeng.guns.modular.system.model.UserInfo; |
| | | import com.stylefeng.guns.modular.system.model.Withdrawal; |
| | | import com.stylefeng.guns.modular.system.service.IBankCardService; |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.ISysWithdrawalPoundageService; |
| | | import com.stylefeng.guns.modular.system.service.IWithdrawalService; |
| | | import com.stylefeng.guns.modular.system.util.ICBCPayUtil; |
| | | import com.stylefeng.guns.modular.system.util.PayMoneyUtil; |
| | | import com.stylefeng.guns.modular.system.util.LiuZhouBank.ProtocolSignUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpEntity; |
| | |
| | | private ICBCPayUtil icbcPayUtil; |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | |
| | | @Autowired |
| | | private RestTemplate internalRestTemplate; |
| | | |
| | | @Autowired |
| | | private ISysWithdrawalPoundageService sysWithdrawalPoundageService; |
| | | private IBankCardService bankCardService; |
| | | |
| | | |
| | | |
| | |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public ResultUtil withdrawal(Double money, String bankName, String code, String name, Integer uid, Integer type) throws Exception { |
| | | public ResultUtil withdrawal(Double money, Integer bankCardId, String name, Integer uid, Integer type) throws Exception { |
| | | if(money.compareTo(0D) <= 0){ |
| | | return ResultUtil.error("提现金额必须大于0"); |
| | | } |
| | |
| | | } |
| | | withdrawal.setBalance(driver.getLaveBusinessMoney()); |
| | | } |
| | | withdrawal.setBankName(bankName); |
| | | withdrawal.setCode(code); |
| | | BankCard bankCard = bankCardService.selectById(bankCardId); |
| | | withdrawal.setCode(bankCard.getCode()); |
| | | withdrawal.setFlag(1); |
| | | withdrawal.setInsertTime(new Date()); |
| | | withdrawal.setMoney(money); |
| | |
| | | withdrawal.setUserType(2); |
| | | withdrawal.setType(type); |
| | | withdrawal.setWithdrawalType(1);//线上 |
| | | withdrawal.setRealGetMoney(money*(sysWithdrawalPoundageService.selectOne(null).getPercentage()/100)); |
| | | |
| | | if(type == 1){ |
| | | double v = new BigDecimal(driver.getLaveActivityMoney()).subtract(new BigDecimal(money)).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue(); |
| | |
| | | } |
| | | |
| | | if(withdrawal.getUserType() == 1){//用户 |
| | | UserInfo userInfo = userInfoMapper.selectById(withdrawal.getUserId()); |
| | | if(state == 2){//审核拒绝 |
| | | UserInfo userInfo = userInfoMapper.selectById(withdrawal.getUserId()); |
| | | userInfo.setBalance(new BigDecimal(userInfo.getBalance()).add(new BigDecimal(withdrawal.getMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | userInfoMapper.updateById(userInfo); |
| | | |
| | | withdrawal.setState(3); |
| | | this.updateById(withdrawal); |
| | | }else{ |
| | | //调用银行转账申请(客户要求提交申请就成功了,剩下的他们自己处理) |
| | | Map<String, String> map = payMoneyUtil.wxPayBank("用户提现", withdrawal.getMoney().toString(), withdrawal.getId().toString(), withdrawal.getCode(), withdrawal.getName(), withdrawal.getBankName()); |
| | | if("SUCCESS".equals(map.get("return_code"))){ |
| | | withdrawal.setSerialNo(map.get("payment_no"));//交易序列号 |
| | | withdrawal.setState(2); |
| | | this.updateById(withdrawal); |
| | | }else{ |
| | | return ResultUtil.error(map.get("err_code_des")); |
| | | String code = withdrawal.getCode(); |
| | | BankCard bankCard = bankCardService.selectOne(new EntityWrapper<BankCard>().eq("code", code).eq("userType", 1).eq("userId", userInfo.getId())); |
| | | if(null == bankCard){ |
| | | return ResultUtil.error("请先绑定该银行卡"); |
| | | } |
| | | |
| | | |
| | | // TimerTask timerTask = new TimerTask() { |
| | | // @Override |
| | | // public void run() { |
| | | // Integer integer = icbcPayUtil.queryTransfer(withdrawal.getSerialNo()); |
| | | // if(integer == 0){//交易成功 |
| | | // withdrawal.setState(2); |
| | | // WithdrawalServiceImpl.this.updateById(withdrawal); |
| | | // |
| | | // Timer timer = timerMap.get(withdrawal.getSerialNo()); |
| | | // timer.cancel(); |
| | | // } |
| | | // if(integer == 2){//交易拒绝/失败 |
| | | // //还原余额 |
| | | // if(withdrawal.getUserType() == 1){//用户 |
| | | // withdrawal.setState(3); |
| | | // WithdrawalServiceImpl.this.updateById(withdrawal); |
| | | // |
| | | // UserInfo userInfo = userInfoMapper.selectById(withdrawal.getUserId()); |
| | | // userInfo.setBalance(new BigDecimal(userInfo.getBalance()).add(new BigDecimal(withdrawal.getMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | // userInfoMapper.updateById(userInfo); |
| | | // |
| | | // Timer timer = timerMap.get(withdrawal.getSerialNo()); |
| | | // timer.cancel(); |
| | | // } |
| | | // |
| | | // } |
| | | // } |
| | | // }; |
| | | // Timer timer = new Timer(); |
| | | // timer.schedule(timerTask, 1000, 10000);//1秒钟后间隔10秒钟查询交易结果 |
| | | // timerMap.put(withdrawal.getSerialNo(), timer); |
| | | // Map<String, String> map = ProtocolSignUtil.queryProtocolSign(bankCard.getSignNum(), bankCard.getCode()); |
| | | // String code2 = map.get("code"); |
| | | // if("01".equals(code2)){ |
| | | // String msg = map.get("msg"); |
| | | // return ResultUtil.error(msg); |
| | | // } |
| | | // String signStatus = map.get("SignStatus"); |
| | | // if("02".equals(signStatus)){ |
| | | // return ResultUtil.error("该银行卡已解约,请先进行签约"); |
| | | // } |
| | | // if("03".equals(signStatus)){ |
| | | // return ResultUtil.error("该银行卡客户黑名单"); |
| | | // } |
| | | // if("04".equals(signStatus)){ |
| | | // return ResultUtil.error("垫资超限冻结"); |
| | | // } |
| | | // Map<String, Object> map1 = ProtocolSignUtil.protocolAgentPay(bankCard.getSignNum(), withdrawal.getMoney(), "用户提现"); |
| | | // String code1 = map1.get("code").toString(); |
| | | // if("01".equals(code1)){ |
| | | // return ResultUtil.error(map1.get("msg").toString()); |
| | | // } |
| | | // withdrawal.setSerialNo(map1.get("TransSeq").toString());//交易序列号 |
| | | // withdrawal.setState(2); |
| | | // this.updateById(withdrawal); |
| | | } |
| | | }else{//司机 |
| | | Driver driver = driverService.selectById(withdrawal.getUserId()); |
| | | if(state == 2){//拒绝 |
| | | Driver driver = driverService.selectById(withdrawal.getUserId()); |
| | | driver.setBalance(new BigDecimal(driver.getBalance()).add(new BigDecimal(withdrawal.getMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driver.setLaveActivityMoney(new BigDecimal(driver.getLaveActivityMoney()).add(new BigDecimal(withdrawal.getMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | driverService.updateById(driver); |
| | | }else{ |
| | | //调用银行转账申请(客户要求提交申请就成功了,剩下的他们自己处理) |
| | | Map<String, String> map = payMoneyUtil.wxPayBank("司机提现", withdrawal.getMoney().toString(), withdrawal.getId().toString(), withdrawal.getCode(), withdrawal.getName(), withdrawal.getBankName()); |
| | | if("SUCCESS".equals(map.get("return_code"))){ |
| | | withdrawal.setSerialNo(map.get("payment_no"));//交易序列号 |
| | | withdrawal.setState(2); |
| | | this.updateById(withdrawal); |
| | | }else{ |
| | | return ResultUtil.error(map.get("err_code_des")); |
| | | String code = withdrawal.getCode(); |
| | | BankCard bankCard = bankCardService.selectOne(new EntityWrapper<BankCard>().eq("code", code).eq("userType", 2).eq("userId", driver.getId())); |
| | | if(null == bankCard){ |
| | | return ResultUtil.error("请先绑定该银行卡"); |
| | | } |
| | | |
| | | // TimerTask timerTask = new TimerTask() { |
| | | // @Override |
| | | // public void run() { |
| | | // Integer integer = icbcPayUtil.queryTransfer(withdrawal.getSerialNo()); |
| | | // if(integer == 0){//交易成功 |
| | | // withdrawal.setState(2); |
| | | // WithdrawalServiceImpl.this.updateById(withdrawal); |
| | | // |
| | | // Timer timer = timerMap.get(withdrawal.getSerialNo()); |
| | | // timer.cancel(); |
| | | // } |
| | | // if(integer == 2){//交易拒绝/失败 |
| | | // withdrawal.setState(3); |
| | | // WithdrawalServiceImpl.this.updateById(withdrawal); |
| | | // |
| | | // //还原余额 |
| | | // Driver driver = driverService.selectById(withdrawal.getUserId()); |
| | | // driver.setBalance(new BigDecimal(driver.getBalance()).add(new BigDecimal(withdrawal.getMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | // driver.setLaveActivityMoney(new BigDecimal(driver.getLaveActivityMoney()).add(new BigDecimal(withdrawal.getMoney())).setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | // driverService.updateById(driver); |
| | | // |
| | | // Timer timer = timerMap.get(withdrawal.getSerialNo()); |
| | | // timer.cancel(); |
| | | // } |
| | | // } |
| | | // }; |
| | | // Timer timer = new Timer(); |
| | | // timer.schedule(timerTask, 1000, 10000);//1秒钟后间隔10秒钟查询交易结果 |
| | | // timerMap.put(withdrawal.getSerialNo(), timer); |
| | | // Map<String, String> map = ProtocolSignUtil.queryProtocolSign(bankCard.getSignNum(), bankCard.getCode()); |
| | | // String code2 = map.get("code"); |
| | | // if("01".equals(code2)){ |
| | | // String msg = map.get("msg"); |
| | | // return ResultUtil.error(msg); |
| | | // } |
| | | // String signStatus = map.get("SignStatus"); |
| | | // if("02".equals(signStatus)){ |
| | | // return ResultUtil.error("该银行卡已解约,请先进行签约"); |
| | | // } |
| | | // if("03".equals(signStatus)){ |
| | | // return ResultUtil.error("该银行卡客户黑名单"); |
| | | // } |
| | | // if("04".equals(signStatus)){ |
| | | // return ResultUtil.error("垫资超限冻结"); |
| | | // } |
| | | // Map<String, Object> map1 = ProtocolSignUtil.protocolAgentPay(bankCard.getSignNum(), withdrawal.getMoney(), "司机提现"); |
| | | // String code1 = map1.get("code").toString(); |
| | | // if("01".equals(code1)){ |
| | | // return ResultUtil.error(map1.get("msg").toString()); |
| | | // } |
| | | // withdrawal.setSerialNo(map1.get("TransSeq").toString());//交易序列号 |
| | | // withdrawal.setState(2); |
| | | // this.updateById(withdrawal); |
| | | } |
| | | } |
| | | return ResultUtil.success(); |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import org.springframework.util.Base64Utils; |
| | | |
| | | import javax.crypto.Cipher; |
| | | import javax.crypto.KeyGenerator; |
| | | import javax.crypto.SecretKey; |
| | | import javax.crypto.SecretKeyFactory; |
| | | import javax.crypto.spec.IvParameterSpec; |
| | | import javax.crypto.spec.SecretKeySpec; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.security.SecureRandom; |
| | | import java.security.spec.InvalidKeySpecException; |
| | | import java.util.Base64; |
| | | import java.util.logging.Level; |
| | | import java.util.logging.Logger; |
| | | |
| | | /** |
| | | * 定义AES加密解密工具类 |
| | | */ |
| | | public class AESUtil { |
| | | |
| | | private static final String KEY_ALGORITHM = "AES";//加密方式 |
| | | |
| | | private static final String DEFAULT_CIPHER_ALGORITHM = "AES/CBC/PKCS5Padding";//默认的加密算法 |
| | | |
| | | private static final String KEY = "xqT86jictTPpHMem";//密码 |
| | | |
| | | private static final String IV_PARAMETER = "xqT86jicxqT86jic";//偏移量 |
| | | |
| | | private static final String CHARSET = "UTF-8";//编码 |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 加密操作 |
| | | * @param content 待加密内容 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String encrypt(String content) { |
| | | try { |
| | | if(ToolUtil.isEmpty(content)){ |
| | | return content; |
| | | } |
| | | Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM); |
| | | byte[] raw = KEY.getBytes(CHARSET); |
| | | SecretKeySpec skeySpec = new SecretKeySpec(raw, KEY_ALGORITHM); |
| | | IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes()); |
| | | cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv); |
| | | byte[] encrypted = cipher.doFinal(content.getBytes(CHARSET)); |
| | | return Base64Utils.encodeToString(encrypted); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | /** |
| | | *解密操作 |
| | | * @param content 待解密内容 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String decrypt(String content) { |
| | | try { |
| | | if(ToolUtil.isEmpty(content)){ |
| | | return content; |
| | | } |
| | | byte[] raw = KEY.getBytes(CHARSET); |
| | | SecretKeySpec skeySpec = new SecretKeySpec(raw, KEY_ALGORITHM); |
| | | Cipher cipher = Cipher.getInstance(DEFAULT_CIPHER_ALGORITHM); |
| | | IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes()); |
| | | cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv); |
| | | |
| | | byte[] encrypted1 = Base64Utils.decodeFromString(content); |
| | | byte[] original = cipher.doFinal(encrypted1); |
| | | String originalString = new String(original, CHARSET); |
| | | return originalString; |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | |
| | | public static void main(String[] ages){ |
| | | // String encrypt = AESUtil.encrypt("19167181339"); |
| | | // System.err.println(encrypt); |
| | | // String travel = AESUtil.decrypt("43um1VRZ1t1wL3Z9IWUV7e4Z/w29owZM"); |
| | | // System.err.println(travel); |
| | | |
| | | String decrypt = DESUtil.decrypt("xqT86jictTPpHMem", "43um1VRZ1t1wL3Z9IWUV7e4Z/w29owZM"); |
| | | System.err.println(decrypt); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.stylefeng.guns.modular.system.util.httpClinet.HttpClientUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | param.put("verifyKey", "IVO4js5kValcdt"); |
| | | param.put("userName", name); |
| | | param.put("identifyNum", code); |
| | | String get = httpClientUtil.pushHttpRequset("GET", url, param, header, "form"); |
| | | String get = null; |
| | | try { |
| | | get = httpClientUtil.pushHttpRequset("GET", url, param, header, "form").getData(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(get); |
| | | if(jsonObject.getIntValue("code") == 200){ |
| | | JSONObject value = jsonObject.getJSONObject("value"); |
| | |
| | | // 设置鉴权参数,初始化客户端 |
| | | private DefaultProfile profile = DefaultProfile.getProfile( |
| | | "cn-hangzhou",// 地域ID |
| | | "LTAI5tCeHnZXREQBcVf3NHLB",// 您的AccessKey ID |
| | | "OEX6AtRb3qOCyp53xOFdDEYgBjzZzS");// 您的AccessKey Secret |
| | | "LTAI4G9Zez9H4B36vakPXGy4",// 您的AccessKey ID |
| | | "BOVPUeZndKVbrPOq6Ef5j6oiydB3XZ");// 您的AccessKey Secret |
| | | private IAcsClient client = new DefaultAcsClient(profile); |
| | | |
| | | private static void log_print(String functionName, Object result) { |
| | |
| | | // 接收短信的手机号码 |
| | | request.putQueryParameter("PhoneNumbers", phone); |
| | | // 短信签名名称。请在控制台签名管理页面签名名称一列查看(必须是已添加、并通过审核的短信签名)。 |
| | | request.putQueryParameter("SignName", "嘉易行"); |
| | | request.putQueryParameter("SignName", "OK出行"); |
| | | // 短信模板ID |
| | | request.putQueryParameter("TemplateCode", templateCode); |
| | | // 短信模板变量对应的实际值,JSON格式。 |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import com.aliyun.dyplsapi20170525.models.BindAxbRequest; |
| | | import com.aliyun.dyplsapi20170525.models.BindAxbResponse; |
| | | import com.aliyun.dyplsapi20170525.models.UpdateSubscriptionRequest; |
| | | import com.aliyun.dyplsapi20170525.models.UpdateSubscriptionResponse; |
| | | import com.aliyun.teaopenapi.models.Config; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.stylefeng.guns.core.util.MD5Util; |
| | | import com.stylefeng.guns.modular.system.util.httpClinet.HttpClientUtil; |
| | | import org.apache.commons.codec.binary.Base64; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | |
| | | @Component |
| | | public class ChinaMobileUtil { |
| | | |
| | | private String accessKeyId = "LTAI5tCeHnZXREQBcVf3NHLB"; |
| | | private String APIKey = "zj42494b1bdd416b9762229af6b5cbbd"; |
| | | |
| | | private String accessKeySecret = "OEX6AtRb3qOCyp53xOFdDEYgBjzZzS"; |
| | | private String SecretKey = "30323561316534653735613230316339"; |
| | | |
| | | private String poolKey = "FC100000145494178";//号码池KEY |
| | | |
| | | |
| | | |
| | | /** |
| | | * 使用AK&SK初始化账号Client |
| | | * @return Client |
| | | * @throws Exception |
| | | */ |
| | | public com.aliyun.dyplsapi20170525.Client createClient() throws Exception { |
| | | Config config = new Config() |
| | | // 您的AccessKey ID |
| | | .setAccessKeyId(accessKeyId) |
| | | // 您的AccessKey Secret |
| | | .setAccessKeySecret(accessKeySecret); |
| | | // 访问的域名 |
| | | config.endpoint = "dyplsapi.aliyuncs.com"; |
| | | return new com.aliyun.dyplsapi20170525.Client(config); |
| | | } |
| | | @Autowired |
| | | private HttpClientUtil httpClientUtil; |
| | | |
| | | |
| | | /** |
| | | * 绑定隐私号 |
| | | * 绑定小号 |
| | | * @param phoneA |
| | | * @param phoneB |
| | | * @param expiration "2021-12-14 12:00:00" |
| | | * @param areaCode |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public Map<String, String> midAxbBindSend(String phoneA, String phoneB, Long expiration) throws Exception{ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | com.aliyun.dyplsapi20170525.Client client = createClient(); |
| | | BindAxbRequest bindAxbRequest = new BindAxbRequest() |
| | | .setPhoneNoA(phoneA) |
| | | .setExpiration(sdf.format(new Date(expiration))) |
| | | .setPoolKey(poolKey) |
| | | .setPhoneNoB(phoneB); |
| | | // 复制代码运行请自行打印 API 的返回值 |
| | | BindAxbResponse bindAxbResponse = client.bindAxb(bindAxbRequest); |
| | | Map<String, String> map = new HashMap<>(); |
| | | if(!bindAxbResponse.getBody().getCode().equals("OK")){ |
| | | map.put("code", "-1"); |
| | | public Map<String, String> midAxbBindSend(String phoneA, String phoneB, Integer areaCode) throws Exception{ |
| | | //组装请求对象-具体描述见开发文档-订单小号-AXB接口规范部分内容 |
| | | Map<String, Object> request = new HashMap<>(); |
| | | request.put("APPID", APIKey); |
| | | request.put("bindtype", "AXB"); |
| | | request.put("requestId", UUIDUtil.getRandomCode(16)); |
| | | request.put("record", "0"); |
| | | //用户号码,必填,格式遵循国际电信联盟定义的E.164标准 |
| | | request.put("telA", "86" + phoneA); |
| | | //用户号码B,必填,格式遵循国际电信联盟定义的E.164标准 |
| | | request.put("telB", "86" + phoneB); |
| | | //需要选择的小号所属区号,当telX不写时必填,例如:杭州(571) |
| | | request.put("areaCode", 571); |
| | | //订单小号,非必填,当指定小号绑定时填写,格式遵循国际电信联盟定义的E.164标准 |
| | | // request.setTelX("8618867110000"); |
| | | //绑定关系过期失效时间,秒,取值必须大于0且最大值不超过4294967296 |
| | | request.put("expiration", Integer.valueOf(7 * 24 * 60 * 60)); |
| | | |
| | | Map<String, String> header = new HashMap<String, String>(3); |
| | | header.put("Authorization", "Basic " + new String(Base64.encodeBase64((APIKey + ":" + SecretKey).getBytes()))); |
| | | header.put("Content-Type", "application/json;charset=utf-8"); |
| | | String post = httpClientUtil.pushHttpRequset("POST", "https://ct.open.10086.cn/ordernumber/v1/binding", request, header, "json").toString(); |
| | | Map<String, String> map1 = new HashMap<>(); |
| | | if(post.indexOf("0000") != -1){ |
| | | JSONObject jsonObject = JSONObject.parseObject(post); |
| | | if(jsonObject.getString("code").equals("0000")){ |
| | | map1.put("code", "200"); |
| | | map1.put("msg", jsonObject.getString("message")); |
| | | map1.put("telX", jsonObject.getString("x_no").substring(2)); |
| | | map1.put("bindId", jsonObject.getString("bindId")); |
| | | }else{ |
| | | map1.put("code", jsonObject.getString("code")); |
| | | map1.put("msg", jsonObject.getString("message")); |
| | | } |
| | | }else{ |
| | | map.put("code", "200"); |
| | | map.put("telX", bindAxbResponse.getBody().getSecretBindDTO().getSecretNo()); |
| | | map.put("bindId", bindAxbResponse.getBody().getSecretBindDTO().getSubsId()); |
| | | map1.put("code", "-1"); |
| | | map1.put("msg", post); |
| | | } |
| | | return map; |
| | | |
| | | return map1; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改绑定关系 |
| | | * 解绑小号关系 |
| | | * @param bindId 绑定关系id |
| | | * @param phone 隐私号 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public Map<String, String> midAxbUnBindSend(String bindId, String phone, Long expiration) throws Exception{ |
| | | com.aliyun.dyplsapi20170525.Client client = createClient(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | UpdateSubscriptionRequest updateSubscriptionRequest = new UpdateSubscriptionRequest() |
| | | .setPoolKey(poolKey) |
| | | .setSubsId(bindId) |
| | | .setPhoneNoX(phone) |
| | | .setOperateType("updateExpire") |
| | | .setExpiration(sdf.format(new Date(expiration))); |
| | | // 复制代码运行请自行打印 API 的返回值 |
| | | UpdateSubscriptionResponse updateSubscriptionResponse = client.updateSubscription(updateSubscriptionRequest); |
| | | Map<String, String> map = new HashMap<>(); |
| | | if(!updateSubscriptionResponse.getBody().getCode().equals("OK")){ |
| | | map.put("code", "-1"); |
| | | public Map<String, String> midAxbUnBindSend(String bindId) throws Exception{ |
| | | //组装请求对象-具体描述见开发文档-订单小号-AXB接口规范部分内容 |
| | | Map<String, Object> request = new HashMap<>(); |
| | | //绑定关系ID |
| | | request.put("APPID", APIKey); |
| | | request.put("bindId", bindId); |
| | | |
| | | Map<String, String> header = new HashMap<String, String>(3); |
| | | header.put("Authorization", "Basic " + new String(Base64.encodeBase64((APIKey + ":" + SecretKey).getBytes()))); |
| | | header.put("Content-Type", "application/json;charset=utf-8"); |
| | | String post = httpClientUtil.pushHttpRequset("POST", "https://ct.open.10086.cn/ordernumber/v1/unbinding", request, header, "json").toString(); |
| | | Map<String, String> map1 = new HashMap<>(); |
| | | if(post.indexOf("0000") != -1){ |
| | | JSONObject jsonObject = JSONObject.parseObject(post); |
| | | if(jsonObject.getString("code").equals("0000")){ |
| | | map1.put("code", "200"); |
| | | map1.put("msg", jsonObject.getString("message")); |
| | | }else{ |
| | | map1.put("code", jsonObject.getString("code")); |
| | | map1.put("msg", jsonObject.getString("message")); |
| | | } |
| | | }else{ |
| | | map.put("code", "200"); |
| | | map1.put("code", "-1"); |
| | | map1.put("msg", post); |
| | | } |
| | | return map; |
| | | return map1; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public Map<String, String> HeaderUtils(String APIKey, String SecretKey) throws Exception{ |
| | | Map<String, String> header = new HashMap<>(); |
| | | long time = System.currentTimeMillis(); |
| | | String signStr = MD5Util.encrypt(APIKey + SecretKey + time); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("apiKey", APIKey); |
| | | jsonObject.put("time", time); |
| | | jsonObject.put("sign", signStr); |
| | | Base64 base64 = new Base64(); |
| | | String s = base64.encodeToString(jsonObject.toJSONString().getBytes("UTF-8")); |
| | | header.put("header", s); |
| | | |
| | | jsonObject = new JSONObject(); |
| | | jsonObject.put("platformId", ""); |
| | | jsonObject.put("secret", ""); |
| | | s = base64.encodeToString(jsonObject.toJSONString().getBytes("UTF-8")); |
| | | header.put("accessCode", s); |
| | | return header; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import javax.crypto.Cipher; |
| | | import javax.crypto.CipherInputStream; |
| | | import javax.crypto.CipherOutputStream; |
| | | import javax.crypto.SecretKeyFactory; |
| | | import javax.crypto.spec.DESKeySpec; |
| | | import javax.crypto.spec.IvParameterSpec; |
| | | import java.io.*; |
| | | import java.security.Key; |
| | | import java.security.Security; |
| | | import java.util.Base64; |
| | | |
| | | public class DESUtil { |
| | | |
| | | /** |
| | | * 偏移变量,固定占8位字节 |
| | | */ |
| | | private final static String IV_PARAMETER = "12345678"; |
| | | /** |
| | | * 密钥算法 |
| | | */ |
| | | private static final String ALGORITHM = "DES"; |
| | | /** |
| | | * 加密/解密算法-工作模式-填充模式 |
| | | */ |
| | | private static final String CIPHER_ALGORITHM = "DES/ECB/PKCS7Padding"; |
| | | /** |
| | | * 默认编码 |
| | | */ |
| | | private static final String CHARSET = "utf-8"; |
| | | |
| | | //设置java支持PKCS7Padding |
| | | static { |
| | | Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | String s = "123456"; |
| | | |
| | | // 加密 |
| | | String s2 = encrypt("xqT86jictTPpHMem", s); |
| | | |
| | | System.out.println(s2); |
| | | |
| | | //解密 |
| | | String s3 = decrypt("xqT86jictTPpHMem", s2); |
| | | |
| | | System.out.println(s3); |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 生成key |
| | | * |
| | | * @param password |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | private static Key generateKey(String password) throws Exception { |
| | | DESKeySpec dks = new DESKeySpec(password.getBytes(CHARSET)); |
| | | SecretKeyFactory keyFactory = SecretKeyFactory.getInstance(ALGORITHM); |
| | | return keyFactory.generateSecret(dks); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * DES加密字符串 |
| | | * |
| | | * @param password 加密密码,长度不能够小于8位 |
| | | * @param data 待加密字符串 |
| | | * @return 加密后内容 |
| | | */ |
| | | public static String encrypt(String password, String data) { |
| | | if (password== null || password.length() < 8) { |
| | | throw new RuntimeException("加密失败,key不能小于8位"); |
| | | } |
| | | if (data == null) |
| | | return null; |
| | | try { |
| | | Key secretKey = generateKey(password); |
| | | Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); |
| | | // IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes(CHARSET)); |
| | | cipher.init(Cipher.ENCRYPT_MODE, secretKey); |
| | | byte[] bytes = cipher.doFinal(data.getBytes(CHARSET)); |
| | | |
| | | //JDK1.8及以上可直接使用Base64,JDK1.7及以下可以使用BASE64Encoder |
| | | //Android平台可以使用android.util.Base64 |
| | | return new String(Base64.getEncoder().encode(bytes)); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return data; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * DES解密字符串 |
| | | * |
| | | * @param password 解密密码,长度不能够小于8位 |
| | | * @param data 待解密字符串 |
| | | * @return 解密后内容 |
| | | */ |
| | | public static String decrypt(String password, String data) { |
| | | if (password== null || password.length() < 8) { |
| | | throw new RuntimeException("加密失败,key不能小于8位"); |
| | | } |
| | | if (data == null) |
| | | return null; |
| | | try { |
| | | Key secretKey = generateKey(password); |
| | | Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); |
| | | // IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes(CHARSET)); |
| | | cipher.init(Cipher.DECRYPT_MODE, secretKey); |
| | | return new String(cipher.doFinal(Base64.getDecoder().decode(data.getBytes(CHARSET))), CHARSET); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return data; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * DES加密文件 |
| | | * |
| | | * @param srcFile 待加密的文件 |
| | | * @param destFile 加密后存放的文件路径 |
| | | * @return 加密后的文件路径 |
| | | */ |
| | | public static String encryptFile(String password, String srcFile, String destFile) { |
| | | |
| | | if (password== null || password.length() < 8) { |
| | | throw new RuntimeException("加密失败,key不能小于8位"); |
| | | } |
| | | try { |
| | | // IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes(CHARSET)); |
| | | Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); |
| | | cipher.init(Cipher.ENCRYPT_MODE, generateKey(password)); |
| | | InputStream is = new FileInputStream(srcFile); |
| | | OutputStream out = new FileOutputStream(destFile); |
| | | CipherInputStream cis = new CipherInputStream(is, cipher); |
| | | byte[] buffer = new byte[1024]; |
| | | int r; |
| | | while ((r = cis.read(buffer)) > 0) { |
| | | out.write(buffer, 0, r); |
| | | } |
| | | cis.close(); |
| | | is.close(); |
| | | out.close(); |
| | | return destFile; |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * DES解密文件 |
| | | * |
| | | * @param srcFile 已加密的文件 |
| | | * @param destFile 解密后存放的文件路径 |
| | | * @return 解密后的文件路径 |
| | | */ |
| | | public static String decryptFile(String password, String srcFile, String destFile) { |
| | | if (password== null || password.length() < 8) { |
| | | throw new RuntimeException("加密失败,key不能小于8位"); |
| | | } |
| | | try { |
| | | File file = new File(destFile); |
| | | if (!file.exists()) { |
| | | file.getParentFile().mkdirs(); |
| | | file.createNewFile(); |
| | | } |
| | | // IvParameterSpec iv = new IvParameterSpec(IV_PARAMETER.getBytes(CHARSET)); |
| | | Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); |
| | | cipher.init(Cipher.DECRYPT_MODE, generateKey(password)); |
| | | InputStream is = new FileInputStream(srcFile); |
| | | OutputStream out = new FileOutputStream(destFile); |
| | | CipherOutputStream cos = new CipherOutputStream(out, cipher); |
| | | byte[] buffer = new byte[1024]; |
| | | int r; |
| | | while ((r = is.read(buffer)) >= 0) { |
| | | cos.write(buffer, 0, r); |
| | | } |
| | | cos.close(); |
| | | is.close(); |
| | | out.close(); |
| | | return destFile; |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | @Component |
| | | public class GDFalconUtil implements ApplicationRunner { |
| | | |
| | | private String key = "ba2915f8d8c1428df72e964a5f94f167"; |
| | | private String key = "e17d799b2506d05faf7f88320a266803"; |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | |
| | | @Autowired |
| | | private IGDInterfaceService gdInterfaceService; |
| | | |
| | | private String key = "ba2915f8d8c1428df72e964a5f94f167"; |
| | | private String key = "e17d799b2506d05faf7f88320a266803"; |
| | | |
| | | private JSONArray jsonArray = new JSONArray(); |
| | | |
| | |
| | | @Component |
| | | public class GDMapGeocodingUtil { |
| | | |
| | | private String key = "c573ee644cd0c1bd9da2657dd648dc11"; |
| | | private String key = "e17d799b2506d05faf7f88320a266803"; |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | |
| | | import com.icbc.api.request.*; |
| | | import com.icbc.api.response.*; |
| | | import com.icbc.api.utils.IcbcSignature; |
| | | import com.stylefeng.guns.modular.system.util.httpClinet.HttpClientUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.web.client.RestTemplate; |
| | |
| | | * @param type 支付端类型(1:用户端,2:司机端,3:小程序) |
| | | * @throws UnknownHostException |
| | | */ |
| | | public Map<String, String> placeAnOrder1(String out_trade_no, Integer pay_mode, Integer access_type, String deciveInfo, String body, Double total_fee, String mer_url, String attach, Integer type, String openId) throws Exception { |
| | | public Map<String, String> placeAnOrder(String out_trade_no, Integer pay_mode, Integer access_type, String deciveInfo, String body, Double total_fee, String mer_url, String attach, Integer type, String openId) throws Exception { |
| | | //签名类型为RSA时,需传入appid,私钥和网关公钥,签名类型使用定值IcbcConstants.SIGN_TYPE_RSA,其他参数使用缺省值 |
| | | DefaultIcbcClient client = new DefaultIcbcClient(app_id, IcbcConstants.SIGN_TYPE_RSA2, privateKey, icbcPulicKey); |
| | | CardbusinessAggregatepayB2cOnlineConsumepurchaseRequestV1 request = new |
| | |
| | | bizContent.setMer_prtcl_no(mer_prtcl_no); |
| | | bizContent.setOrig_date_time(format); |
| | | bizContent.setDecive_info(deciveInfo); |
| | | bizContent.setBody("嘉易行-" + body); |
| | | bizContent.setBody("OK出行-" + body); |
| | | bizContent.setFee_type("001"); |
| | | InetAddress ip4 = Inet4Address.getLocalHost(); |
| | | bizContent.setSpbill_create_ip(ip4.getHostAddress()); |
| | |
| | | * @param order_id 工行订单号 |
| | | * @return |
| | | */ |
| | | public String queryTransaction1(String out_trade_no, String order_id){ |
| | | public String queryTransaction(String out_trade_no, String order_id){ |
| | | //签名类型为RSA时,需传入appid,私钥和网关公钥,签名类型使用定值IcbcConstants.SIGN_TYPE_RSA,其他参数使用缺省值 |
| | | DefaultIcbcClient client = new DefaultIcbcClient(app_id, IcbcConstants.SIGN_TYPE_RSA2, privateKey, icbcPulicKey); |
| | | CardbusinessAggregatepayB2cOnlineOrderqryRequestV1 request = new CardbusinessAggregatepayB2cOnlineOrderqryRequestV1(); |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public Map<String, String> payCallback1(HttpServletRequest request) throws Exception{ |
| | | public Map<String, String> payCallback(HttpServletRequest request) throws Exception{ |
| | | String biz_content1 = request.getParameter("biz_content"); |
| | | JSONObject biz_content = JSON.parseObject(biz_content1); |
| | | int return_code = biz_content.getIntValue("return_code"); |
| | |
| | | * @param response |
| | | * @throws Exception |
| | | */ |
| | | public void answer1(HttpServletResponse response) throws Exception{ |
| | | public void answer(HttpServletResponse response) throws Exception{ |
| | | response.setContentType("application/json;charset=UTF-8"); |
| | | StringBuffer sb = new StringBuffer(); |
| | | String nativeUUID = UUIDUtil.getNativeUUID(); |
| | |
| | | * @param payeeCnname 收款账户名称 |
| | | * @return |
| | | */ |
| | | public ResultUtil<String> transfer1(Long money, String payeeAccount, String payeeCnname) throws Exception{ |
| | | public ResultUtil<String> transfer(Long money, String payeeAccount, String payeeCnname) throws Exception{ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); |
| | | SimpleDateFormat sdf_ = new SimpleDateFormat("HHmmssSSS"); |
| | | Date date = new Date(); |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public ResultUtil<Map<String, Object>> generate1(String out_trade_no, Double order_amt, Date orderTime, String attach, String notify_url) throws Exception{ |
| | | public ResultUtil<Map<String, Object>> generate(String out_trade_no, Double order_amt, Date orderTime, String attach, String notify_url) throws Exception{ |
| | | order_amt = order_amt * 100; |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); |
| | | SimpleDateFormat sdf1 = new SimpleDateFormat("HHmmss"); |
| | |
| | | * @param order_id 工行订单号 |
| | | * @return |
| | | */ |
| | | public String queryGeneratePayState1(String out_trade_no, String order_id){ |
| | | public String queryGeneratePayState(String out_trade_no, String order_id){ |
| | | //签名类型为RSA2时,需传入appid,私钥和网关公钥,签名类型使用定值IcbcConstants.SIGN_TYPE_RSA2,其他参数使用缺省值 |
| | | DefaultIcbcClient client = new DefaultIcbcClient(app_id, IcbcConstants.SIGN_TYPE_RSA2, privateKey, icbcPulicKey); |
| | | QrcodeQueryRequestV2 request = new QrcodeQueryRequestV2(); |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public Map<String, String> generatePayCallback1(HttpServletRequest request) throws Exception{ |
| | | public Map<String, String> generatePayCallback(HttpServletRequest request) throws Exception{ |
| | | String biz_content1 = request.getParameter("biz_content"); |
| | | JSONObject biz_content = JSON.parseObject(biz_content1); |
| | | String return_code = biz_content.getString("return_code"); |
| | |
| | | String url = "https://bankaddress.shumaidata.com/bankaddress?bankcard=" + code; |
| | | Map<String, String> header = new HashMap<>(); |
| | | header.put("Authorization", "APPCODE b7d32437d08149099457dcb50fb57df2"); |
| | | String get = httpClientUtil.pushHttpRequset("GET", url, null, header, "form"); |
| | | String get = null; |
| | | try { |
| | | get = httpClientUtil.pushHttpRequset("GET", url, null, header, "form").getData(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(get); |
| | | int code1 = jsonObject.getIntValue("code"); |
| | | Map<String, String> map = new HashMap<>(); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.stylefeng.guns.modular.system.util.httpClinet.HttpClientUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | map.put("key", key); |
| | | map.put("idcard", idcard); |
| | | map.put("realname", name); |
| | | String content = httpClientUtil.pushHttpRequset("GET", "http://op.juhe.cn/idcard/query", map, new HashMap<>(), "form"); |
| | | String content = null; |
| | | try { |
| | | content = httpClientUtil.pushHttpRequset("GET", "http://op.juhe.cn/idcard/query", map, new HashMap<>(), "form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println(content); |
| | | JSONObject jsonObject = JSON.parseObject(content); |
| | | if(jsonObject.getIntValue("error_code") == 0){ |
| | |
| | | */ |
| | | public Map<String, String> queryBank(String code){ |
| | | String url = "http://apis.juhe.cn/interbank/query?key=" + key + "&bankcard=" + code; |
| | | String get = httpClientUtil.pushHttpRequset("GET", url, null, null, "form"); |
| | | String get = null; |
| | | try { |
| | | get = httpClientUtil.pushHttpRequset("GET", url, null, null, "form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | JSONObject jsonObject = JSON.parseObject(get); |
| | | Map<String, String> map = new HashMap<>(); |
| | | if(jsonObject.getIntValue("error_code") == 0){ |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.LiuZhouBank; |
| | | |
| | | /** |
| | | * 配置枚举类 |
| | | * @author pzb |
| | | * @Date 2022/11/28 19:07 |
| | | */ |
| | | public interface Config { |
| | | |
| | | String MCHT_NO = "49561404121B083"; |
| | | |
| | | String APP_ID = "bolz18g5bw9eb80pc72d"; |
| | | |
| | | String PRIVATE_KEY = "3f0e856ca40ae36b787aaae4f72d85a5034759fe11e75c9033f17b09c94e4b85"; |
| | | |
| | | String FOP_PUBLIC_KEY = "04bf22b5bf2e98719c149f98b54264a3e2ced402d03430e884cf464289766ef24b3e9323b203a9132069b70830f468c5cd834b234c7479a2608f3026187a24a12b"; |
| | | |
| | | String TEST_URL = "http://117.141.212.41:38188"; |
| | | |
| | | String PRODUCTION_URL = "https://open.bolz.cn:8188"; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.LiuZhouBank; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.io.BufferedReader; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.InputStreamReader; |
| | | import java.net.InetAddress; |
| | | import java.net.UnknownHostException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 支付工具类 |
| | | * @author pzb |
| | | * @Date 2022/11/28 21:10 |
| | | */ |
| | | public class PayUtil { |
| | | |
| | | |
| | | // /** |
| | | // * 聚合支付预下单(微信、本行卡) |
| | | // * @param subAppId 微信分配商户的子商户公众账号 ID |
| | | // * @param openid 微信小程序openid |
| | | // * @param chnlPayPage 微信商户号 |
| | | // * @param payType 支付类型:01-本行卡支付,02-聚合 微信,03-本行卡支付,微信支付 04-支付宝支付,05-本行卡支付,支付宝支付,06-微信支付,支付宝支付 07-全部 |
| | | // * @param amount 支付金额 |
| | | // * @param transDesc 交易描述 |
| | | // * @param backNotifyUrl 回调地址 |
| | | // * @param transSeq 商户流水号 |
| | | // * @return |
| | | // */ |
| | | // public static String polymericPay(String subAppId, String openid, String chnlPayPage, String payType, Double amount, String transDesc, String backNotifyUrl, String transSeq){ |
| | | // String uri = "/api/conductor/cashier/polymericPay/1.0.0"; |
| | | // FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY) |
| | | // .IsBodyEncrypt(true) |
| | | // .SererUrl(Config.PRODUCTION_URL + uri) |
| | | // .EncryptType(EncryptType.SM4) |
| | | // .SignType(SignType.SM2).build(); |
| | | // |
| | | // /** |
| | | // * model,request,response类 |
| | | // * 不同接口的model,request,response均不相同 |
| | | // * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全 |
| | | // * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中 |
| | | // * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100 |
| | | // */ |
| | | // ConductorCashierPolymericpayModel_100 model = new ConductorCashierPolymericpayModel_100(); |
| | | // ConductorCashierPolymericpayRequest_100 request = new ConductorCashierPolymericpayRequest_100(); |
| | | // ConductorCashierPolymericpayResponse_100 response = null; |
| | | // |
| | | // SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd"); |
| | | // SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss"); |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | // String format = sdf1.format(new Date()); |
| | | // String format1 = sdf2.format(new Date()); |
| | | // model.setMchtNo(Config.MCHT_NO); |
| | | // model.setTransSeq(transSeq); |
| | | // model.setTransDate(format); |
| | | // model.setTransTime(format1); |
| | | // model.setVersion("1.0"); |
| | | // model.setSndDt(format + format1); |
| | | // |
| | | // model.setSubAppId(subAppId);//微信分配商户的子商户公众账号 ID |
| | | // model.setOpenId(openid);//商户通过微信预授权获取的用户唯一标识,当payChnlType=02时必传 |
| | | // model.setChnlPayPage(chnlPayPage);//微信分配商户的子商户账号 ID,当 payChnlType=02 时必传 |
| | | // model.setPayChnlType(ToolUtil.isNotEmpty(openid) ? "02" : "01");//01-H5 02-微信小程序 |
| | | // model.setPayType(payType);//支付类型:01-本行卡支付,02-聚合 微信,03-本行卡支付,微信支付 04-支付宝支付,05-本行卡支付,支 付宝支付,06-微信支付,支付宝支 付 07-全部 |
| | | // model.setTransAmount(amount.toString());//交易金额 |
| | | // model.setTransDesc(transDesc);//交易描述 |
| | | // model.setBackNotifyUrl(backNotifyUrl);//后台异步通知回调地址 |
| | | // try { |
| | | // model.setTermIp(InetAddress.getLocalHost().getHostAddress());//终端IP |
| | | // } catch (UnknownHostException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // request.setBizModel(model); |
| | | // try { |
| | | // response = fopClient.execute(request); |
| | | // } catch (FopApiException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // System.err.println("预下单:" + JSON.toJSONString(response)); |
| | | // if("00000000".equals(response.getBizCode()) || "88888888".equals(response.getBizCode())){ |
| | | // String transDate = response.getTransDate(); |
| | | // String transTime = response.getTransTime(); |
| | | // String transSeq1 = response.getTransSeq(); |
| | | // return response.getCodeUrl(); |
| | | // }else{ |
| | | // System.err.println(response.getBizCode() + ":" + response.getBizMsg()); |
| | | // } |
| | | // return null; |
| | | // } |
| | | // |
| | | // |
| | | // /** |
| | | // * 聚合支付交易状态查询 |
| | | // * @param oriTransSeq 原商户上送交易流水号 |
| | | // * @param oriTransDate 原交易日期 |
| | | // * @param oriTansTime 原交易时间 |
| | | // * @param oriTransAmount 原交易金额 |
| | | // * @return |
| | | // */ |
| | | // public static String poPayTransStatusQuery(String oriTransSeq, String oriTransDate, String oriTansTime, Double oriTransAmount){ |
| | | // String uri = "/api/conductor/cashier/poPayTransStatusQuery/1.0.0"; |
| | | // FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY) |
| | | // .IsBodyEncrypt(true) |
| | | // .SererUrl(Config.PRODUCTION_URL + uri) |
| | | // .EncryptType(EncryptType.SM4) |
| | | // .SignType(SignType.SM2).build(); |
| | | // |
| | | // /** |
| | | // * model,request,response类 |
| | | // * 不同接口的model,request,response均不相同 |
| | | // * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全 |
| | | // * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中 |
| | | // * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100 |
| | | // */ |
| | | // ConductorCashierPopaytransstatusqueryModel_100 model = new ConductorCashierPopaytransstatusqueryModel_100(); |
| | | // ConductorCashierPopaytransstatusqueryRequest_100 request = new ConductorCashierPopaytransstatusqueryRequest_100(); |
| | | // ConductorCashierPopaytransstatusqueryResponse_100 response = null; |
| | | // |
| | | // model.setOriTransSeq(oriTransSeq);//原商户上送交易流水号 |
| | | // model.setOriTransType("mergePay.order");//sign.pay 协议支付,sign.deposit协议代付,sign.wx.jspay协议代付关联微信公众号支付,sign.ali.jspay协议代付关联支付宝服务窗支付,loan.pay欠款订单还款,card.prepay本行卡支付预下单,unified.pay客户被扫接口,ali.dynamic.code支付宝扫码支付,union.dynamic.code银联扫码支付,wx.jspay微信公众号支付,ali.jspay支付宝服务窗支付,mergePay.order聚合支付预下单 |
| | | // model.setOriTransDate(oriTransDate);//原交易日期 |
| | | // model.setOriTransTime(oriTansTime);//原交易时间 |
| | | // model.setOriTransAmount(oriTransAmount.toString());//原交易金额 |
| | | // request.setBizModel(model); |
| | | // try { |
| | | // response = fopClient.execute(request); |
| | | // } catch (FopApiException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // return JSONObject.toJSONString(response); |
| | | // } |
| | | // |
| | | // |
| | | // /** |
| | | // * 聚合支付退款 |
| | | // * @param oriTransSeq 原商户上送交易流水号 |
| | | // * @param oriTransDate 原交易日期 |
| | | // * @param oriTansTime 原交易时间 |
| | | // * @param oriTransAmount 原交易金额 |
| | | // * @param refundAmount 退款金额 |
| | | // * @return |
| | | // */ |
| | | // public static String polymericPayRefund(String oriTransSeq, String oriTransDate, String oriTansTime, Double oriTransAmount, Double refundAmount){ |
| | | // String uri = "/api/conductor/cashier/polymericPayRefund/1.0.0"; |
| | | // FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY) |
| | | // .IsBodyEncrypt(true) |
| | | // .SererUrl(Config.PRODUCTION_URL + uri) |
| | | // .EncryptType(EncryptType.SM4) |
| | | // .SignType(SignType.SM2).build(); |
| | | // |
| | | // /** |
| | | // * model,request,response类 |
| | | // * 不同接口的model,request,response均不相同 |
| | | // * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全 |
| | | // * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中 |
| | | // * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100 |
| | | // */ |
| | | // ConductorCashierPolymericpayrefundModel_100 model = new ConductorCashierPolymericpayrefundModel_100(); |
| | | // ConductorCashierPolymericpayrefundRequest_100 request = new ConductorCashierPolymericpayrefundRequest_100(); |
| | | // ConductorCashierPolymericpayrefundResponse_100 response = null; |
| | | // |
| | | // model.setOriTransSeq(oriTransSeq);//原商户上送交易流水号 |
| | | // model.setOriTransType("mergePay.order");//sign.pay 协议支付,sign.deposit协议代付,sign.wx.jspay协议代付关联微信公众号支付,sign.ali.jspay协议代付关联支付宝服务窗支付,loan.pay欠款订单还款,card.prepay本行卡支付预下单,unified.pay客户被扫接口,ali.dynamic.code支付宝扫码支付,union.dynamic.code银联扫码支付,wx.jspay微信公众号支付,ali.jspay支付宝服务窗支付,mergePay.order聚合支付预下单 |
| | | // model.setOriTransDate(oriTransDate);//原交易日期 |
| | | // model.setOriTransTime(oriTansTime);//原交易时间 |
| | | // model.setOriTransAmount(oriTransAmount.toString());//原交易金额 |
| | | // model.setRefundAmount(refundAmount.toString());//退款金额 |
| | | // request.setBizModel(model); |
| | | // try { |
| | | // response = fopClient.execute(request); |
| | | // } catch (FopApiException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // return JSONObject.toJSONString(response); |
| | | // } |
| | | // |
| | | // |
| | | // /** |
| | | // * 协议代付关联支付宝服务窗支付 |
| | | // * @param chnlSeq 渠道流水号(自定义,唯一) |
| | | // * @param signNum 签约协议号 |
| | | // * @param mchtReserve 商户保留内容,和签约上送一致 |
| | | // * @param buyerId 支付宝买家用户id |
| | | // * @param body 商品描述 |
| | | // * @param totalFee 支付金额 |
| | | // * @param notifyUrl 通知回调地址 |
| | | // */ |
| | | // public static void relatedZFBOfficialPay(String chnlSeq, String signNum, String mchtReserve, String buyerId, String body, String totalFee, String notifyUrl){ |
| | | // String uri = "/api/conductor/cashier/relatedZFBOfficialPay/1.0.0"; |
| | | // FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY) |
| | | // .IsBodyEncrypt(true) |
| | | // .SererUrl(Config.PRODUCTION_URL + uri) |
| | | // .EncryptType(EncryptType.SM4) |
| | | // .SignType(SignType.SM2).build(); |
| | | // |
| | | // /** |
| | | // * model,request,response类 |
| | | // * 不同接口的model,request,response均不相同 |
| | | // * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全 |
| | | // * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中 |
| | | // * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100 |
| | | // */ |
| | | // ConductorCashierRelatedzfbofficialpayModel_100 model = new ConductorCashierRelatedzfbofficialpayModel_100(); |
| | | // ConductorCashierRelatedzfbofficialpayRequest_100 request = new ConductorCashierRelatedzfbofficialpayRequest_100(); |
| | | // ConductorCashierRelatedzfbofficialpayResponse_100 response = null; |
| | | // |
| | | // Date date = new Date(); |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); |
| | | // SimpleDateFormat sdf1 = new SimpleDateFormat("HHmmss"); |
| | | // |
| | | // model.setChnlSeq(chnlSeq);//渠道流水号 |
| | | // model.setChnlDate(sdf.format(date));//渠道日期 |
| | | // model.setChnlTime(sdf1.format(date));//渠道时间 |
| | | // model.setSignNum(signNum);//签约协议号 |
| | | // model.setMchtReserve(mchtReserve);//商户保留 即在协议签约时,上送的商户保留字段,普通商户一般为用户标识号,需要确保唯一 |
| | | // model.setDeviceInfo("");//设备号 |
| | | // model.setBuyerId(buyerId);//卖价支付宝用户ID |
| | | // model.setBody(body);//商品描述 |
| | | // model.setTotalFee(totalFee);//支付总金额 |
| | | // try { |
| | | // model.setTermIp(InetAddress.getLocalHost().getHostAddress());//终端IP |
| | | // } catch (UnknownHostException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // model.setTermMac("");//终端MAC信息 |
| | | // model.setLocations("");//经纬度信息 |
| | | // model.setNotifyUrl(notifyUrl);//通知回调地址 |
| | | // request.setBizModel(model); |
| | | // try { |
| | | // response = fopClient.execute(request); |
| | | // } catch (FopApiException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // if("00000000".equals(response.getBizCode())){ |
| | | // if("00".equals(response.getCode())){ |
| | | // String tradeMoney = response.getTradeMoney();//实际支付金额 |
| | | // String totalFee1 = response.getTotalFee();//订单金额 |
| | | // String tradeNo = response.getTradeNo();//支付宝JS订单号 |
| | | // }else{ |
| | | // System.err.println(response.getMsg()); |
| | | // } |
| | | // |
| | | // String transDate = response.getTransDate(); |
| | | // String transTime = response.getTransTime(); |
| | | // String transSeq1 = response.getTransSeq(); |
| | | // |
| | | // }else{ |
| | | // System.err.println(response.getBizMsg()); |
| | | // } |
| | | // |
| | | // } |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // /** |
| | | // * 支付宝扫码支付 |
| | | // * @param chnlSeq |
| | | // * @param deviceInfo |
| | | // * @param body |
| | | // * @param totalFee |
| | | // * @param subject |
| | | // * @param notifyUrl |
| | | // * @return |
| | | // */ |
| | | // public static String zfbScanCodePay(String chnlSeq, String deviceInfo, String body, Double totalFee, String subject, String notifyUrl){ |
| | | // String uri = "/api/conductor/cashier/zfbScanCodePay/1.0.0"; |
| | | // FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY) |
| | | // .IsBodyEncrypt(true) |
| | | // .SererUrl(Config.PRODUCTION_URL + uri) |
| | | // .EncryptType(EncryptType.SM4) |
| | | // .SignType(SignType.SM2).build(); |
| | | // |
| | | // /** |
| | | // * model,request,response类 |
| | | // * 不同接口的model,request,response均不相同 |
| | | // * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全 |
| | | // * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中 |
| | | // * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100 |
| | | // */ |
| | | // ConductorCashierZfbscancodepayModel_100 model = new ConductorCashierZfbscancodepayModel_100(); |
| | | // ConductorCashierZfbscancodepayRequest_100 request = new ConductorCashierZfbscancodepayRequest_100(); |
| | | // ConductorCashierZfbscancodepayResponse_100 response = null; |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd HHmmss"); |
| | | // String format = sdf.format(new Date()); |
| | | // model.setChnlSeq(chnlSeq);//渠道流水号 |
| | | // model.setChnlDate(format.split(" ")[0]);//渠道日期 |
| | | // model.setChnlTime(format.split(" ")[1]);//渠道时间 |
| | | // model.setDeviceInfo(deviceInfo);//设备号 |
| | | // model.setBody(body);//商品描述 |
| | | // model.setFeeType("CNY");//货币类型 |
| | | // model.setTotalFee(totalFee.toString());//总金额 |
| | | // model.setSubject(subject);//订单标题 |
| | | // try { |
| | | // model.setTermIp(InetAddress.getLocalHost().getHostAddress());//终端IP |
| | | // model.setTermMac("");//终端MAC信息 |
| | | // model.setLocations("");//经纬度信息 |
| | | // } catch (UnknownHostException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // model.setNotifyUrl(notifyUrl);//异步通知回调地址 |
| | | // request.setBizModel(model); |
| | | // try { |
| | | // response = fopClient.execute(request); |
| | | // } catch (FopApiException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // if("00000000".equals(response.getBizCode())){ |
| | | // if("00".equals(response.getResultCode())){//成功 |
| | | // return response.getCodeUrl(); |
| | | // }else{ |
| | | // System.err.println(response.getResultMsg()); |
| | | // return null; |
| | | // } |
| | | // }else{ |
| | | // System.err.println(response.getBizMsg()); |
| | | // return null; |
| | | // } |
| | | // } |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // /** |
| | | // * 支付回调处理 |
| | | // * @param request |
| | | // * @return |
| | | // */ |
| | | // public static ResultNotification payResultNotification(HttpServletRequest request){ |
| | | // String param = null; |
| | | // try { |
| | | // param = getParam(request); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // JSONObject jsonObject1 = JSON.parseObject(param); |
| | | // JSONObject jsonObject = FopClient.SM2checkSign(jsonObject1, Config.FOP_PUBLIC_KEY); |
| | | // if(!jsonObject.getBoolean("sign")){ |
| | | // System.err.println("线下收款回调异常---------->" + jsonObject.getString("msg")); |
| | | // return null; |
| | | // } |
| | | // ResultNotification resultNotification = jsonObject1.toJavaObject(ResultNotification.class); |
| | | // resultNotification.setResponseStr("success");//响应内容 |
| | | // return resultNotification; |
| | | // } |
| | | // |
| | | // |
| | | // |
| | | // /** |
| | | // * 获取请求内容 |
| | | // * @param request |
| | | // * @return |
| | | // * @throws IOException |
| | | // */ |
| | | // private static String getParam(HttpServletRequest request) throws IOException { |
| | | // // 读取参数 |
| | | // InputStream inputStream; |
| | | // StringBuilder sb = new StringBuilder(); |
| | | // inputStream = request.getInputStream(); |
| | | // String s; |
| | | // BufferedReader in = new BufferedReader(new InputStreamReader(inputStream, "UTF-8")); |
| | | // while ((s = in.readLine()) != null) { |
| | | // sb.append(s); |
| | | // } |
| | | // in.close(); |
| | | // inputStream.close(); |
| | | // return sb.toString(); |
| | | // } |
| | | // |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.LiuZhouBank; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.util.UUIDUtil; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 银行签约工具类 |
| | | * @author pzb |
| | | * @Date 2022/11/28 19:06 |
| | | */ |
| | | |
| | | public class ProtocolSignUtil { |
| | | |
| | | |
| | | // /** |
| | | // * 签约前获取短信验证码 |
| | | // * @param IdNum 身份证号码 |
| | | // * @param phone 银行预留电话 |
| | | // * @param acctName 账户名称 |
| | | // * @param acctNum 账户号 |
| | | // * @return |
| | | // */ |
| | | // public static ResultUtil<String> protocolSignSendSms(String IdNum, String phone, String acctName, String acctNum){ |
| | | // try { |
| | | // String uri = "/api/conductor/cashier/protocolSignSendSms/1.0.0"; |
| | | // FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY) |
| | | // .IsBodyEncrypt(true) |
| | | // .SererUrl(Config.PRODUCTION_URL + uri) |
| | | // .EncryptType(EncryptType.SM4) |
| | | // .SignType(SignType.SM2).build(); |
| | | // |
| | | // /** |
| | | // * model,request,response类 |
| | | // * 不同接口的model,request,response均不相同 |
| | | // * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全 |
| | | // * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中 |
| | | // * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100 |
| | | // */ |
| | | // ConductorCashierProtocolsignsendsmsModel_100 model = new ConductorCashierProtocolsignsendsmsModel_100(); |
| | | // ConductorCashierProtocolsignsendsmsRequest_100 request = new ConductorCashierProtocolsignsendsmsRequest_100(); |
| | | // ConductorCashierProtocolsignsendsmsResponse_100 response = null; |
| | | // |
| | | // SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd"); |
| | | // SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss"); |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | // String format = sdf1.format(new Date()); |
| | | // String format1 = sdf2.format(new Date()); |
| | | // model.setMchtNo(Config.MCHT_NO); |
| | | // model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5)); |
| | | // model.setTransDate(format); |
| | | // model.setTransTime(format1); |
| | | // model.setVersion("1.0"); |
| | | // model.setSndDt(format + format1); |
| | | // |
| | | // model.setContractType("02");//01代扣,02代付 |
| | | // model.setIdType("01");//01 居民身份证 |
| | | // model.setIdNum(IdNum);//证件号码 |
| | | // model.setMobilePhone(phone);//银行预留手机号 |
| | | // model.setAcctName(acctName);//账户名称 |
| | | // model.setAcctNum(acctNum);//账号 |
| | | // model.setCardType("01");//01本行卡,02他行卡 |
| | | // request.setBizModel(model); |
| | | // System.err.println("请求参数----》" + JSON.toJSONString(model)); |
| | | // response = fopClient.execute(request); |
| | | // System.err.println("响应结果----》" + JSON.toJSONString(response)); |
| | | // if("00000000".equals(response.getBizCode())){ |
| | | // return ResultUtil.success(); |
| | | // }else{ |
| | | // System.err.println(response.getBizMsg()); |
| | | // return ResultUtil.error(response.getBizMsg()); |
| | | // } |
| | | // }catch (Exception e){ |
| | | // e.printStackTrace(); |
| | | // return ResultUtil.runErr(); |
| | | // } |
| | | // } |
| | | // |
| | | // |
| | | // /** |
| | | // * 银行卡签约 |
| | | // * @param IdNum 身份证号码 |
| | | // * @param phone 银行预留电话号码 |
| | | // * @param acctName 账户名 |
| | | // * @param acctNum 账号 |
| | | // * @param code |
| | | // * @return |
| | | // */ |
| | | // public static Map<String, String> protocolSign(String IdNum, String phone, String acctName, String acctNum, String code){ |
| | | // Map<String, String> map = new HashMap<>(); |
| | | // try { |
| | | // String uri = "/api/conductor/cashier/protocolSign/1.0.0"; |
| | | // FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY) |
| | | // .IsBodyEncrypt(true) |
| | | // .SererUrl(Config.PRODUCTION_URL + uri) |
| | | // .EncryptType(EncryptType.SM4) |
| | | // .SignType(SignType.SM2).build(); |
| | | // |
| | | // /** |
| | | // * model,request,response类 |
| | | // * 不同接口的model,request,response均不相同 |
| | | // * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全 |
| | | // * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中 |
| | | // * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100 |
| | | // */ |
| | | // ConductorCashierProtocolsignModel_100 model = new ConductorCashierProtocolsignModel_100(); |
| | | // ConductorCashierProtocolsignRequest_100 request = new ConductorCashierProtocolsignRequest_100(); |
| | | // ConductorCashierProtocolsignResponse_100 response = null; |
| | | // |
| | | // SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd"); |
| | | // SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss"); |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | // String format = sdf1.format(new Date()); |
| | | // String format1 = sdf2.format(new Date()); |
| | | // model.setMchtNo(Config.MCHT_NO); |
| | | // model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5)); |
| | | // model.setTransDate(format); |
| | | // model.setTransTime(format1); |
| | | // model.setVersion("1.0"); |
| | | // model.setSndDt(format + format1); |
| | | // |
| | | // model.setContractType("02");//协议类型01代扣,02代付 |
| | | // model.setChannelType("11");//11收单商户 |
| | | // model.setBusiType("01");//01商户后台接口调用 |
| | | // model.setIdType("01");//01 居民身份证 |
| | | // model.setIdNum(IdNum);//证件号码 |
| | | // model.setMobilePhone(phone);//银行预留手机号码 |
| | | // model.setAcctName(acctName);//户名 |
| | | // model.setAcctNum(acctNum);//账户 |
| | | // model.setCardType("01");//01本行卡,02他行卡 |
| | | // model.setDynamicCode(code);//短信验证码 |
| | | // request.setBizModel(model); |
| | | // System.err.println("请求参数----》" + JSON.toJSONString(model)); |
| | | // response = fopClient.execute(request); |
| | | // System.err.println("响应结果----》" + JSON.toJSONString(response)); |
| | | // if("00000000".equals(response.getBizCode())){ |
| | | // map.put("code", "00"); |
| | | // map.put("signNum", response.getSignNum()); |
| | | // map.put("acctNumSuffix", response.getAcctNumSuffix());//银行卡号后4位 |
| | | // }else{ |
| | | // map.put("code", "01"); |
| | | // map.put("msg", response.getBizMsg()); |
| | | // } |
| | | // }catch (Exception e){ |
| | | // e.printStackTrace(); |
| | | // map.put("code", "01"); |
| | | // map.put("msg", "接口异常"); |
| | | // } |
| | | // return map; |
| | | // } |
| | | // |
| | | // |
| | | // /** |
| | | // * 协议签约查询 |
| | | // * @param signNum 签约协议号 |
| | | // * @param acctNum 银行账号 |
| | | // * @return |
| | | // */ |
| | | // public static Map<String, String> queryProtocolSign(String signNum, String acctNum){ |
| | | // Map<String, String> map = new HashMap<>(); |
| | | // try { |
| | | // String uri = "/api/conductor/cashier/queryProtocolSign/1.0.0"; |
| | | // FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY) |
| | | // .IsBodyEncrypt(true) |
| | | // .SererUrl(Config.PRODUCTION_URL + uri) |
| | | // .EncryptType(EncryptType.SM4) |
| | | // .SignType(SignType.SM2).build(); |
| | | // |
| | | // /** |
| | | // * model,request,response类 |
| | | // * 不同接口的model,request,response均不相同 |
| | | // * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全 |
| | | // * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中 |
| | | // * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100 |
| | | // */ |
| | | // ConductorCashierQueryprotocolsignModel_100 model = new ConductorCashierQueryprotocolsignModel_100(); |
| | | // ConductorCashierQueryprotocolsignRequest_100 request = new ConductorCashierQueryprotocolsignRequest_100(); |
| | | // ConductorCashierQueryprotocolsignResponse_100 response = null; |
| | | // |
| | | // SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd"); |
| | | // SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss"); |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | // String format = sdf1.format(new Date()); |
| | | // String format1 = sdf2.format(new Date()); |
| | | // model.setMchtNo(Config.MCHT_NO); |
| | | // model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5)); |
| | | // model.setTransDate(format); |
| | | // model.setTransTime(format1); |
| | | // model.setVersion("1.0"); |
| | | // model.setSndDt(format + format1); |
| | | // |
| | | // model.setSignNum(signNum);//签约协议号 |
| | | // model.setAcctNum(acctNum);//账号 |
| | | // model.setContractType("02");//协议类型01代扣,02代付 |
| | | // request.setBizModel(model); |
| | | // System.err.println("请求参数----》" + JSON.toJSONString(model)); |
| | | // response = fopClient.execute(request); |
| | | // System.err.println("响应结果----》" + JSON.toJSONString(response)); |
| | | // String bizCode = response.getBizCode(); |
| | | // if("00000000".equals(bizCode)){ |
| | | // String signNum1 = response.getSignNum(); |
| | | // String signStatus = response.getSignStatus(); |
| | | // map.put("code", "00"); |
| | | // map.put("SignNum", signNum1);//签约协议号 |
| | | // map.put("SignStatus", signStatus);//签约状态 01-签约,02-解约,03客户黑名单,04-垫资超限冻结 |
| | | // }else{ |
| | | // map.put("code", "01"); |
| | | // map.put("msg", response.getBizMsg()); |
| | | // } |
| | | // }catch (Exception e){ |
| | | // e.printStackTrace(); |
| | | // map.put("code", "01"); |
| | | // map.put("msg", "接口异常"); |
| | | // } |
| | | // return map; |
| | | // } |
| | | // |
| | | // |
| | | // |
| | | // |
| | | // /** |
| | | // * 协议解约 |
| | | // * @param signNum 签约协议号 |
| | | // * @return |
| | | // */ |
| | | // public static Map<String, String> protocolRescind(String signNum){ |
| | | // Map<String, String> map = new HashMap<>(); |
| | | // try { |
| | | // String uri = "/api/conductor/cashier/protocolRescind/1.0.0"; |
| | | // FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY) |
| | | // .IsBodyEncrypt(true) |
| | | // .SererUrl(Config.PRODUCTION_URL + uri) |
| | | // .EncryptType(EncryptType.SM4) |
| | | // .SignType(SignType.SM2).build(); |
| | | // |
| | | // /** |
| | | // * model,request,response类 |
| | | // * 不同接口的model,request,response均不相同 |
| | | // * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全 |
| | | // * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中 |
| | | // * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100 |
| | | // */ |
| | | // ConductorCashierProtocolrescindModel_100 model = new ConductorCashierProtocolrescindModel_100(); |
| | | // ConductorCashierProtocolrescindRequest_100 request = new ConductorCashierProtocolrescindRequest_100(); |
| | | // ConductorCashierProtocolrescindResponse_100 response = null; |
| | | // |
| | | // SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd"); |
| | | // SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss"); |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | // String format = sdf1.format(new Date()); |
| | | // String format1 = sdf2.format(new Date()); |
| | | // model.setMchtNo(Config.MCHT_NO); |
| | | // model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5)); |
| | | // model.setTransDate(format); |
| | | // model.setTransTime(format1); |
| | | // model.setVersion("1.0"); |
| | | // model.setSndDt(format + format1); |
| | | // |
| | | // model.setSignNum(signNum);//签约协议号 |
| | | // model.setContractType("02");//协议类型01代扣,02代付 |
| | | // model.setChannelType("11");//11收单商户 |
| | | // request.setBizModel(model); |
| | | // System.err.println("请求参数----》" + JSON.toJSONString(model)); |
| | | // response = fopClient.execute(request); |
| | | // System.err.println("响应结果----》" + JSON.toJSONString(response)); |
| | | // String bizCode = response.getBizCode(); |
| | | // |
| | | // if("00000000".equals(bizCode)){ |
| | | // String signNum1 = response.getSignNum(); |
| | | // String transSeq = response.getTransSeq(); |
| | | // map.put("code", "00"); |
| | | // map.put("SignNum", signNum1);//签约协议号 |
| | | // map.put("TransSeq", transSeq);//流水号 |
| | | // }else{ |
| | | // map.put("code", "01"); |
| | | // map.put("msg", response.getBizMsg());//流水号 |
| | | // } |
| | | // }catch (Exception e){ |
| | | // map.put("code", "01"); |
| | | // map.put("msg", "接口异常");//流水号 |
| | | // } |
| | | // return map; |
| | | // } |
| | | // |
| | | // |
| | | // /** |
| | | // * 协议支付 |
| | | // * @param signNum 签约协议号 |
| | | // * @param amount 支付金额 |
| | | // * @param transDesc 交易描述 |
| | | // * @return |
| | | // */ |
| | | // public static String protocolPayTrans(String signNum, Double amount, String transDesc){ |
| | | // String uri = "/api/conductor/cashier/protocolPayTrans/1.0.0"; |
| | | // FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY) |
| | | // .IsBodyEncrypt(true) |
| | | // .SererUrl(Config.PRODUCTION_URL + uri) |
| | | // .EncryptType(EncryptType.SM4) |
| | | // .SignType(SignType.SM2).build(); |
| | | // |
| | | // /** |
| | | // * model,request,response类 |
| | | // * 不同接口的model,request,response均不相同 |
| | | // * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全 |
| | | // * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中 |
| | | // * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100 |
| | | // */ |
| | | // ConductorCashierProtocolpaytransModel_100 model = new ConductorCashierProtocolpaytransModel_100(); |
| | | // ConductorCashierProtocolpaytransRequest_100 request = new ConductorCashierProtocolpaytransRequest_100(); |
| | | // ConductorCashierProtocolpaytransResponse_100 response = null; |
| | | // |
| | | // |
| | | // SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd"); |
| | | // SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss"); |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | // String format = sdf1.format(new Date()); |
| | | // String format1 = sdf2.format(new Date()); |
| | | // model.setMchtNo(Config.MCHT_NO); |
| | | // try { |
| | | // model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5)); |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // model.setTransDate(format); |
| | | // model.setTransTime(format1); |
| | | // model.setVersion("1.0"); |
| | | // model.setSndDt(format + format1); |
| | | // |
| | | // model.setSignNum(signNum);//签约协议号 |
| | | // model.setTransAmount(amount.toString());//支付金额 |
| | | // model.setTransDesc(transDesc);//交易描述 |
| | | // request.setBizModel(model); |
| | | // System.err.println("请求参数----》" + JSON.toJSONString(model)); |
| | | // try { |
| | | // response = fopClient.execute(request); |
| | | // } catch (FopApiException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // System.err.println("响应结果----》" + JSON.toJSONString(response)); |
| | | // return JSONObject.toJSONString(response); |
| | | // } |
| | | // |
| | | // |
| | | // /** |
| | | // * 协议代付 |
| | | // * @param signNum |
| | | // * @param amount |
| | | // * @param transDesc |
| | | // * @return |
| | | // */ |
| | | // public static Map<String, Object> protocolAgentPay(String signNum, Double amount, String transDesc){ |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // try { |
| | | // String uri = "/api/conductor/cashier/protocolAgentPay/1.0.0"; |
| | | // FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY) |
| | | // .IsBodyEncrypt(true) |
| | | // .SererUrl(Config.PRODUCTION_URL + uri) |
| | | // .EncryptType(EncryptType.SM4) |
| | | // .SignType(SignType.SM2).build(); |
| | | // |
| | | // /** |
| | | // * model,request,response类 |
| | | // * 不同接口的model,request,response均不相同 |
| | | // * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全 |
| | | // * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中 |
| | | // * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100 |
| | | // */ |
| | | // ConductorCashierProtocolagentpayModel_100 model = new ConductorCashierProtocolagentpayModel_100(); |
| | | // ConductorCashierProtocolagentpayRequest_100 request = new ConductorCashierProtocolagentpayRequest_100(); |
| | | // ConductorCashierProtocolagentpayResponse_100 response = null; |
| | | // |
| | | // |
| | | // SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd"); |
| | | // SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss"); |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | // String format = sdf1.format(new Date()); |
| | | // String format1 = sdf2.format(new Date()); |
| | | // model.setMchtNo(Config.MCHT_NO); |
| | | // model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5)); |
| | | // model.setTransDate(format); |
| | | // model.setTransTime(format1); |
| | | // model.setVersion("1.0"); |
| | | // model.setSndDt(format + format1); |
| | | // |
| | | // model.setSignNum(signNum);//签约协议号 |
| | | // model.setTransAmount(amount.toString());//支付金额 |
| | | // model.setTransDesc(transDesc);//交易描述 |
| | | // request.setBizModel(model); |
| | | // System.err.println("请求参数----》" + JSON.toJSONString(model)); |
| | | // response = fopClient.execute(request); |
| | | // System.err.println("响应结果----》" + JSON.toJSONString(response)); |
| | | // String bizCode = response.getBizCode(); |
| | | // |
| | | // if("00000000".equals(bizCode)){ |
| | | // String transSeq = response.getTransSeq(); |
| | | // map.put("code", "00"); |
| | | // map.put("TransSeq", transSeq); |
| | | // }else{ |
| | | // map.put("code", "01"); |
| | | // map.put("msg", response.getBizMsg()); |
| | | // } |
| | | // }catch (Exception e){ |
| | | // e.printStackTrace(); |
| | | // map.put("code", "01"); |
| | | // map.put("msg", "接口异常"); |
| | | // } |
| | | // return map; |
| | | // } |
| | | // |
| | | // |
| | | // /** |
| | | // * 统一交易退款 |
| | | // * @param oriTransSeq 原商户上送交易流水号 |
| | | // * @param oriTransDate 原交易日期 |
| | | // * @param oriTansTime 原交易时间 |
| | | // * @param oriTransAmount 原交易金额 |
| | | // * @param refundAmount 退款金额 |
| | | // * @return |
| | | // */ |
| | | // public static String protocolPayRefund(String oriTransSeq, String oriTransDate, String oriTansTime, Double oriTransAmount, Double refundAmount){ |
| | | // String uri = "/api/conductor/cashier/protocolPayRefund/1.0.0"; |
| | | // FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY) |
| | | // .IsBodyEncrypt(true) |
| | | // .SererUrl(Config.PRODUCTION_URL + uri) |
| | | // .EncryptType(EncryptType.SM4) |
| | | // .SignType(SignType.SM2).build(); |
| | | // |
| | | // /** |
| | | // * model,request,response类 |
| | | // * 不同接口的model,request,response均不相同 |
| | | // * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全 |
| | | // * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中 |
| | | // * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100 |
| | | // */ |
| | | // ConductorCashierProtocolpayrefundModel_100 model = new ConductorCashierProtocolpayrefundModel_100(); |
| | | // ConductorCashierProtocolpayrefundRequest_100 request = new ConductorCashierProtocolpayrefundRequest_100(); |
| | | // ConductorCashierProtocolpayrefundResponse_100 response = null; |
| | | // |
| | | // SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd"); |
| | | // SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss"); |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | // String format = sdf1.format(new Date()); |
| | | // String format1 = sdf2.format(new Date()); |
| | | // model.setMchtNo(Config.MCHT_NO); |
| | | // try { |
| | | // model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5)); |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // model.setTransDate(format); |
| | | // model.setTransTime(format1); |
| | | // model.setVersion("1.0"); |
| | | // model.setSndDt(format + format1); |
| | | // |
| | | // model.setOriTransSeq(oriTransSeq);//原商户上送交易流水号 |
| | | // model.setOriTransType("sign.pay");//sign.pay 协议支付,sign.deposit协议代付,sign.wx.jspay协议代付关联微信公众号支付,sign.ali.jspay协议代付关联支付宝服务窗支付,loan.pay欠款订单还款,card.prepay本行卡支付预下单,unified.pay客户被扫接口,ali.dynamic.code支付宝扫码支付,union.dynamic.code银联扫码支付,wx.jspay微信公众号支付,ali.jspay支付宝服务窗支付,mergePay.order聚合支付预下单 |
| | | // model.setOriTransDate(oriTransDate);//原交易日期 |
| | | // model.setOriTansTime(oriTansTime);//原交易时间 |
| | | // model.setOriTransAmount(oriTransAmount.toString());//原交易金额 |
| | | // model.setRefundAmount(refundAmount.toString());//退款金额 |
| | | // request.setBizModel(model); |
| | | // System.err.println("请求参数----》" + JSON.toJSONString(model)); |
| | | // try { |
| | | // response = fopClient.execute(request); |
| | | // } catch (FopApiException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // System.err.println("响应结果----》" + JSON.toJSONString(response)); |
| | | // return JSONObject.toJSONString(response); |
| | | // } |
| | | // |
| | | // |
| | | // /** |
| | | // * 统一交易状态查询 |
| | | // * @param oriTransSeq 原商户上送交易流水号 |
| | | // * @param oriTransDate 原交易日期 |
| | | // * @param oriTansTime 原交易时间 |
| | | // * @param oriTransAmount 原交易金额 |
| | | // * @return |
| | | // */ |
| | | // public static String queryTransStatus(String oriTransSeq, String oriTransDate, String oriTansTime, Double oriTransAmount){ |
| | | // String uri = "/api/conductor/cashier/protocolPayRefund/1.0.0"; |
| | | // FopClient fopClient = DefaultFopClient.builder(Config.APP_ID, Config.PRIVATE_KEY, Config.FOP_PUBLIC_KEY) |
| | | // .IsBodyEncrypt(true) |
| | | // .SererUrl(Config.PRODUCTION_URL + uri) |
| | | // .EncryptType(EncryptType.SM4) |
| | | // .SignType(SignType.SM2).build(); |
| | | // |
| | | // /** |
| | | // * model,request,response类 |
| | | // * 不同接口的model,request,response均不相同 |
| | | // * 其中,ConductorCashierXXXX需与apiUrl相互对应。在引入开放平台jar包后,驼峰可使用ide快捷键补全 |
| | | // * 或查看jar包中com.fop.sdk中的domain包,request包,response包,引入对象皆在此目录中 |
| | | // * 如,协议支付的model 为 ConductorCashierProtocolpaytransModel_100 |
| | | // */ |
| | | // ConductorCashierQuerytransstatusModel_100 model = new ConductorCashierQuerytransstatusModel_100(); |
| | | // ConductorCashierQuerytransstatusRequest_100 request = new ConductorCashierQuerytransstatusRequest_100(); |
| | | // ConductorCashierQuerytransstatusResponse_100 response = null; |
| | | // |
| | | // |
| | | // SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd"); |
| | | // SimpleDateFormat sdf2 = new SimpleDateFormat("HHmmss"); |
| | | // SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | // String format = sdf1.format(new Date()); |
| | | // String format1 = sdf2.format(new Date()); |
| | | // model.setMchtNo(Config.MCHT_NO); |
| | | // try { |
| | | // model.setTransSeq(sdf.format(new Date()) + UUIDUtil.getRandomCode(5)); |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // model.setTransDate(format); |
| | | // model.setTransTime(format1); |
| | | // model.setVersion("1.0"); |
| | | // model.setSndDt(format + format1); |
| | | // |
| | | // model.setOriTransSeq(oriTransSeq);//原商户上送交易流水号 |
| | | // model.setOriTransType("sign.pay");//sign.pay 协议支付,sign.deposit协议代付,sign.wx.jspay协议代付关联微信公众号支付,sign.ali.jspay协议代付关联支付宝服务窗支付,loan.pay欠款订单还款,card.prepay本行卡支付预下单,unified.pay客户被扫接口,ali.dynamic.code支付宝扫码支付,union.dynamic.code银联扫码支付,wx.jspay微信公众号支付,ali.jspay支付宝服务窗支付,mergePay.order聚合支付预下单 |
| | | // model.setOriTransDate(oriTransDate);//原交易日期 |
| | | // model.setOriTansTime(oriTansTime);//原交易时间 |
| | | // model.setOriTransAmount(oriTransAmount.toString());//原交易金额 |
| | | // request.setBizModel(model); |
| | | // System.err.println("请求参数----》" + JSON.toJSONString(model)); |
| | | // try { |
| | | // response = fopClient.execute(request); |
| | | // } catch (FopApiException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // System.err.println("响应结果----》" + JSON.toJSONString(response)); |
| | | // return JSONObject.toJSONString(response); |
| | | // } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.LiuZhouBank; |
| | | |
| | | /** |
| | | * 回调结果 |
| | | * @author pzb |
| | | * @Date 2022/11/28 20:56 |
| | | */ |
| | | public class ResultNotification { |
| | | /** |
| | | * 响应码 |
| | | * 0000000:成功 |
| | | * 其他:失败 |
| | | */ |
| | | private String returnCode; |
| | | /** |
| | | * 响应信息 |
| | | */ |
| | | private String returnMessage; |
| | | /** |
| | | * 商户号 |
| | | */ |
| | | private String mchtNo; |
| | | /** |
| | | * 商户名称 |
| | | */ |
| | | private String mchtName; |
| | | /** |
| | | * 业务结果信息 00 成功 01 失败 |
| | | */ |
| | | private String resultCode; |
| | | /** |
| | | * 业务结果信息 |
| | | */ |
| | | private String resultMsg; |
| | | /** |
| | | * 渠道流水号即报文上送的渠道流水号 |
| | | */ |
| | | private String chnlSeq; |
| | | /** |
| | | * 订单金额 |
| | | */ |
| | | private String totalFee; |
| | | /** |
| | | * 系统交易日期 |
| | | */ |
| | | private String txnDate; |
| | | /** |
| | | * 系统交易时间 |
| | | */ |
| | | private String txnTime; |
| | | /** |
| | | * 系统流水号 |
| | | */ |
| | | private String txnSeq; |
| | | /** |
| | | * 支付交易渠道 01-微信,02-支付宝,03-云闪付 |
| | | */ |
| | | private String paytype; |
| | | /** |
| | | * 签名 |
| | | */ |
| | | private String sign; |
| | | /** |
| | | * 接口响应内容 |
| | | */ |
| | | private String responseStr; |
| | | |
| | | public String getReturnCode() { |
| | | return returnCode; |
| | | } |
| | | |
| | | public void setReturnCode(String returnCode) { |
| | | this.returnCode = returnCode; |
| | | } |
| | | |
| | | public String getReturnMessage() { |
| | | return returnMessage; |
| | | } |
| | | |
| | | public void setReturnMessage(String returnMessage) { |
| | | this.returnMessage = returnMessage; |
| | | } |
| | | |
| | | public String getMchtNo() { |
| | | return mchtNo; |
| | | } |
| | | |
| | | public void setMchtNo(String mchtNo) { |
| | | this.mchtNo = mchtNo; |
| | | } |
| | | |
| | | public String getMchtName() { |
| | | return mchtName; |
| | | } |
| | | |
| | | public void setMchtName(String mchtName) { |
| | | this.mchtName = mchtName; |
| | | } |
| | | |
| | | public String getResultCode() { |
| | | return resultCode; |
| | | } |
| | | |
| | | public void setResultCode(String resultCode) { |
| | | this.resultCode = resultCode; |
| | | } |
| | | |
| | | public String getResultMsg() { |
| | | return resultMsg; |
| | | } |
| | | |
| | | public void setResultMsg(String resultMsg) { |
| | | this.resultMsg = resultMsg; |
| | | } |
| | | |
| | | public String getChnlSeq() { |
| | | return chnlSeq; |
| | | } |
| | | |
| | | public void setChnlSeq(String chnlSeq) { |
| | | this.chnlSeq = chnlSeq; |
| | | } |
| | | |
| | | public String getTotalFee() { |
| | | return totalFee; |
| | | } |
| | | |
| | | public void setTotalFee(String totalFee) { |
| | | this.totalFee = totalFee; |
| | | } |
| | | |
| | | public String getTxnDate() { |
| | | return txnDate; |
| | | } |
| | | |
| | | public void setTxnDate(String txnDate) { |
| | | this.txnDate = txnDate; |
| | | } |
| | | |
| | | public String getTxnTime() { |
| | | return txnTime; |
| | | } |
| | | |
| | | public void setTxnTime(String txnTime) { |
| | | this.txnTime = txnTime; |
| | | } |
| | | |
| | | public String getTxnSeq() { |
| | | return txnSeq; |
| | | } |
| | | |
| | | public void setTxnSeq(String txnSeq) { |
| | | this.txnSeq = txnSeq; |
| | | } |
| | | |
| | | public String getPaytype() { |
| | | return paytype; |
| | | } |
| | | |
| | | public void setPaytype(String paytype) { |
| | | this.paytype = paytype; |
| | | } |
| | | |
| | | public String getSign() { |
| | | return sign; |
| | | } |
| | | |
| | | public void setSign(String sign) { |
| | | this.sign = sign; |
| | | } |
| | | |
| | | public String getResponseStr() { |
| | | return responseStr; |
| | | } |
| | | |
| | | public void setResponseStr(String responseStr) { |
| | | this.responseStr = responseStr; |
| | | } |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alipay.api.AlipayApiException; |
| | | import com.alipay.api.AlipayClient; |
| | | import com.alipay.api.CertAlipayRequest; |
| | | import com.alipay.api.DefaultAlipayClient; |
| | | import com.alipay.api.domain.AlipayTradeAppPayModel; |
| | | import com.alipay.api.internal.util.AlipaySignature; |
| | | import com.alipay.api.request.*; |
| | | import com.alipay.api.response.*; |
| | | import com.alipay.api.request.AlipayTradeAppPayRequest; |
| | | import com.alipay.api.request.AlipayTradePrecreateRequest; |
| | | import com.alipay.api.request.AlipayTradeQueryRequest; |
| | | import com.alipay.api.request.AlipayTradeRefundRequest; |
| | | import com.alipay.api.response.AlipayTradeAppPayResponse; |
| | | import com.alipay.api.response.AlipayTradePrecreateResponse; |
| | | import com.alipay.api.response.AlipayTradeQueryResponse; |
| | | import com.alipay.api.response.AlipayTradeRefundResponse; |
| | | import com.stylefeng.guns.modular.system.util.httpClinet.HttpClientUtil; |
| | | import org.apache.commons.collections.map.HashedMap; |
| | | import org.bouncycastle.jce.provider.BouncyCastleProvider; |
| | | import org.dom4j.Document; |
| | |
| | | @Value("${wx.appid}") |
| | | private String appid;//微信appid |
| | | |
| | | @Value("${wx.appletsAppid}") |
| | | private String appletsAppid; |
| | | |
| | | @Value("${wx.appletsAppSecret}") |
| | | private String appletsAppSecret; |
| | | |
| | | @Value("${wx.mchId}") |
| | | private String mchId;//微信商户号 |
| | | |
| | | @Value("${wx.key}") |
| | | private String key;//微信商户号 |
| | | |
| | | @Value("${callbackPath}") |
| | | private String callbackPath;//支付回调网关地址 |
| | | |
| | | private String app_cert_path = "C:/cert/alipay/driver/app_cert_path.crt";//应用公钥证书路径 |
| | | |
| | | private String alipay_cert_path = "C:/cert/alipay/driver/alipay_cert_path.crt";//支付宝公钥证书文件路径 |
| | | |
| | | private String alipay_root_cert_path = "C:/cert/alipay/driver/alipay_root_cert_path.crt";//支付宝CA根证书文件路径 |
| | | @Value("${wx.certPath}") |
| | | String certPath; |
| | | |
| | | @Autowired |
| | | private HttpClientUtil httpClientUtil; |
| | |
| | | /** |
| | | * 支付宝支付 |
| | | */ |
| | | public ResultUtil alipay(String body, String subject, String passbackParams, String outTradeNo, String amount, String notifyUrl){ |
| | | //构造client |
| | | CertAlipayRequest certAlipayRequest = new CertAlipayRequest (); |
| | | //设置网关地址 |
| | | certAlipayRequest.setServerUrl("https://openapi.alipay.com/gateway.do"); |
| | | //设置应用Id |
| | | certAlipayRequest.setAppId(aliAppid); |
| | | //设置应用私钥 |
| | | certAlipayRequest.setPrivateKey(appPrivateKey); |
| | | //设置请求格式,固定值json |
| | | certAlipayRequest.setFormat("json"); |
| | | //设置字符集 |
| | | certAlipayRequest.setCharset("UTF-8"); |
| | | //设置签名类型 |
| | | certAlipayRequest.setSignType("RSA2"); |
| | | //设置应用公钥证书路径 |
| | | certAlipayRequest.setCertPath(app_cert_path); |
| | | //设置支付宝公钥证书路径 |
| | | certAlipayRequest.setAlipayPublicCertPath(alipay_cert_path); |
| | | //设置支付宝根证书路径 |
| | | certAlipayRequest.setRootCertPath(alipay_root_cert_path); |
| | | //构造client |
| | | AlipayClient alipayClient = null; |
| | | public ResultUtil alipay(String body, String subject, String outTradeNo, String amount, String notifyUrl){ |
| | | //实例化客户端 |
| | | AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", aliAppid, appPrivateKey, "json", "UTF-8", alipayPublicKey, "RSA2"); |
| | | //实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.pay |
| | | AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest(); |
| | | //SDK已经封装掉了公共参数,这里只需要传入业务参数。以下方法为sdk的model入参方式(model和biz_content同时存在的情况下取biz_content)。 |
| | | AlipayTradeAppPayModel model = new AlipayTradeAppPayModel(); |
| | | model.setBody(body);//对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body。 |
| | | model.setSubject(subject);//商品的标题/交易标题/订单标题/订单关键字等。 |
| | | model.setOutTradeNo(outTradeNo);//商户网站唯一订单号 |
| | | model.setTimeoutExpress("30m"); |
| | | model.setTotalAmount(amount);//付款金额 |
| | | model.setProductCode("QUICK_MSECURITY_PAY"); |
| | | request.setBizModel(model); |
| | | request.setNotifyUrl(notifyUrl); |
| | | try { |
| | | alipayClient = new DefaultAlipayClient(certAlipayRequest); |
| | | //这里和普通的接口调用不同,使用的是sdkExecute |
| | | AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request); |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("orderString", response.getBody()); |
| | | System.out.println(map);//就是orderString 可以直接给客户端请求,无需再做处理。 |
| | | return ResultUtil.success(map); |
| | | } catch (AlipayApiException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | //实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.pay |
| | | AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest (); |
| | | //SDK已经封装掉了公共参数,这里只需要传入业务参数。以下方法为sdk的model入参方式(model和biz_content同时存在的情况下取biz_content)。 |
| | | AlipayTradeAppPayModel model = new AlipayTradeAppPayModel (); |
| | | model.setBody(body); |
| | | model.setSubject (subject); |
| | | model.setOutTradeNo (outTradeNo); |
| | | model.setTimeoutExpress ("30m" ); |
| | | model.setTotalAmount (amount); |
| | | model.setProductCode ( "QUICK_MSECURITY_PAY" ); |
| | | model.setPassbackParams(passbackParams);//自定义参数 |
| | | request.setBizModel ( model ); |
| | | request.setNotifyUrl (callbackPath + notifyUrl); |
| | | try { |
| | | //这里和普通的接口调用不同,使用的是sdkExecute |
| | | AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request); |
| | | System.out.println(response.getBody());//就是orderString 可以直接给客户端请求,无需再做处理。 |
| | | return ResultUtil.success(response.getBody()); |
| | | } catch (AlipayApiException e ) { |
| | | e.printStackTrace(); |
| | | } |
| | | |
| | | |
| | | // //实例化客户端 |
| | | // AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipay.com/gateway.do", aliAppid, appPrivateKey, "json", "UTF-8", alipay_public_key, "RSA2"); |
| | | // //实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.pay |
| | | // AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest(); |
| | | // //SDK已经封装掉了公共参数,这里只需要传入业务参数。以下方法为sdk的model入参方式(model和biz_content同时存在的情况下取biz_content)。 |
| | | // AlipayTradeAppPayModel model = new AlipayTradeAppPayModel(); |
| | | // model.setBody(body);//对一笔交易的具体描述信息。如果是多种商品,请将商品描述字符串累加传给body。 |
| | | // model.setSubject(subject);//商品的标题/交易标题/订单标题/订单关键字等。 |
| | | // model.setOutTradeNo(outTradeNo);//商户网站唯一订单号 |
| | | // model.setTimeoutExpress("30m"); |
| | | // model.setTotalAmount(amount);//付款金额 |
| | | // model.setProductCode("QUICK_MSECURITY_PAY"); |
| | | // model.setPassbackParams(passbackParams);//自定义参数 |
| | | // request.setBizModel(model); |
| | | // request.setNotifyUrl(callbackPath + notifyUrl); |
| | | // try { |
| | | // //这里和普通的接口调用不同,使用的是sdkExecute |
| | | // AlipayTradeAppPayResponse response = alipayClient.sdkExecute(request); |
| | | // Map<String, String> map = new HashMap<>(); |
| | | // map.put("orderString", response.getBody()); |
| | | // System.out.println(map);//就是orderString 可以直接给客户端请求,无需再做处理。 |
| | | // return ResultUtil.success(map); |
| | | // } catch (AlipayApiException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | return null; |
| | | } |
| | | |
| | |
| | | " \"out_trade_no\":\"" + outTradeNo + "\"," +//商户订单号 |
| | | " \"total_amount\":\"" + 1 + "\"," + |
| | | " \"subject\":\"" + subject + "\"," + |
| | | " \"notify_url\":\"" + callbackPath + notifyUrl + "\"," + |
| | | " \"notify_url\":\"" + notifyUrl + "\"," + |
| | | " \"body\":\"" + body + "\"," + |
| | | " \"store_id\":\"NJ_001\"," + |
| | | " \"timeout_express\":\"90m\"}");//订单允许的最晚付款时间 |
| | |
| | | String valueStr = ""; |
| | | for (int i = 0; i < values.length; i++) { |
| | | valueStr = (i == values.length - 1) ? valueStr + values[i] |
| | | : valueStr + values[i] + "_"; |
| | | : valueStr + values[i] + ","; |
| | | } |
| | | //乱码解决,这段代码在出现乱码时使用。 |
| | | //valueStr = new String(valueStr.getBytes("ISO-8859-1"), "utf-8"); |
| | | params.put(name, valueStr); |
| | | } |
| | | |
| | | Map<String, String> map = new HashMap<>(); |
| | | String out_trade_no = params.get("out_trade_no"); |
| | | String subject = params.get("subject"); |
| | | String total_amount = params.get("total_amount"); |
| | | String trade_no = params.get("trade_no"); |
| | | map.put("out_trade_no", out_trade_no);//商家订单号 |
| | | map.put("subject", subject); |
| | | map.put("total_amount", total_amount); |
| | | map.put("trade_no", trade_no);//支付宝交易号 |
| | | return map; |
| | | |
| | | |
| | | //切记alipaypublickey是支付宝的公钥,请去open.alipay.com对应应用下查看。 |
| | | //boolean AlipaySignature.rsaCheckV1(Map<String, String> params, String publicKey, String charset, String sign_type) |
| | | try { |
| | | boolean flag = AlipaySignature.rsaCheckV1(params, alipay_public_key, "UTF-8","RSA2"); |
| | | if(flag){ |
| | | Map<String, String> map = new HashMap<>(); |
| | | String out_trade_no = params.get("out_trade_no"); |
| | | String subject = params.get("subject"); |
| | | String total_amount = params.get("total_amount"); |
| | | String trade_no = params.get("trade_no"); |
| | | String passback_params = params.get("passback_params"); |
| | | map.put("out_trade_no", out_trade_no);//商家订单号 |
| | | map.put("subject", subject); |
| | | map.put("total_amount", total_amount); |
| | | map.put("trade_no", trade_no);//支付宝交易号 |
| | | map.put("passback_params", passback_params);//回传参数 |
| | | return map; |
| | | } |
| | | |
| | | } catch (AlipayApiException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | // try { |
| | | // boolean flag = AlipaySignature.rsaCheckV1(params, alipayPublicKey, "UTF-8","RSA2"); |
| | | // if(flag){ |
| | | // Map<String, String> map = new HashMap<>(); |
| | | // String out_trade_no = params.get("out_trade_no"); |
| | | // String subject = params.get("subject"); |
| | | // String total_amount = params.get("total_amount"); |
| | | // String trade_no = params.get("trade_no"); |
| | | // map.put("out_trade_no", out_trade_no);//商家订单号 |
| | | // map.put("subject", subject); |
| | | // map.put("total_amount", total_amount); |
| | | // map.put("trade_no", trade_no);//支付宝交易号 |
| | | // return map; |
| | | // } |
| | | // |
| | | // } catch (AlipayApiException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // return null; |
| | | } |
| | | |
| | | |
| | |
| | | * @param tradeType 交易类型 |
| | | * @return |
| | | */ |
| | | public ResultUtil weixinpay(String body, String attach, String out_trade_no, String total_fee, String notify_url, String tradeType) throws Exception{ |
| | | public ResultUtil weixinpay(String body, String attach, String out_trade_no, String total_fee, String notify_url, String tradeType, String openid, String product_id) throws Exception{ |
| | | int i = new BigDecimal(total_fee).multiply(new BigDecimal("100")).intValue(); |
| | | String hostAddress = null; |
| | | try { |
| | |
| | | map.put("out_trade_no", out_trade_no);//存储的订单code |
| | | map.put("total_fee", i); |
| | | map.put("spbill_create_ip", hostAddress); |
| | | map.put("notify_url", callbackPath + notify_url); |
| | | map.put("notify_url", notify_url); |
| | | map.put("trade_type", tradeType); |
| | | map.put("openid", openid); |
| | | map.put("product_id", product_id); |
| | | String s = this.weixinSignature(map); |
| | | map.put("sign", s); |
| | | |
| | |
| | | xmlString.append("</xml>"); |
| | | |
| | | Map<String, String> map1 = null; |
| | | String body1 = httpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>()); |
| | | String body1 = httpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>()).getData(); |
| | | //将结果xml解析成map |
| | | body1 = body1.replaceAll("<!\\[CDATA\\[",""); |
| | | body1 = body1.replaceAll("]]>", ""); |
| | |
| | | String result_code = map1.get("result_code"); |
| | | if("SUCCESS".equals(result_code)){ |
| | | String type = map1.get("trade_type"); |
| | | String prepay_id = map1.get("prepay_id"); |
| | | switch (type){ |
| | | case "JSAPI": |
| | | break; |
| | | case "NATIVE": |
| | | String code_url = map1.get("code_url"); |
| | | return ResultUtil.success(code_url); |
| | | case "APP": |
| | | String prepay_id = map1.get("prepay_id"); |
| | | //重新进行签名后返回给前端 |
| | | Map<String, Object> map2 = new HashMap<>(); |
| | | map2.put("appid", appid); |
| | | map2.put("noncestr", nonce_str); |
| | | map2.put("package", "Sign=WXPay"); |
| | | map2.put("partnerid", mchId); |
| | | map2.put("prepayid", prepay_id); |
| | | map2.put("timestamp", new Date().getTime() / 1000); |
| | | String s1 = this.weixinSignature(map2); |
| | | map2.put("sign", s1); |
| | | System.err.println(map2); |
| | | map2.put("appId", map1.get("appid")); |
| | | map2.put("nonceStr", map1.get("nonce_str")); |
| | | map2.put("package", "prepay_id=" + prepay_id); |
| | | map2.put("signType", "MD5"); |
| | | map2.put("timeStamp", new Date().getTime() + ""); |
| | | String s2 = this.weixinSignature(map2); |
| | | |
| | | map2.put("prepay_id", prepay_id); |
| | | map2.put("mch_id", map1.get("mch_id")); |
| | | map2.put("trade_type", map1.get("trade_type")); |
| | | |
| | | map2.put("sign", s2); |
| | | return ResultUtil.success(map2); |
| | | case "NATIVE": |
| | | Map<String, Object> map4 = new HashMap<>(); |
| | | String code_url = map1.get("code_url"); |
| | | map4.put("code_url", code_url); |
| | | return ResultUtil.success(map4); |
| | | case "APP": |
| | | //重新进行签名后返回给前端 |
| | | Map<String, Object> map3 = new HashMap<>(); |
| | | map3.put("appid", appid); |
| | | map3.put("noncestr", nonce_str); |
| | | map3.put("package", "Sign=WXPay"); |
| | | map3.put("partnerid", mchId); |
| | | map3.put("prepayid", prepay_id); |
| | | map3.put("timestamp", new Date().getTime() / 1000); |
| | | String s3 = this.weixinSignature(map3); |
| | | map3.put("sign", s3); |
| | | System.err.println(map3); |
| | | return ResultUtil.success(map3); |
| | | } |
| | | return null; |
| | | }else{ |
| | |
| | | map1.put("result", result); |
| | | return map1; |
| | | }else{ |
| | | // System.err.println(map.get("err_code_des")); |
| | | System.err.println(map.get("err_code_des")); |
| | | } |
| | | }else{ |
| | | // System.err.println(map.get("return_msg")); |
| | | System.err.println(map.get("return_msg")); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | |
| | | xmlString.append("</xml>"); |
| | | |
| | | Map<String, String> map1 = null; |
| | | String body1 = httpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>()); |
| | | String body1 = null; |
| | | try { |
| | | body1 = httpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>()).getData(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | //将结果xml解析成map |
| | | body1 = body1.replaceAll("<!\\[CDATA\\[",""); |
| | | body1 = body1.replaceAll("]]>", ""); |
| | |
| | | map.put("out_refund_no", out_refund_no); |
| | | map.put("total_fee", tf); |
| | | map.put("refund_fee", rf); |
| | | map.put("notify_url", callbackPath + notify_url); |
| | | String s = this.weixinSignature(map, key); |
| | | map.put("notify_url", notify_url); |
| | | String s = this.weixinSignature(map); |
| | | map.put("sign", s); |
| | | |
| | | String url = "https://api.mch.weixin.qq.com/secapi/pay/refund"; |
| | |
| | | Map<String, String> map1 = null; |
| | | String body1 = null; |
| | | try { |
| | | String certPath = "C:\\cert\\1523106371_20211206_cert\\apiclient_cert.p12"; |
| | | body1 = httpClientUtil.pushHttpsRequsetXml(url, xmlString.toString(), new HashMap<>(), "1523106371", certPath, "PKCS12"); |
| | | |
| | | body1 = httpClientUtil.pushHttpsRequsetXml(url, xmlString.toString(), new HashMap<>(), mchId, certPath, "PKCS12"); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | map1.put("result", result); |
| | | return map1; |
| | | }else{ |
| | | // System.err.println(map.get("return_msg")); |
| | | System.err.println(map.get("return_msg")); |
| | | } |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | |
| | | xmlString.append("</xml>"); |
| | | |
| | | Map<String, String> map1 = null; |
| | | String body1 = httpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>()); |
| | | String body1 = httpClientUtil.pushHttpRequsetXml(url, xmlString.toString(), new HashMap<>()).getData(); |
| | | //将结果xml解析成map |
| | | body1 = body1.replaceAll("<!\\[CDATA\\[",""); |
| | | body1 = body1.replaceAll("]]>", ""); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 微信转账功能(企业付款到零钱) |
| | | * @param openid 商户appid下,某用户的openid |
| | | * @param desc 企业付款备注,必填。 |
| | | * @param total_fee 企业付款金额 |
| | | * @param partner_trade_no 商户订单号,需保持唯一性 |
| | | * @return |
| | | */ |
| | | public Map<String, String> wxTransfers(String openid, String desc, String total_fee, String partner_trade_no) throws Exception{ |
| | | int amount = new BigDecimal(total_fee).multiply(new BigDecimal("100")).intValue(); |
| | | String nonce_str = UUIDUtil.getRandomCode(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("mch_appid", appid);//申请商户号的appid或商户号绑定的appid |
| | | map.put("mchid", mchId);//微信支付分配的商户号 |
| | | map.put("nonce_str", nonce_str);//随机字符串,不长于32位 |
| | | map.put("partner_trade_no", partner_trade_no);//商户订单号,需保持唯一性 |
| | | map.put("openid", openid);//商户appid下,某用户的openid |
| | | map.put("check_name", "NO_CHECK");//NO_CHECK:不校验真实姓名 FORCE_CHECK:强校验真实姓名 |
| | | map.put("amount", amount);//企业付款金额,单位为分 |
| | | map.put("desc", desc);//企业付款备注,必填。 |
| | | String s = this.weixinSignature(map, key); |
| | | map.put("sign", s); |
| | | |
| | | String url = "https://api.mch.weixin.qq.com/mmpaymkttransfers/promotion/transfers"; |
| | | //设置请求头 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.APPLICATION_XML); |
| | | StringBuffer xmlString = new StringBuffer(); |
| | | Set<String> strings = map.keySet(); |
| | | String[] keys = {}; |
| | | keys = strings.toArray(keys); |
| | | Arrays.sort(keys); |
| | | xmlString.append("<xml>"); |
| | | for(int l = 0; l < keys.length; l++){ |
| | | xmlString.append("<" + keys[l] + ">" + map.get(keys[l]) + "</" + keys[l] + ">"); |
| | | } |
| | | xmlString.append("</xml>"); |
| | | |
| | | Map<String, String> map1 = null; |
| | | String certPath = "C:\\cert\\1523106371_20211206_cert\\apiclient_cert.p12";//证书地址 |
| | | String body1 = httpClientUtil.pushHttpsRequsetXml(url, xmlString.toString(), new HashMap<>(), "1523106371", certPath, "PKCS12"); |
| | | //将结果xml解析成map |
| | | body1 = body1.replaceAll("<!\\[CDATA\\[",""); |
| | | body1 = body1.replaceAll("]]>", ""); |
| | | try { |
| | | map1 = this.xmlToMap(body1, "UTF-8"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } catch (DocumentException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | String return_code = map1.get("return_code"); |
| | | Map<String, String> map2 = new HashMap<>(); |
| | | if("SUCCESS".equals(return_code)){ |
| | | String result_code = map1.get("result_code"); |
| | | if("SUCCESS".equals(result_code)){ |
| | | map2.put("return_code", result_code); |
| | | map2.put("payment_no", String.valueOf(map1.get("payment_no")));//付款订单号 |
| | | map2.put("payment_time", String.valueOf(map1.get("payment_time")));//付款时间 |
| | | return map2; |
| | | }else{ |
| | | map2.put("return_code", result_code); |
| | | map2.put("err_code", map1.get("err_code")); |
| | | map2.put("err_code_des", map1.get("err_code_des")); |
| | | return map2; |
| | | } |
| | | }else{ |
| | | map2.put("return_code", return_code); |
| | | map2.put("return_msg", map1.get("return_msg")); |
| | | return map2; |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 微信转账功能(企业付款到银行卡) |
| | | * @param desc 备注信息 |
| | | * @param total_fee 转账金额 |
| | | * @param partner_trade_no 订单号 |
| | | * @param enc_bank_no 银行卡号 |
| | | * @param enc_true_name 收款方用户名 |
| | | * @param bankName 银行名称 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public Map<String, String> wxPayBank(String desc, String total_fee, String partner_trade_no, String enc_bank_no, String enc_true_name, String bankName) throws Exception{ |
| | | int amount = new BigDecimal(total_fee).multiply(new BigDecimal("100")).intValue(); |
| | | String nonce_str = UUIDUtil.getRandomCode(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("mch_id", mchId);//微信支付分配的商户号 |
| | | map.put("nonce_str", nonce_str);//随机字符串,不长于32位 |
| | | map.put("partner_trade_no", partner_trade_no);//商户订单号,需保持唯一性 |
| | | map.put("enc_bank_no", enc_bank_no);//收款方银行卡号(采用标准RSA算法,公钥由微信侧提供) |
| | | map.put("enc_true_name", enc_true_name);//收款方用户名(采用标准RSA算法,公钥由微信侧提供) |
| | | map.put("bank_code", findBankCode(bankName));// |
| | | map.put("amount", amount);//企业付款金额,单位为分 |
| | | map.put("desc", desc);//企业付款备注,必填。 |
| | | String s = this.weixinSignature(map, key); |
| | | map.put("sign", s); |
| | | |
| | | String url = "https://api.mch.weixin.qq.com/mmpaysptrans/pay_bank"; |
| | | //设置请求头 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.APPLICATION_XML); |
| | | StringBuffer xmlString = new StringBuffer(); |
| | | Set<String> strings = map.keySet(); |
| | | String[] keys = {}; |
| | | keys = strings.toArray(keys); |
| | | Arrays.sort(keys); |
| | | xmlString.append("<xml>"); |
| | | for(int l = 0; l < keys.length; l++){ |
| | | xmlString.append("<" + keys[l] + ">" + map.get(keys[l]) + "</" + keys[l] + ">"); |
| | | } |
| | | xmlString.append("</xml>"); |
| | | |
| | | Map<String, String> map1 = null; |
| | | String certPath = "C:\\cert\\1523106371_20211206_cert\\apiclient_cert.p12";//证书地址 |
| | | String body1 = httpClientUtil.pushHttpsRequsetXml(url, xmlString.toString(), new HashMap<>(), "1523106371", certPath, "PKCS12"); |
| | | //将结果xml解析成map |
| | | body1 = body1.replaceAll("<!\\[CDATA\\[",""); |
| | | body1 = body1.replaceAll("]]>", ""); |
| | | try { |
| | | map1 = this.xmlToMap(body1, "UTF-8"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } catch (DocumentException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | String return_code = map1.get("return_code"); |
| | | Map<String, String> map2 = new HashMap<>(); |
| | | if("SUCCESS".equals(return_code)){ |
| | | String result_code = map1.get("result_code"); |
| | | if("SUCCESS".equals(result_code)){ |
| | | map2.put("return_code", result_code); |
| | | map2.put("payment_no", String.valueOf(map1.get("payment_no")));//付款订单号 |
| | | map2.put("cmms_amt", String.valueOf(map1.get("cmms_amt")));//手续费金额 RMB:分 |
| | | return map2; |
| | | }else{ |
| | | map2.put("return_code", result_code); |
| | | map2.put("err_code", map1.get("err_code")); |
| | | map2.put("err_code_des", map1.get("err_code_des")); |
| | | return map2; |
| | | } |
| | | }else{ |
| | | map2.put("return_code", return_code); |
| | | map2.put("return_msg", map1.get("return_msg")); |
| | | return map2; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 微信转账到银行卡不编号 |
| | | * @param bankName |
| | | * @return |
| | | */ |
| | | public String findBankCode(String bankName){ |
| | | String json = "{\"工商银行 \":1002,\"农业银行\":1005,\"建设银行\":1003,\"中国银行\":1026,\"交通银行 \":1020,\"招商银行 \":1001,\"邮储银行\":1066,\"民生银行 \":1006,\"平安银行 \":1010,\"中信银行\":1021,\"浦发银行 \":1004,\"兴业银行 \":1009,\"光大银行 \":1022,\"广发银行\":1027,\"华夏银行\":1025,\"宁波银行\":1056,\"北京银行\":4836,\"上海银行\":1024,\"南京银行\":1054,\"长子县融汇村镇银行\":4755,\"长沙银行\":4216,\"浙江泰隆商业银行\":4051,\"中原银行 \":4753,\"企业银行(中国)\":4761,\"顺德农商银行 \":4036,\"衡水银行\":4752,\"长治银行\":4756,\"大同银行\":4767,\"河南省农村信用社\":4115,\"宁夏黄河农村商业银行\":4150,\"山西省农村信用社\":4156,\"安徽省农村信用社\":4166,\"甘肃省农村信用社\":4157,\"天津农村商业银行\":4153,\"广西壮族自治区农村信用社\":4113,\"陕西省农村信用社\":4108,\"深圳农村商业银行\":4076,\"宁波鄞州农村商业银行\":4052,\"浙江省农村信用社联合社\":4764,\"江苏省农村信用社联合社\":4217,\"江苏紫金农村商业银行股份有限公司 \":4072,\"北京中关村银行股份有限公司 \":4769,\"星展银行( 中国) 有限公司 \":4778,\"枣庄银行股份有限公司 \":4766,\"海口联合农村商业银行股份有限公司 \":4758,\"南洋商业银行( 中国) 有限公司 \":4763}"; |
| | | JSONObject jsonObject = JSON.parseObject(json); |
| | | Set<String> strings = jsonObject.keySet(); |
| | | for(String key : strings){ |
| | | if(key.indexOf(bankName) >= 0){ |
| | | return jsonObject.getString(key); |
| | | } |
| | | } |
| | | return ""; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 支付宝转账 |
| | | * @param out_biz_no 商家侧唯一订单号,由商家自定义。对于不同转账请求,商家需保证该订单号在自身系统唯一。 |
| | | * @param trans_amount 订单总金额,单位为元,精确到小数点后两位 |
| | | * @param order_title 转账业务的标题,用于在支付宝用户的账单里显示 |
| | | * @param identity 参与方的唯一标识(收款方支付宝账号) |
| | | * @param name 参与方真实姓名,如果非空,将校验收款支付宝账号姓名一致性。 |
| | | * @param remark 业务备注 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public Map<String, Object> aliTransfer(String out_biz_no, Double trans_amount, String order_title, String identity, String name, String remark) throws Exception{ |
| | | CertAlipayRequest certAlipayRequest = new CertAlipayRequest(); |
| | | certAlipayRequest.setServerUrl("https://openapi.alipay.com/gateway.do"); //gateway:支付宝网关(固定)https://openapi.alipay.com/gateway.do |
| | | certAlipayRequest.setAppId(aliAppid); //APPID 即创建应用后生成,详情见创建应用并获取 APPID |
| | | certAlipayRequest.setPrivateKey(appPrivateKey); //开发者应用私钥,由开发者自己生成 |
| | | certAlipayRequest.setFormat("json"); //参数返回格式,只支持 json 格式 |
| | | certAlipayRequest.setCharset("UTF-8"); //请求和签名使用的字符编码格式,支持 GBK和 UTF-8 |
| | | certAlipayRequest.setSignType("RSA2"); //商户生成签名字符串所使用的签名算法类型,目前支持 RSA2 和 RSA,推荐商家使用 RSA2。 |
| | | certAlipayRequest.setCertPath(app_cert_path); //应用公钥证书路径(app_cert_path 文件绝对路径) |
| | | certAlipayRequest.setAlipayPublicCertPath(alipay_cert_path); //支付宝公钥证书文件路径(alipay_cert_path 文件绝对路径) |
| | | certAlipayRequest.setRootCertPath(alipay_root_cert_path); //支付宝CA根证书文件路径(alipay_root_cert_path 文件绝对路径) |
| | | AlipayClient alipayClient = new DefaultAlipayClient(certAlipayRequest); |
| | | AlipayFundTransUniTransferRequest request = new AlipayFundTransUniTransferRequest(); |
| | | request.setBizContent("{" + |
| | | "\"out_biz_no\":\"" + out_biz_no + "\"," + |
| | | "\"trans_amount\":" + trans_amount + "," + |
| | | "\"product_code\":\"TRANS_ACCOUNT_NO_PWD\"," + |
| | | "\"biz_scene\":\"DIRECT_TRANSFER\"," + |
| | | "\"order_title\":\"" + order_title + "\"," + |
| | | "\"payee_info\":{" + |
| | | "\"identity\":\"" + identity + "\"," + |
| | | "\"identity_type\":\"ALIPAY_USER_ID\"," + |
| | | "\"name\":\"" + name + "\"," + |
| | | "}," + |
| | | "\"remark\":\"" + remark + "\"" + |
| | | "}"); |
| | | AlipayFundTransUniTransferResponse response = alipayClient.certificateExecute(request); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | if(response.isSuccess()){ |
| | | String status = response.getStatus(); |
| | | if(status.equals("SUCCESS")){//成功 |
| | | map.put("code", response.getCode()); |
| | | map.put("order_id", response.getOrderId());//支付宝订单号 |
| | | map.put("pay_fund_order_id", response.getPayFundOrderId());//支付宝流水号 |
| | | }else{ |
| | | map.put("code", response.getCode()); |
| | | map.put("sub_msg", response.getSubMsg()); |
| | | } |
| | | } else { |
| | | map.put("code", response.getSubCode()); |
| | | map.put("sub_msg", response.getSubMsg()); |
| | | } |
| | | return map; |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | sb.append("key=" + key); |
| | | String sign = MD5AndKL.MD5Encode(sb.toString(), "UTF-8").toUpperCase(); //注:MD5签名方式 |
| | | return sign; |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 微信下单的签名算法 |
| | | * @param map |
| | | * @return |
| | | */ |
| | | private String weixinSignature(Map<String, Object> map, String key_){ |
| | | try { |
| | | Set<Map.Entry<String, Object>> entries = map.entrySet(); |
| | | List<Map.Entry<String, Object>> infoIds = new ArrayList<Map.Entry<String, Object>>(entries); |
| | | // 对所有传入参数按照字段名的 ASCII 码从小到大排序(字典序) |
| | | Collections.sort(infoIds, new Comparator<Map.Entry<String, Object>>() { |
| | | public int compare(Map.Entry<String, Object> o1, Map.Entry<String, Object> o2) { |
| | | return (o1.getKey()).toString().compareTo(o2.getKey()); |
| | | } |
| | | }); |
| | | // 构造签名键值对的格式 |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (Map.Entry<String, Object> item : infoIds) { |
| | | if (item.getKey() != null || item.getKey() != "") { |
| | | String key = item.getKey(); |
| | | Object val = item.getValue(); |
| | | if (!(val == "" || val == null)) { |
| | | sb.append(key + "=" + val + "&"); |
| | | } |
| | | } |
| | | } |
| | | sb.append("key=" + key_); |
| | | String sign = MD5AndKL.MD5Encode(sb.toString(), "UTF-8").toUpperCase(); //注:MD5签名方式 |
| | | return sign; |
| | | } catch (Exception e) { |
| | |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IOrderPositionService; |
| | | import com.stylefeng.guns.modular.system.service.ITransactionDetailsService; |
| | | import com.stylefeng.guns.modular.system.util.httpClinet.HttpClientUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/baseInfoVehicleTotalMile", map, header,"form"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/baseInfoVehicleTotalMile", map, header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("--------------------------网约车车辆里程信息------------------------:" + result); |
| | | } |
| | | |
| | |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/orderCreate", map, header,"form"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/orderCreate", map, header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("---------------------------订单发起接口----------------------:" + result); |
| | | } |
| | | |
| | |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/orderMatch", map, header,"form"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/orderMatch", map, header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("--------------------------------订单成功接口---------------------------:" + result); |
| | | } |
| | | |
| | |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operateLogin", map, header,"form"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operateLogin", map, header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("--------------------------车辆经营上线接口------------------------:" + result); |
| | | } |
| | | } |
| | |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operateLogout", map, header,"form"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operateLogout", map, header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("--------------------------------车辆经营下线接口------------------------:" + result); |
| | | } |
| | | } |
| | |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operateDepart", map,header,"form"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operateDepart", map,header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("--------------------------------经营出发接口-------------------------:" + result); |
| | | } |
| | | |
| | |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operateArrive", map, header,"form"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operateArrive", map, header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("-------------------------------经营到达接口-------------------------:" + result); |
| | | } |
| | | |
| | |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operatePay", map, header,"form"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/operatePay", map, header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("-----------------------经营支付接口-----------------------:" + result); |
| | | } |
| | | |
| | |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/positionDriver", map, header,"form"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/positionDriver", map, header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("-----------------------------驾驶员定位信息------------------------:" + result); |
| | | } |
| | | |
| | |
| | | header.put("Accept", "*/*"); |
| | | header.put("Accept-Encoding", "gzip"); |
| | | header.put("Accept-Charset", "utf-8"); |
| | | String result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/positionVehicle", map, header,"form"); |
| | | String result = null; |
| | | try { |
| | | result = httpClientUtil.pushHttpRequset("POST", path + "ministryOfTransport/positionVehicle", map, header,"form").toString(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | System.err.println("----------------------------车辆定位信息---------------------------:" + result); |
| | | } |
| | | |
| | |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.MathContext; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | |
| | | private Map<String, Timer> taskMap = new HashMap<>();//存储定时推送的定时器 |
| | | |
| | | private final String host = "http://ZUUL-GATEWAY/"; |
| | | |
| | | |
| | | /** |
| | |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", jsonObject.toJSONString()); |
| | | params.add("id", String.valueOf(uid)); |
| | | if(orderType == 2 && type == 1){ |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(orderId); |
| | | if(orderTaxi.getOrderSource() == 7){ |
| | | params.add("id", orderTaxi.getDeviceCode()); |
| | | }else{ |
| | | params.add("id", String.valueOf(uid)); |
| | | } |
| | | }else{ |
| | | params.add("id", String.valueOf(uid)); |
| | | } |
| | | params.add("type", String.valueOf(type)); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject(host + "/netty/sendMsgToClient",requestEntity , String.class); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | System.err.println(jsonObject1.getString("msg")); |
| | |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", jsonObject.toJSONString()); |
| | | params.add("id", String.valueOf(uid)); |
| | | if(orderType == 2 && type == 1){ |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(orderId); |
| | | if(orderTaxi.getOrderSource() == 7){ |
| | | params.add("id", orderTaxi.getDeviceCode()); |
| | | }else{ |
| | | params.add("id", String.valueOf(uid)); |
| | | } |
| | | }else{ |
| | | params.add("id", String.valueOf(uid)); |
| | | } |
| | | params.add("type", type.toString()); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject(host + "/netty/sendMsgToClient",requestEntity , String.class); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | System.err.println(jsonObject1.getString("msg")); |
| | |
| | | System.err.println("查询距离出错了"); |
| | | return; |
| | | }else{ |
| | | d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | } |
| | | JSONObject msg = new JSONObject(); |
| | | msg.put("code", 200); |
| | |
| | | if(null == distance){ |
| | | System.err.println("查询距离出错了"); |
| | | }else{ |
| | | d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | d = new BigDecimal(distance.get("distance")).divide(new BigDecimal(1000), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).toString(); |
| | | t = new BigDecimal(distance.get("duration")).divide(new BigDecimal(60), new MathContext(2, RoundingMode.HALF_EVEN)).setScale(2, BigDecimal.ROUND_HALF_EVEN).intValue() + ""; |
| | | } |
| | | map.put("laveMileage", d);//距离终点剩余未服务的里程数 |
| | | map.put("laveTime", t);//距离终端剩余未服务的预计时间 |
| | |
| | | JSONObject jsonObject = pushMap.get(orderId + "_" + orderType); |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", msg.toJSONString()); |
| | | params.add("id", jsonObject.getString("id")); |
| | | |
| | | if(orderType == 2){ |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(orderId); |
| | | if(orderTaxi.getOrderSource() == 7){ |
| | | params.add("id", orderTaxi.getDeviceCode()); |
| | | }else{ |
| | | params.add("id", jsonObject.getString("id")); |
| | | } |
| | | }else{ |
| | | params.add("id", jsonObject.getString("id")); |
| | | } |
| | | params.add("type", jsonObject.getString("type")); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject(host + "/netty/sendMsgToClient",requestEntity , String.class); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | System.err.println(jsonObject1.getString("msg")); |
| | |
| | | params.add("id", id.toString()); |
| | | params.add("type", type.toString()); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject(host + "/netty/sendMsgToClient",requestEntity , String.class); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | System.err.println(jsonObject1.getString("msg")); |
| | |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", jsonObject.toJSONString()); |
| | | params.add("id", String.valueOf(uid)); |
| | | |
| | | if(orderType == 2 && type == 1){ |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(orderId); |
| | | if(orderTaxi.getOrderSource() == 7){ |
| | | params.add("id", orderTaxi.getDeviceCode()); |
| | | }else{ |
| | | params.add("id", String.valueOf(uid)); |
| | | } |
| | | }else{ |
| | | params.add("id", String.valueOf(uid)); |
| | | } |
| | | params.add("type", String.valueOf(type)); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject(host + "/netty/sendMsgToClient",requestEntity , String.class); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | System.err.println(jsonObject1.getString("msg")); |
| | |
| | | //将请求头部和参数合成一个请求 |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("msg", jsonObject.toJSONString()); |
| | | params.add("id", String.valueOf(uid)); |
| | | |
| | | if(orderType == 2 && type == 1){ |
| | | OrderTaxi orderTaxi = orderTaxiService.selectById(orderId); |
| | | if(orderTaxi.getOrderSource() == 7){ |
| | | params.add("id", orderTaxi.getDeviceCode()); |
| | | }else{ |
| | | params.add("id", String.valueOf(uid)); |
| | | } |
| | | }else{ |
| | | params.add("id", String.valueOf(uid)); |
| | | } |
| | | params.add("type", String.valueOf(type)); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject(host + "/netty/sendMsgToClient",requestEntity , String.class); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/netty/sendMsgToClient",requestEntity , String.class); |
| | | JSONObject jsonObject1 = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject1.getIntValue("code") != 200){ |
| | | System.err.println(jsonObject1.getString("msg")); |
| | |
| | | @Autowired |
| | | private RestTemplate internalRestTemplate; |
| | | |
| | | private final String host = "http://ZUUL-GATEWAY/"; |
| | | |
| | | /** |
| | | * 向redis中存储字符串没有过期时间 |
| | |
| | | params.add("key", key); |
| | | params.add("value", value); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject(host + "/redis/setValue_", requestEntity, String.class); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/redis/setValue_", requestEntity, String.class); |
| | | JSONObject jsonObject = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject.getIntValue("code") != 200){ |
| | | System.err.println("调用redis出错了"); |
| | |
| | | params.add("value", value); |
| | | params.add("time", String.valueOf(time)); |
| | | HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject(host + "/redis/setValue", requestEntity, String.class); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/redis/setValue", requestEntity, String.class); |
| | | JSONObject jsonObject = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject.getIntValue("code") != 200){ |
| | | System.err.println("调用redis出错了"); |
| | |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("key", key); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject(host + "/redis/getValue",requestEntity , String.class); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/redis/getValue",requestEntity , String.class); |
| | | JSONObject jsonObject = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject.getIntValue("code") != 200){ |
| | | System.err.println("调用redis出错了"); |
| | |
| | | MultiValueMap<String, Object> params = new LinkedMultiValueMap<>(); |
| | | params.add("key", key); |
| | | HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers); |
| | | String s = internalRestTemplate.postForObject(host + "/redis/remove",requestEntity , String.class); |
| | | String s = internalRestTemplate.postForObject("http://zuul-gateway/redis/remove",requestEntity , String.class); |
| | | JSONObject jsonObject = JSON.parseObject(s, JSONObject.class); |
| | | if(jsonObject.getIntValue("code") != 200){ |
| | | System.err.println("调用redis出错了"); |
| | |
| | | |
| | | import com.stylefeng.guns.modular.system.service.IDriverService; |
| | | import com.stylefeng.guns.modular.system.service.IOrderService; |
| | | import com.stylefeng.guns.modular.system.service.IUserMerchantCouponService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | @Autowired |
| | | private JGPushUtil jgPushUtil; |
| | | |
| | | @Autowired |
| | | private IUserMerchantCouponService userMerchantCouponService; |
| | | |
| | | public Set<Integer> driverIds = new HashSet<>();//存储需要提醒司机预约单的司机id |
| | | |
| | | |
| | |
| | | driverService.taskOffWork(); |
| | | //处理结束订单后30分钟解绑小号功能 |
| | | orderService.taskMidAxbUnBindSend(); |
| | | //修改过期的商家券 |
| | | userMerchantCouponService.updateExpired(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util; |
| | | |
| | | import javax.imageio.ImageIO; |
| | | import java.awt.*; |
| | | import java.awt.geom.AffineTransform; |
| | | import java.awt.image.BufferedImage; |
| | | import java.io.File; |
| | | import java.io.FileOutputStream; |
| | | import java.io.IOException; |
| | | import java.io.OutputStream; |
| | | import java.util.Arrays; |
| | | import java.util.Random; |
| | | |
| | | public class VerifyCodeUtils { |
| | | //使用到Algerian字体,系统里没有的话需要安装字体,字体只显示大写,去掉了1,0,i,o几个容易混淆的字符 |
| | | public static final String VERIFY_CODES = "23456789ABCDEFGHJKLMNPQRSTUVWXYZ"; |
| | | private static Random random = new Random(); |
| | | |
| | | |
| | | /** |
| | | * 使用系统默认字符源生成验证码 |
| | | * @param verifySize 验证码长度 |
| | | * @return |
| | | */ |
| | | public static String generateVerifyCode(int verifySize){ |
| | | return generateVerifyCode(verifySize, VERIFY_CODES); |
| | | } |
| | | |
| | | /** |
| | | * 使用指定源生成验证码 |
| | | * @param verifySize 验证码长度 |
| | | * @param sources 验证码字符源 |
| | | * @return |
| | | */ |
| | | public static String generateVerifyCode(int verifySize, String sources){ |
| | | if(sources == null || sources.length() == 0){ |
| | | sources = VERIFY_CODES; |
| | | } |
| | | int codesLen = sources.length(); |
| | | Random rand = new Random(System.currentTimeMillis()); |
| | | StringBuilder verifyCode = new StringBuilder(verifySize); |
| | | for(int i = 0; i < verifySize; i++){ |
| | | verifyCode.append(sources.charAt(rand.nextInt(codesLen-1))); |
| | | } |
| | | return verifyCode.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 生成随机验证码文件,并返回验证码值 |
| | | * @param w |
| | | * @param h |
| | | * @param outputFile |
| | | * @param verifySize |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | public static String outputVerifyImage(int w, int h, File outputFile, int verifySize) throws IOException { |
| | | String verifyCode = generateVerifyCode(verifySize); |
| | | outputImage(w, h, outputFile, verifyCode); |
| | | return verifyCode; |
| | | } |
| | | |
| | | /** |
| | | * 输出随机验证码图片流,并返回验证码值 |
| | | * @param w |
| | | * @param h |
| | | * @param os |
| | | * @param verifySize |
| | | * @return |
| | | * @throws IOException |
| | | */ |
| | | public static String outputVerifyImage(int w, int h, OutputStream os, int verifySize) throws IOException{ |
| | | String verifyCode = generateVerifyCode(verifySize); |
| | | outputImage(w, h, os, verifyCode); |
| | | return verifyCode; |
| | | } |
| | | |
| | | /** |
| | | * 生成指定验证码图像文件 |
| | | * @param w |
| | | * @param h |
| | | * @param outputFile |
| | | * @param code |
| | | * @throws IOException |
| | | */ |
| | | public static void outputImage(int w, int h, File outputFile, String code) throws IOException{ |
| | | if(outputFile == null){ |
| | | return; |
| | | } |
| | | File dir = outputFile.getParentFile(); |
| | | if(!dir.exists()){ |
| | | dir.mkdirs(); |
| | | } |
| | | try{ |
| | | outputFile.createNewFile(); |
| | | FileOutputStream fos = new FileOutputStream(outputFile); |
| | | outputImage(w, h, fos, code); |
| | | fos.close(); |
| | | } catch(IOException e){ |
| | | throw e; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 输出指定验证码图片流 |
| | | * @param w |
| | | * @param h |
| | | * @param os |
| | | * @param code |
| | | * @throws IOException |
| | | */ |
| | | public static void outputImage(int w, int h, OutputStream os, String code) throws IOException{ |
| | | int verifySize = code.length(); |
| | | BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB); |
| | | Random rand = new Random(); |
| | | Graphics2D g2 = image.createGraphics(); |
| | | g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON); |
| | | Color[] colors = new Color[5]; |
| | | Color[] colorSpaces = new Color[] { Color.WHITE, Color.CYAN, |
| | | Color.GRAY, Color.LIGHT_GRAY, Color.MAGENTA, Color.ORANGE, |
| | | Color.PINK, Color.YELLOW }; |
| | | float[] fractions = new float[colors.length]; |
| | | for(int i = 0; i < colors.length; i++){ |
| | | colors[i] = colorSpaces[rand.nextInt(colorSpaces.length)]; |
| | | fractions[i] = rand.nextFloat(); |
| | | } |
| | | Arrays.sort(fractions); |
| | | |
| | | g2.setColor(Color.GRAY);// 设置边框色 |
| | | g2.fillRect(0, 0, w, h); |
| | | |
| | | Color c = getRandColor(200, 250); |
| | | g2.setColor(c);// 设置背景色 |
| | | g2.fillRect(0, 2, w, h-4); |
| | | |
| | | //绘制干扰线 |
| | | Random random = new Random(); |
| | | g2.setColor(getRandColor(160, 200));// 设置线条的颜色 |
| | | for (int i = 0; i < 20; i++) { |
| | | int x = random.nextInt(w - 1); |
| | | int y = random.nextInt(h - 1); |
| | | int xl = random.nextInt(6) + 1; |
| | | int yl = random.nextInt(12) + 1; |
| | | g2.drawLine(x, y, x + xl + 40, y + yl + 20); |
| | | } |
| | | |
| | | // 添加噪点 |
| | | float yawpRate = 0.05f;// 噪声率 |
| | | int area = (int) (yawpRate * w * h); |
| | | for (int i = 0; i < area; i++) { |
| | | int x = random.nextInt(w); |
| | | int y = random.nextInt(h); |
| | | int rgb = getRandomIntColor(); |
| | | image.setRGB(x, y, rgb); |
| | | } |
| | | |
| | | shear(g2, w, h, c);// 使图片扭曲 |
| | | |
| | | g2.setColor(getRandColor(100, 160)); |
| | | int fontSize = h-4; |
| | | Font font = new Font("Algerian", Font.ITALIC, fontSize); |
| | | g2.setFont(font); |
| | | char[] chars = code.toCharArray(); |
| | | for(int i = 0; i < verifySize; i++){ |
| | | AffineTransform affine = new AffineTransform(); |
| | | affine.setToRotation(Math.PI / 4 * rand.nextDouble() * (rand.nextBoolean() ? 1 : -1), (w / verifySize) * i + fontSize/2, h/2); |
| | | g2.setTransform(affine); |
| | | g2.drawChars(chars, i, 1, ((w-10) / verifySize) * i + 5, h/2 + fontSize/2 - 10); |
| | | } |
| | | |
| | | g2.dispose(); |
| | | ImageIO.write(image, "png", os); |
| | | } |
| | | |
| | | private static Color getRandColor(int fc, int bc) { |
| | | if (fc > 255) |
| | | fc = 255; |
| | | if (bc > 255) |
| | | bc = 255; |
| | | int r = fc + random.nextInt(bc - fc); |
| | | int g = fc + random.nextInt(bc - fc); |
| | | int b = fc + random.nextInt(bc - fc); |
| | | return new Color(r, g, b); |
| | | } |
| | | |
| | | private static int getRandomIntColor() { |
| | | int[] rgb = getRandomRgb(); |
| | | int color = 0; |
| | | for (int c : rgb) { |
| | | color = color << 8; |
| | | color = color | c; |
| | | } |
| | | return color; |
| | | } |
| | | |
| | | private static int[] getRandomRgb() { |
| | | int[] rgb = new int[3]; |
| | | for (int i = 0; i < 3; i++) { |
| | | rgb[i] = random.nextInt(255); |
| | | } |
| | | return rgb; |
| | | } |
| | | |
| | | private static void shear(Graphics g, int w1, int h1, Color color) { |
| | | shearX(g, w1, h1, color); |
| | | shearY(g, w1, h1, color); |
| | | } |
| | | |
| | | private static void shearX(Graphics g, int w1, int h1, Color color) { |
| | | |
| | | int period = random.nextInt(2); |
| | | |
| | | boolean borderGap = true; |
| | | int frames = 1; |
| | | int phase = random.nextInt(2); |
| | | |
| | | for (int i = 0; i < h1; i++) { |
| | | double d = (double) (period >> 1) |
| | | * Math.sin((double) i / (double) period |
| | | + (6.2831853071795862D * (double) phase) |
| | | / (double) frames); |
| | | g.copyArea(0, i, w1, 1, (int) d, 0); |
| | | if (borderGap) { |
| | | g.setColor(color); |
| | | g.drawLine((int) d, i, 0, i); |
| | | g.drawLine((int) d + w1, i, w1, i); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | private static void shearY(Graphics g, int w1, int h1, Color color) { |
| | | |
| | | int period = random.nextInt(40) + 10; // 50; |
| | | |
| | | boolean borderGap = true; |
| | | int frames = 20; |
| | | int phase = 7; |
| | | for (int i = 0; i < w1; i++) { |
| | | double d = (double) (period >> 1) |
| | | * Math.sin((double) i / (double) period |
| | | + (6.2831853071795862D * (double) phase) |
| | | / (double) frames); |
| | | g.copyArea(i, 0, 1, h1, 0, (int) d); |
| | | if (borderGap) { |
| | | g.setColor(color); |
| | | g.drawLine(i, (int) d, i, 0); |
| | | g.drawLine(i, (int) d + h1, i, h1); |
| | | } |
| | | |
| | | } |
| | | } |
| | | public static void main(String[] args) throws IOException{ |
| | | File dir = new File("C:/Users/H__D/Desktop/"); |
| | | int w = 200, h = 80; |
| | | String verifyCode = generateVerifyCode(4); |
| | | File file = new File(dir, verifyCode + ".jpg"); |
| | | outputImage(w, h, file, verifyCode); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.httpClinet; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import org.apache.http.NameValuePair; |
| | | import org.apache.http.client.config.RequestConfig; |
| | | import org.apache.http.client.entity.UrlEncodedFormEntity; |
| | | import org.apache.http.client.methods.CloseableHttpResponse; |
| | | import org.apache.http.client.methods.HttpGet; |
| | | import org.apache.http.client.methods.HttpPost; |
| | | import org.apache.http.conn.ssl.SSLConnectionSocketFactory; |
| | | import org.apache.http.entity.ContentType; |
| | | import org.apache.http.entity.StringEntity; |
| | | import org.apache.http.impl.client.CloseableHttpClient; |
| | | import org.apache.http.impl.client.HttpClients; |
| | | import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; |
| | | import org.apache.http.message.BasicNameValuePair; |
| | | import org.apache.http.ssl.SSLContexts; |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.net.ssl.SSLContext; |
| | | import java.io.File; |
| | | import java.io.FileInputStream; |
| | | import java.io.InputStream; |
| | | import java.nio.charset.Charset; |
| | | import java.security.KeyStore; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * http工具类 |
| | | */ |
| | | @Component |
| | | public class HttpClientUtil { |
| | | |
| | | private PoolingHttpClientConnectionManager connectionManager; |
| | | |
| | | |
| | | public HttpClientUtil(){ |
| | | //1.创建连接池管理器 |
| | | connectionManager = new PoolingHttpClientConnectionManager(60000, |
| | | TimeUnit.MILLISECONDS); |
| | | connectionManager.setMaxTotal(1000); |
| | | connectionManager.setDefaultMaxPerRoute(50); |
| | | } |
| | | |
| | | /** |
| | | * 创建一个httpClient对象 |
| | | */ |
| | | private CloseableHttpClient getHttpCline(){ |
| | | return HttpClients.custom() |
| | | .setConnectionManager(connectionManager) |
| | | .disableAutomaticRetries() |
| | | .build(); |
| | | } |
| | | |
| | | private RequestConfig getRequestConfig(){ |
| | | RequestConfig.Builder builder = RequestConfig.custom(); |
| | | builder.setSocketTimeout(60000)//3.1设置客户端等待服务端返回数据的超时时间 |
| | | .setConnectTimeout(30000)//3.2设置客户端发起TCP连接请求的超时时间 |
| | | .setExpectContinueEnabled(true) |
| | | .setConnectionRequestTimeout(30000);//3.3设置客户端从连接池获取链接的超时时间 |
| | | return builder.build(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 创建一个POST请求实例 |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | | */ |
| | | private CloseableHttpResponse setPostHttpRequset(String url, Map<String, Object> params, Map<String, String> header, String contentType) throws Exception{ |
| | | HttpPost httpPost = new HttpPost(url); |
| | | httpPost.setConfig(this.getRequestConfig()); |
| | | if(null != header){ |
| | | for(String key : header.keySet()){ |
| | | httpPost.setHeader(key, header.get(key)); |
| | | } |
| | | } |
| | | List<NameValuePair> list = new ArrayList<>(); |
| | | if(null != params){ |
| | | Set<String> keys = params.keySet(); |
| | | for(String key : keys){ |
| | | list.add(new BasicNameValuePair(key, null == params.get(key) ? null : params.get(key).toString())); |
| | | } |
| | | } |
| | | switch (contentType){ |
| | | case "form": |
| | | httpPost.setEntity(new UrlEncodedFormEntity(list, "UTF-8")); |
| | | break; |
| | | case "json": |
| | | ObjectMapper objectMapper = new ObjectMapper(); |
| | | String s =objectMapper.writeValueAsString(params); |
| | | httpPost.setEntity(new StringEntity(s, ContentType.create(ContentType.APPLICATION_JSON.getMimeType(), Charset.forName("UTF-8")))); |
| | | break; |
| | | } |
| | | return getHttpCline().execute(httpPost); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取get请求实例 |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | | */ |
| | | private CloseableHttpResponse setGetHttpRequset(String url, Map<String, Object> params, Map<String, String> header) throws Exception{ |
| | | StringBuffer sb = new StringBuffer(); |
| | | String p = ""; |
| | | if(null != params){ |
| | | Set<String> keys = params.keySet(); |
| | | for(String key : keys){ |
| | | sb.append(key + "=" + params.get(key) + "&"); |
| | | } |
| | | p = "?" + sb.substring(0, sb.length() - 1); |
| | | } |
| | | HttpGet httpGet = new HttpGet(url + p); |
| | | httpGet.setConfig(getRequestConfig()); |
| | | if(null != header){ |
| | | for(String key : header.keySet()){ |
| | | httpGet.setHeader(key, header.get(key)); |
| | | } |
| | | } |
| | | return getHttpCline().execute(httpGet); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 发送http请求 |
| | | * @param mothed "GET、POST、PUT、HEAD、DELETE、HEAD、OPTIONS" |
| | | * @param url 请求地址 |
| | | * @param params 请求参数 |
| | | * @param header 请求头 |
| | | * @param contentType 参数请求方式form/json |
| | | * @return |
| | | */ |
| | | public HttpResult pushHttpRequset(String mothed, String url, Map<String, Object> params, Map<String, String> header, String contentType) throws Exception{ |
| | | String randome = UUID.randomUUID().toString(); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss:S"); |
| | | System.err.println(sdf.format(new Date()) + "----(" + randome + ")请求参数:" + JSON.toJSONString(params)); |
| | | CloseableHttpResponse httpResponse = null; |
| | | switch (mothed){ |
| | | case "GET": |
| | | httpResponse = this.setGetHttpRequset(url, params, header); |
| | | break; |
| | | case "POST": |
| | | httpResponse = setPostHttpRequset(url, params, header, contentType); |
| | | break; |
| | | } |
| | | int statusCode = httpResponse.getStatusLine().getStatusCode(); |
| | | String content = EntityUtils.toString(httpResponse.getEntity(), "UTF-8"); |
| | | System.err.println(sdf.format(new Date()) + "----(" + randome + ")返回结果:" + content); |
| | | HttpResult httpResult = HttpResult.getHttpResult(statusCode, content); |
| | | this.close(httpResponse); |
| | | return httpResult; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 发送XML请求 |
| | | * @param url 请求地址 |
| | | * @param xml XML数据 |
| | | * @param header 自定义请求头 |
| | | * @return |
| | | */ |
| | | public HttpResult pushHttpRequsetXml(String url, String xml, Map<String, String> header) throws Exception{ |
| | | HttpPost httpPost = new HttpPost(url); |
| | | httpPost.setConfig(getRequestConfig()); |
| | | for(String key : header.keySet()){ |
| | | httpPost.setHeader(key, header.get(key)); |
| | | } |
| | | httpPost.setHeader("Content-Type", "application/xml"); |
| | | httpPost.setEntity(new StringEntity(xml, "UTF-8")); |
| | | CloseableHttpResponse httpResponse = getHttpCline().execute(httpPost); |
| | | int statusCode = httpResponse.getStatusLine().getStatusCode(); |
| | | String content = EntityUtils.toString(httpResponse.getEntity(), "UTF-8"); |
| | | HttpResult httpResult = HttpResult.getHttpResult(statusCode, content); |
| | | this.close(httpResponse); |
| | | return httpResult; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 请求https发送XML请求 |
| | | * @param url 接口路径 |
| | | * @param xml 内容 |
| | | * @param header 请求头 |
| | | * @param certPassword 证书密码 |
| | | * @param certPath 证书路径 |
| | | * @param certType 证书类型 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public String pushHttpsRequsetXml(String url, String xml, Map<String, String> header, String certPassword, String certPath, String certType) throws Exception{ |
| | | HttpPost httpPost = new HttpPost(url); |
| | | for(String key : header.keySet()){ |
| | | httpPost.setHeader(key, header.get(key)); |
| | | } |
| | | httpPost.setHeader("Content-Type", "application/xml"); |
| | | httpPost.setEntity(new StringEntity(xml, "UTF-8")); |
| | | CloseableHttpClient httpCline = this.initCert(certPassword, certPath, certType); |
| | | CloseableHttpResponse httpResponse = httpCline.execute(httpPost); |
| | | String content = null; |
| | | if(httpResponse.getStatusLine().getStatusCode() == 200){ |
| | | content = EntityUtils.toString(httpResponse.getEntity(), "UTF-8"); |
| | | }else{ |
| | | content = "返回状态码:" + httpResponse.getStatusLine() + "。" + EntityUtils.toString(httpResponse.getEntity()); |
| | | } |
| | | this.close(httpResponse); |
| | | httpCline.close(); |
| | | return content; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 初始化https对象(带证书) |
| | | * @param key 证书密码 |
| | | * @param certPath 证书路径 |
| | | * @param certType 证书类型 |
| | | * @throws Exception |
| | | */ |
| | | private CloseableHttpClient initCert(String key, String certPath, String certType) throws Exception { |
| | | KeyStore keyStore = KeyStore.getInstance(certType); |
| | | InputStream inputStream = new FileInputStream(new File(certPath)); |
| | | try { |
| | | keyStore.load(inputStream, key.toCharArray()); |
| | | } finally { |
| | | inputStream.close(); |
| | | } |
| | | SSLContext sslcontext = SSLContexts.custom().loadKeyMaterial(keyStore, key.toCharArray()).build(); |
| | | SSLConnectionSocketFactory sslsf = |
| | | new SSLConnectionSocketFactory(sslcontext, new String[] {"TLSv1"}, null, |
| | | SSLConnectionSocketFactory.BROWSER_COMPATIBLE_HOSTNAME_VERIFIER); |
| | | return HttpClients.custom().setSSLSocketFactory(sslsf).build(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 关闭资源 |
| | | */ |
| | | private void close(CloseableHttpResponse httpResponse){ |
| | | try { |
| | | if(null != httpResponse){ |
| | | EntityUtils.consume(httpResponse.getEntity());//此处高能,通过源码分析,由EntityUtils是否回收HttpEntity |
| | | httpResponse.close(); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | }finally { |
| | | try { |
| | | if(null != httpResponse){ |
| | | httpResponse.close(); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.util.httpClinet; |
| | | |
| | | |
| | | /** |
| | | * http请求返回封装 |
| | | */ |
| | | public class HttpResult { |
| | | /** |
| | | * 返回状态码 |
| | | */ |
| | | private Integer code; |
| | | /** |
| | | * 返回结果 |
| | | */ |
| | | private String data; |
| | | |
| | | /** |
| | | * 返回封装结果 |
| | | * @param code |
| | | * @param data |
| | | * @return |
| | | */ |
| | | public static HttpResult getHttpResult(Integer code, String data){ |
| | | HttpResult httpResult = new HttpResult(); |
| | | httpResult.setCode(code); |
| | | httpResult.setData(data); |
| | | return httpResult; |
| | | } |
| | | |
| | | public Integer getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(Integer code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getData() { |
| | | return data; |
| | | } |
| | | |
| | | public void setData(String data) { |
| | | this.data = data; |
| | | } |
| | | } |
| | |
| | | private String idCardImgUrl2; |
| | | @ApiModelProperty("初次领取驾驶证日期") |
| | | private String getDriverLicenseDate; |
| | | @ApiModelProperty("服务模式(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)多个以逗号分隔") |
| | | @ApiModelProperty("服务模式(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)多个以逗号分隔") |
| | | private String type; |
| | | @ApiModelProperty("从业地(带分隔符)") |
| | | private String placeOfPractice; |
| | |
| | | private String driveCardImgUrl; |
| | | @ApiModelProperty("网约车资格证照片") |
| | | private String networkCarlssueImg; |
| | | @ApiModelProperty("是否开通商家(0=否,1=是)") |
| | | private Integer merchant; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | this.laveBusinessMoney = laveBusinessMoney; |
| | | } |
| | | |
| | | public Integer getMerchant() { |
| | | return merchant; |
| | | } |
| | | |
| | | public void setMerchant(Integer merchant) { |
| | | this.merchant = merchant; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "DriverInfoWarpper{" + |
| | |
| | | driverInfoWarpper.setPlaceOfEmployment(null != map.get("placeOfEmployment") ? String.valueOf(map.get("placeOfEmployment")) : ""); |
| | | driverInfoWarpper.setLaveActivityMoney(null != map.get("laveActivityMoney") ? Double.valueOf(String.valueOf(map.get("laveActivityMoney"))) : 0); |
| | | driverInfoWarpper.setLaveBusinessMoney(null != map.get("laveBusinessMoney") ? Double.valueOf(String.valueOf(map.get("laveBusinessMoney"))) : 0); |
| | | driverInfoWarpper.setMerchant(null != map.get("merchant") ? Integer.valueOf(String.valueOf(map.get("merchant"))) : 0); |
| | | } |
| | | return driverInfoWarpper; |
| | | } |
| | |
| | | private String serverId; |
| | | @ApiModelProperty("高德猎鹰终端id") |
| | | private String terminalId; |
| | | @ApiModelProperty("是否需要完善资料(0=否,1=是)") |
| | | private Integer state = 0; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | |
| | | public void setTerminalId(String terminalId) { |
| | | this.terminalId = terminalId; |
| | | } |
| | | |
| | | public Integer getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(Integer state) { |
| | | this.state = state; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.warpper; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.util.List; |
| | | |
| | | @ApiModel |
| | | public class OfflineTravelPaymentWarpper { |
| | | @ApiModelProperty("总金额") |
| | | private Double total; |
| | | @ApiModelProperty("列表") |
| | | private List<BaseWarpper> list; |
| | | |
| | | public Double getTotal() { |
| | | return total; |
| | | } |
| | | |
| | | public void setTotal(Double total) { |
| | | this.total = total; |
| | | } |
| | | |
| | | public List<BaseWarpper> getList() { |
| | | return list; |
| | | } |
| | | |
| | | public void setList(List<BaseWarpper> list) { |
| | | this.list = list; |
| | | } |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.warpper; |
| | | |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | |
| | | private Double payMoney; |
| | | @ApiModelProperty("差价金额") |
| | | private Double differenceMoney; |
| | | @ApiModelProperty("支付感谢金额") |
| | | private Double thankYouFee; |
| | | @ApiModelProperty("是否是改派单(1=否,2=是)") |
| | | private Integer isReassign; |
| | | @ApiModelProperty("高德猎鹰轨迹id(订单开始后需要上传坐标到指定轨迹中)") |
| | |
| | | private Integer urgent; |
| | | @ApiModelProperty("下单用户姓名") |
| | | private String userName; |
| | | @ApiModelProperty("下单用户电话") |
| | | private String userPhone; |
| | | @ApiModelProperty("小件物流用户上传的图片") |
| | | private String userImg; |
| | | @ApiModelProperty("小件物流司机上传的图片") |
| | | private String driverImg; |
| | | @ApiModelProperty("需要送达时间") |
| | | private String arriveTimeExpect; |
| | | |
| | | |
| | | @ApiModelProperty("申诉状态 1=可申诉,2=不可申诉") |
| | | private Integer appealState; |
| | | @ApiModelProperty("超时费用") |
| | | private Double timeOutMoney; |
| | | @ApiModelProperty("退还费用") |
| | | private Double returnMoney; |
| | | @ApiModelProperty("提示信息") |
| | | private String note; |
| | | @ApiModelProperty("送达时间") |
| | | private String endServiceTime; |
| | | |
| | | public Double getReturnMoney() { |
| | | return returnMoney; |
| | | } |
| | | |
| | | public void setReturnMoney(Double returnMoney) { |
| | | this.returnMoney = returnMoney; |
| | | } |
| | | |
| | | public Integer getAppealState() { |
| | | return appealState; |
| | | } |
| | | |
| | | public void setAppealState(Integer appealState) { |
| | | this.appealState = appealState; |
| | | } |
| | | |
| | | public Double getTimeOutMoney() { |
| | | return timeOutMoney; |
| | | } |
| | | |
| | | public void setTimeOutMoney(Double timeOutMoney) { |
| | | this.timeOutMoney = timeOutMoney; |
| | | } |
| | | |
| | | public String getNote() { |
| | | return note; |
| | | } |
| | | |
| | | public void setNote(String note) { |
| | | this.note = note; |
| | | } |
| | | |
| | | public String getEndServiceTime() { |
| | | return endServiceTime; |
| | | } |
| | | |
| | | public void setEndServiceTime(String endServiceTime) { |
| | | this.endServiceTime = endServiceTime; |
| | | } |
| | | |
| | | public String getArriveTimeExpect() { |
| | | return arriveTimeExpect; |
| | | } |
| | | |
| | | public void setArriveTimeExpect(String arriveTimeExpect) { |
| | | this.arriveTimeExpect = arriveTimeExpect; |
| | | } |
| | | @ApiModelProperty("订单来源(1:APP下单,2:扫码下单,3:小程序下单,4:司机下单,5:调度下单,6:道行龙城,7:智慧屏)") |
| | | private Integer orderSource; |
| | | |
| | | public Integer getOrderId() { |
| | | return orderId; |
| | |
| | | this.differenceMoney = differenceMoney; |
| | | } |
| | | |
| | | public Double getThankYouFee() { |
| | | return thankYouFee; |
| | | public Integer getOrderSource() { |
| | | return orderSource; |
| | | } |
| | | |
| | | public void setThankYouFee(Double thankYouFee) { |
| | | this.thankYouFee = thankYouFee; |
| | | } |
| | | |
| | | public String getUserPhone() { |
| | | return userPhone; |
| | | } |
| | | |
| | | public void setUserPhone(String userPhone) { |
| | | this.userPhone = userPhone; |
| | | } |
| | | |
| | | public String getUserImg() { |
| | | return userImg; |
| | | } |
| | | |
| | | public void setUserImg(String userImg) { |
| | | this.userImg = userImg; |
| | | } |
| | | |
| | | public String getDriverImg() { |
| | | return driverImg; |
| | | } |
| | | |
| | | public Integer getSpellSuccess() { |
| | | return spellSuccess; |
| | | } |
| | | |
| | | public void setSpellSuccess(Integer spellSuccess) { |
| | | this.spellSuccess = spellSuccess; |
| | | } |
| | | |
| | | public void setDriverImg(String driverImg) { |
| | | this.driverImg = driverImg; |
| | | } |
| | | |
| | | @ApiModelProperty("乘车类型(1=独享,2=一口价,3=拼车)") |
| | | private Integer rideType; |
| | | @ApiModelProperty("是否拼车成功(0未成功,1成功)") |
| | | private Integer spellSuccess; |
| | | |
| | | @ApiModelProperty("是否可以操作(0不可以,1可以)") |
| | | private Integer canOperation; |
| | | |
| | | public Integer getCanOperation() { |
| | | return canOperation; |
| | | } |
| | | |
| | | public void setCanOperation(Integer canOperation) { |
| | | this.canOperation = canOperation; |
| | | } |
| | | |
| | | public Integer getRideType() { |
| | | return rideType; |
| | | } |
| | | |
| | | public void setRideType(Integer rideType) { |
| | | this.rideType = rideType; |
| | | public void setOrderSource(Integer orderSource) { |
| | | this.orderSource = orderSource; |
| | | } |
| | | |
| | | @Override |
| | |
| | | public static OrderInfoWarpper getOrderInfoWarpper(Map<String, Object> map){ |
| | | OrderInfoWarpper orderInfoWarpper = new OrderInfoWarpper(); |
| | | if(null != map){ |
| | | orderInfoWarpper.setCanOperation(null != map.get("canOperation") ? Integer.valueOf(String.valueOf(map.get("canOperation"))) : 1); |
| | | orderInfoWarpper.setRideType(null != map.get("rideType") ? Integer.valueOf(String.valueOf(map.get("rideType"))) : 1); |
| | | orderInfoWarpper.setOrderId(null != map.get("orderId") ? Integer.valueOf(String.valueOf(map.get("orderId"))) : 0); |
| | | orderInfoWarpper.setOrderState(null != map.get("orderState") ? Integer.valueOf(String.valueOf(map.get("orderState"))) : 0); |
| | | orderInfoWarpper.setOrderName(null != map.get("orderName") ? String.valueOf(map.get("orderName")) : ""); |
| | |
| | | orderInfoWarpper.setNickName(null != map.get("nickName") ? String.valueOf(map.get("nickName")) : ""); |
| | | orderInfoWarpper.setPhone(null != map.get("telX") ? String.valueOf(map.get("telX")) : (null != map.get("phone") ? String.valueOf(map.get("phone")) : "")); |
| | | orderInfoWarpper.setHistoryNum(null != map.get("historyNum") ? Integer.valueOf(String.valueOf(map.get("historyNum"))) : 0); |
| | | orderInfoWarpper.setSpellSuccess(null != map.get("spellSuccess") ? Integer.valueOf(String.valueOf(map.get("spellSuccess"))) : 0); |
| | | orderInfoWarpper.setOrderMoney(null != map.get("orderMoney") ? Double.valueOf(String.valueOf(map.get("orderMoney"))) : 0); |
| | | orderInfoWarpper.setPayManner(null != map.get("payManner") ? Integer.valueOf(String.valueOf(map.get("payManner"))) : 0); |
| | | orderInfoWarpper.setPayMoney(null != map.get("payMoney") ? Double.valueOf(String.valueOf(map.get("payMoney"))) : 0); |
| | |
| | | orderInfoWarpper.setCargoType(null != map.get("cargoType") ? Integer.valueOf(map.get("cargoType").toString()) : 0); |
| | | orderInfoWarpper.setUrgent(null != map.get("urgent") ? Integer.valueOf(map.get("urgent").toString()) : 0); |
| | | orderInfoWarpper.setUserName(null != map.get("userName") ? String.valueOf(map.get("userName")) : ""); |
| | | orderInfoWarpper.setUserPhone(null != map.get("userPhone") ? String.valueOf(map.get("userPhone")) : ""); |
| | | orderInfoWarpper.setDifferenceMoney(null != map.get("differenceMoney") ? Double.valueOf(map.get("differenceMoney").toString()) : 0D); |
| | | orderInfoWarpper.setUserImg(null != map.get("userImg") ? String.valueOf(map.get("userImg")) : ""); |
| | | orderInfoWarpper.setDriverImg(null != map.get("driverImg") ? String.valueOf(map.get("driverImg")) : ""); |
| | | orderInfoWarpper.setThankYouFee(null != map.get("thankYouFee") ? Double.valueOf(map.get("thankYouFee").toString()) : 0D); |
| | | orderInfoWarpper.setArriveTimeExpect(null != map.get("arriveTimeExpect") ? String.valueOf(map.get("arriveTimeExpect")) : ""); |
| | | |
| | | orderInfoWarpper.setEndServiceTime(null != map.get("endServiceTime") ? String.valueOf(map.get("endServiceTime")) : ""); |
| | | if (ToolUtil.isNotEmpty(map.get("appealState"))){ |
| | | orderInfoWarpper.setAppealState(Integer.valueOf(map.get("appealState").toString())); |
| | | }else { |
| | | orderInfoWarpper.setAppealState(1); |
| | | } |
| | | orderInfoWarpper.setNote(null != map.get("note") ? String.valueOf(map.get("note")) : ""); |
| | | orderInfoWarpper.setTimeOutMoney(null != map.get("timeOutMoney") ? Double.valueOf(String.valueOf(map.get("timeOutMoney"))) : 0D); |
| | | orderInfoWarpper.setReturnMoney(null != map.get("returnMoney") ? Double.valueOf(String.valueOf(map.get("returnMoney"))) : 0D); |
| | | orderInfoWarpper.setOrderSource(null != map.get("orderSource") ? Integer.valueOf(map.get("orderSource").toString()) : 0); |
| | | } |
| | | return orderInfoWarpper; |
| | | } |
| | |
| | | public class OrderListWarpper implements Comparable { |
| | | @ApiModelProperty("订单id") |
| | | private Integer id; |
| | | @ApiModelProperty("订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)") |
| | | @ApiModelProperty("订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)") |
| | | private Integer type; |
| | | @ApiModelProperty("订单名称") |
| | | private String name; |
| | |
| | | private String remark; |
| | | @ApiModelProperty("支付方式(1=OK平台支付(线上支付),2=其他方式支付(线下支付))") |
| | | private Integer payManner; |
| | | @ApiModelProperty("小件物流用户上传图片") |
| | | private String userImg; |
| | | @ApiModelProperty("小件物流司机上传图片") |
| | | private String driverImg; |
| | | private Long travelTime; |
| | | @ApiModelProperty("需要送达时间") |
| | | private String arriveTimeExpect; |
| | | @ApiModelProperty("超时状态(1=超时,2=未超时)") |
| | | private Integer TimeOutState; |
| | | @ApiModelProperty("乘车类型(1=独享,2=一口价,3=拼车)") |
| | | private Integer rideType; |
| | | |
| | | @ApiModelProperty("是否拼单成功(0未成功,1成功)") |
| | | private Integer spellSuccess; |
| | | |
| | | public Integer getSpellSuccess() { |
| | | return spellSuccess; |
| | | } |
| | | |
| | | public void setSpellSuccess(Integer spellSuccess) { |
| | | this.spellSuccess = spellSuccess; |
| | | } |
| | | |
| | | public Integer getRideType() { |
| | | return rideType; |
| | | } |
| | | |
| | | public void setRideType(Integer rideType) { |
| | | this.rideType = rideType; |
| | | } |
| | | |
| | | public Integer getTimeOutState() { |
| | | return TimeOutState; |
| | | } |
| | | |
| | | public void setTimeOutState(Integer timeOutState) { |
| | | TimeOutState = timeOutState; |
| | | } |
| | | |
| | | public String getArriveTimeExpect() { |
| | | return arriveTimeExpect; |
| | | } |
| | | |
| | | public void setArriveTimeExpect(String arriveTimeExpect) { |
| | | this.arriveTimeExpect = arriveTimeExpect; |
| | | } |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | this.cargoNumber = cargoNumber; |
| | | } |
| | | |
| | | public String getUserImg() { |
| | | return userImg; |
| | | } |
| | | |
| | | public void setUserImg(String userImg) { |
| | | this.userImg = userImg; |
| | | } |
| | | |
| | | public String getDriverImg() { |
| | | return driverImg; |
| | | } |
| | | |
| | | public void setDriverImg(String driverImg) { |
| | | this.driverImg = driverImg; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "OrderListWarpper{" + |
| | |
| | | for(Map<String, Object> map : maps){ |
| | | OrderListWarpper orderListWarpper = new OrderListWarpper(); |
| | | orderListWarpper.setId(null != map.get("id") ? Integer.valueOf(String.valueOf(map.get("id"))) : 0); |
| | | orderListWarpper.setRideType(null != map.get("rideType") ? Integer.valueOf(String.valueOf(map.get("rideType"))) : 1); |
| | | orderListWarpper.setSpellSuccess(null != map.get("spellSuccess") ? Integer.valueOf(String.valueOf(map.get("spellSuccess"))) : 0); |
| | | orderListWarpper.setName(null != map.get("name") ? String.valueOf(map.get("name")) : ""); |
| | | orderListWarpper.setTime(null != map.get("time") ? String.valueOf(map.get("time")) : ""); |
| | | orderListWarpper.setStartAddress(null != map.get("startAddress") ? String.valueOf(map.get("startAddress")) : ""); |
| | |
| | | orderListWarpper.setRemark(null != map.get("remark") ? String.valueOf(map.get("remark")) : ""); |
| | | orderListWarpper.setPayManner(null != map.get("payManner") ? Integer.valueOf(String.valueOf(map.get("payManner"))) : 0); |
| | | orderListWarpper.setTravelTime(null != map.get("travelTime") ? Long.valueOf(String.valueOf(map.get("travelTime"))) : 0); |
| | | orderListWarpper.setUserImg(null != map.get("userImg") ? String.valueOf(map.get("userImg")) : ""); |
| | | orderListWarpper.setDriverImg(null != map.get("driverImg") ? String.valueOf(map.get("driverImg")) : ""); |
| | | orderListWarpper.setArriveTimeExpect(null != map.get("arriveTimeExpect") ? String.valueOf(map.get("arriveTimeExpect")) : ""); |
| | | orderListWarpper.setTimeOutState(null != map.get("timeOutState") ? Integer.parseInt(map.get("timeOutState").toString()) : 2); |
| | | list.add(orderListWarpper); |
| | | } |
| | | } |
| | |
| | | public class OrderStatusWarpper { |
| | | @ApiModelProperty("订单id") |
| | | private Integer orderId; |
| | | @ApiModelProperty("订单类型(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)") |
| | | @ApiModelProperty("订单类型(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)") |
| | | private Integer orderType; |
| | | @ApiModelProperty("订单状态(1=待接单,2=待出发,3=待到达预约地点,4=待乘客上车,5=服务中,6=完成服务,7=待支付,8=待评价,9=已完成,10=已取消,11=改派中)") |
| | | private Integer state; |
| | |
| | | private String idCardImgUrl2; |
| | | @ApiModelProperty("初次领取驾驶证日期") |
| | | private Date getDriverLicenseDate; |
| | | @ApiModelProperty("服务模式(1=专车/快车,2=出租车,3=机场专线,7=景区直通车,8=公务出行)多个以逗号分隔") |
| | | @ApiModelProperty("服务模式(1=专车,2=出租车,3=城际,4=小件物流-同城,5=小件物流-跨城,6=包车)多个以逗号分隔") |
| | | private String type; |
| | | @ApiModelProperty("从业地行政代码(510100)") |
| | | private String placeOfEmployment; |
| | |
| | | <result column="parkMoney" property="parkMoney"/> |
| | | <result column="roadTollMoney" property="roadTollMoney"/> |
| | | <result column="tipMoney" property="tipMoney"/> |
| | | <result column="holidayFee" property="holidayFee"/> |
| | | <result column="redPacketMoney" property="redPacketMoney"/> |
| | | <result column="couponMoney" property="couponMoney"/> |
| | | <result column="redPacketId" property="redPacketId"/> |
| | |
| | | <result column="activityId" property="activityId"/> |
| | | <result column="companyId" property="companyId"/> |
| | | <result column="payMoney" property="payMoney"/> |
| | | <result column="thankYouFee" property="thankYouFee"/> |
| | | <result column="substitute" property="substitute"/> |
| | | <result column="passengers" property="passengers"/> |
| | | <result column="passengersPhone" property="passengersPhone"/> |
| | |
| | | <result column="endServiceTime" property="endServiceTime"/> |
| | | <result column="orderType" property="orderType"/> |
| | | <result column="orderSource" property="orderSource"/> |
| | | <result column="deviceCode" property="deviceCode"/> |
| | | <result column="invoiceId" property="invoiceId"/> |
| | | <result column="isReassign" property="isReassign"/> |
| | | <result column="reassignNotice" property="reassignNotice"/> |
| | |
| | | a.endLat as endLat, |
| | | a.orderMoney as orderMoney, |
| | | a.payManner as payManner, |
| | | a.thankYouFee, |
| | | a.trackId as trackId, |
| | | b.nickName as nickName, |
| | | a.passengersPhone as phone, |
| | | a.orderType as reservation, |
| | | a.telX as telX, |
| | | a.bindId as bindId, |
| | | a.orderSource as orderSource, |
| | | ( |
| | | (select count(id) from t_order_private_car where userId = b.id and state in (8, 9)) + |
| | | (select count(id) from t_order_taxi where userId = b.id and state in (8, 9)) + |
| | |
| | | */ |
| | | @TableField("tipMoney") |
| | | private Double tipMoney; |
| | | //节假日费 |
| | | @TableField("holidayFee") |
| | | private Double holidayFee; |
| | | /** |
| | | * 红包抵扣金额 |
| | | */ |
| | |
| | | */ |
| | | @TableField("payMoney") |
| | | private Double payMoney; |
| | | //感谢费 |
| | | @TableField("thankYouFee") |
| | | private Double thankYouFee; |
| | | /** |
| | | * 是否是代下单(0:否,1:是) |
| | | */ |
| | |
| | | */ |
| | | @TableField("orderSource") |
| | | private Integer orderSource; |
| | | /** |
| | | * 设备号 |
| | | */ |
| | | @TableField("deviceCode") |
| | | private String deviceCode; |
| | | /** |
| | | * 发票id |
| | | */ |
| | |
| | | this.tipMoney = tipMoney; |
| | | } |
| | | |
| | | public Double getHolidayFee() { |
| | | return holidayFee; |
| | | } |
| | | |
| | | public void setHolidayFee(Double holidayFee) { |
| | | this.holidayFee = holidayFee; |
| | | } |
| | | |
| | | public Double getRedPacketMoney() { |
| | | return redPacketMoney; |
| | | } |
| | |
| | | |
| | | public void setPayMoney(Double payMoney) { |
| | | this.payMoney = payMoney; |
| | | } |
| | | |
| | | public Double getThankYouFee() { |
| | | return thankYouFee; |
| | | } |
| | | |
| | | public void setThankYouFee(Double thankYouFee) { |
| | | this.thankYouFee = thankYouFee; |
| | | } |
| | | |
| | | public Integer getSubstitute() { |
| | |
| | | this.bindId = bindId; |
| | | } |
| | | |
| | | public String getDeviceCode() { |
| | | return deviceCode; |
| | | } |
| | | |
| | | public void setDeviceCode(String deviceCode) { |
| | | this.deviceCode = deviceCode; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "OrderTaxi{" + |
| | |
| | | |
| | | |
| | | /** |
| | | * 确认费用操作 |
| | | * @param orderId |
| | | * @param type |
| | | * @param travelFee |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil confirmFees1(Integer orderId, Integer type, Double travelFee, String additionalFee) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 确认费用(车载端) |
| | | * @param orderId |
| | | * @param type |
| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.dao.RegionMapper; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.model.Driver; |
| | | import com.stylefeng.guns.modular.system.model.OrderPosition; |
| | | import com.stylefeng.guns.modular.system.model.Region; |
| | | import com.stylefeng.guns.modular.system.model.UserRedPacketRecord; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.*; |
| | | import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper; |
| | | import com.stylefeng.guns.modular.taxi.model.OrderTaxi; |
| | | import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Isolation; |
| | |
| | | import java.util.*; |
| | | |
| | | @Service |
| | | @Transactional(isolation = Isolation.READ_UNCOMMITTED, propagation = Propagation.REQUIRED, rollbackFor = Exception.class) |
| | | public class OrderTaxiServiceImpl extends ServiceImpl<OrderTaxiMapper, OrderTaxi> implements IOrderTaxiService { |
| | | |
| | | @Resource |
| | |
| | | private IDriverService driverService; |
| | | |
| | | @Autowired |
| | | private IUserRedPacketRecordService userRedPacketRecordService; |
| | | |
| | | @Autowired |
| | | private PushUtil pushUtil; |
| | | |
| | | @Autowired |
| | | private GDMapElectricFenceUtil gdMapElectricFenceUtil; |
| | | |
| | | @Autowired |
| | | private GDFalconUtil gdFalconUtil; |
| | |
| | | @Autowired |
| | | private GeodesyUtil geodesyUtil; |
| | | |
| | | @Resource |
| | | private RegionMapper regionMapper; |
| | | |
| | | @Autowired |
| | | private GDMapGeocodingUtil gdMapGeocodingUtil; |
| | | |
| | | @Autowired |
| | | private IOrderPrivateCarService orderPrivateCarService; |
| | | |
| | | @Autowired |
| | | private ICompanyService companyService; |
| | | |
| | | @Autowired |
| | | private IOrderAdditionalFeeService orderAdditionalFeeService; |
| | | |
| | | |
| | | |
| | |
| | | orderTaxi.setTrackId(track); |
| | | |
| | | //调用移动的小号接口 |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderTaxi.getPassengersPhone(), driver.getPhone(), (System.currentTimeMillis() + 86400000)); |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(orderTaxi.getStartLon().toString(), orderTaxi.getStartLat().toString()); |
| | | Region region = regionMapper.query(geocode.get("districtCode")); |
| | | Map<String, String> map = chinaMobileUtil.midAxbBindSend(orderTaxi.getPassengersPhone(), driver.getPhone(), Integer.valueOf(region.getCitycode().substring(1))); |
| | | if(String.valueOf(map.get("code")).equals("200")){ |
| | | orderTaxi.setTelX(map.get("telX")); |
| | | orderTaxi.setBindId(map.get("bindId")); |
| | |
| | | .eq("userId", orderTaxi.getUserId()) |
| | | .ne("state", 1) |
| | | .eq("crossCityOrderId", orderTaxi.getCrossCityOrderId()) |
| | | .eq("place", orderTaxi.getPlace()).ne("id", orderTaxi.getId()) |
| | | .eq("place", orderTaxi.getPlace()) |
| | | ); |
| | | List<OrderPrivateCar> list1 = orderPrivateCarService.selectList( |
| | | new EntityWrapper<OrderPrivateCar>() |
| | |
| | | } |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(2, "您已成功抢得出租车订单,请及时联系客户!", orderTaxi.getDriverId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getName().substring(0, 1) + "师傅,请保持电话畅通!", orderTaxi.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(2, "您已成功抢得出租车订单,请及时联系客户!", orderTaxi.getDriverId()); |
| | | systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getName().substring(0, 1) + "师傅,请保持电话畅通!", orderTaxi.getUserId()); |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | } |
| | | }).start(); |
| | | |
| | | systemNoticeService.addSystemNotice(2, "您已成功抢得出租车订单,请及时联系客户!", orderTaxi.getDriverId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getName().substring(0, 1) + "师傅,请保持电话畅通!", orderTaxi.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(2, "您已成功抢得出租车订单,请及时联系客户!", orderTaxi.getDriverId()); |
| | | systemNoticeService.addSystemNotice(1, "您的订单已指派给" + driver.getName().substring(0, 1) + "师傅,请保持电话畅通!", orderTaxi.getUserId()); |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | |
| | | case 3://出发前往预约点 |
| | | orderTaxi.setState(3); |
| | | orderTaxi.setSetOutTime(new Date()); |
| | | systemNoticeService.addSystemNotice(1, "司机已出发,请耐心等待", orderTaxi.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "司机已出发,请耐心等待", orderTaxi.getUserId()); |
| | | break; |
| | | case 4://到达预约点,等待客户上车 |
| | | orderTaxi.setState(4); |
| | | orderTaxi.setArriveTime(new Date()); |
| | | systemNoticeService.addSystemNotice(1, "司机已到达您设置的预约地点,请及时上车", orderTaxi.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "司机已到达您设置的预约地点,请及时上车", orderTaxi.getUserId()); |
| | | break; |
| | | case 5://开始服务 |
| | | orderTaxi.setBoardingLon(lon); |
| | |
| | | orderTaxi.setEndServiceTime(new Date()); |
| | | |
| | | pushUtil.removeTask(orderId, 2);//删除定时任务,结束推送数据 |
| | | systemNoticeService.addSystemNotice(1, "司机已结束本次行程,谢谢使用", orderTaxi.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "司机已结束本次行程,谢谢使用", orderTaxi.getUserId()); |
| | | break; |
| | | } |
| | | this.updateById(orderTaxi); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public ResultUtil confirmFees1(Integer orderId, Integer type, Double travelFee, String additionalFee) throws Exception { |
| | | OrderTaxi orderTaxi = this.selectById(orderId); |
| | | orderTaxi.setPayManner(type); |
| | | if(type == 2){//其他支付,不需要操作,直接完成订单 |
| | | orderTaxi.setOrderMoney(0D); |
| | | orderTaxi.setTravelMoney(0D); |
| | | orderTaxi.setParkMoney(0D); |
| | | orderTaxi.setRoadTollMoney(0D); |
| | | orderTaxi.setHolidayFee(0D); |
| | | orderTaxi.setRedPacketMoney(0D); |
| | | orderTaxi.setCouponMoney(0D); |
| | | orderTaxi.setDiscount(0D); |
| | | orderTaxi.setDiscountMoney(0D); |
| | | orderTaxi.setPayMoney(0D); |
| | | orderTaxi.setState(8); |
| | | }else{ |
| | | orderTaxi = this.setMoney1(orderTaxi, travelFee, additionalFee); |
| | | orderTaxi.setState(7); |
| | | } |
| | | this.updateById(orderTaxi); |
| | | |
| | | //回滚司机状态为空闲 |
| | | Driver driver = driverService.selectById(orderTaxi.getDriverId()); |
| | | driver.setState(2); |
| | | driverService.updateById(driver); |
| | | |
| | | OrderTaxi finalOrderTaxi = orderTaxi; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState()); |
| | | pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState()); |
| | | } |
| | | }).start(); |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 确认费用(车载端) |
| | | * @param orderId |
| | |
| | | this.updateById(orderTaxi); |
| | | |
| | | pushUtil.removeTask(orderId, 2);//删除定时任务,结束推送数据 |
| | | systemNoticeService.addSystemNotice(1, "司机已结束本次行程,谢谢使用", orderTaxi.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "司机已结束本次行程,谢谢使用", orderTaxi.getUserId()); |
| | | |
| | | //回滚司机状态为空闲 |
| | | Driver driver = driverService.selectById(orderTaxi.getDriverId()); |
| | |
| | | this.updateById(orderTaxi); |
| | | |
| | | pushUtil.removeTask(orderId, 2);//删除定时任务,结束推送数据 |
| | | systemNoticeService.addSystemNotice(1, "司机已结束本次行程,谢谢使用", orderTaxi.getUserId(), 1); |
| | | systemNoticeService.addSystemNotice(1, "司机已结束本次行程,谢谢使用", orderTaxi.getUserId()); |
| | | |
| | | //回滚司机状态为空闲 |
| | | Driver driver = driverService.selectById(orderTaxi.getDriverId()); |
| | |
| | | orderTaxi.setTravelMoney(travelFee); |
| | | orderTaxi.setParkMoney(parkingFee); |
| | | orderTaxi.setRoadTollMoney(crossingFee); |
| | | BigDecimal sum = new BigDecimal(null == travelFee ? 0 : travelFee).add(new BigDecimal(null == parkingFee ? 0 : parkingFee)) |
| | | .add(new BigDecimal(null == crossingFee ? 0 : crossingFee)).add(new BigDecimal(null == orderTaxi.getTipMoney() ? 0 : orderTaxi.getTipMoney())); |
| | | orderTaxi.setOrderMoney(sum.setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | return orderTaxi; |
| | | } |
| | | |
| | | |
| | | public OrderTaxi setMoney1(OrderTaxi orderTaxi, Double travelFee, String additionalFee) throws Exception{ |
| | | orderTaxi.setTravelMoney(travelFee); |
| | | orderTaxi.setParkMoney(0D); |
| | | orderTaxi.setRoadTollMoney(0D); |
| | | Company company = companyService.selectById(orderTaxi.getCompanyId()); |
| | | BigDecimal t = new BigDecimal(0); |
| | | if(ToolUtil.isNotEmpty(additionalFee)){//附加费 |
| | | JSONArray jsonArray = JSON.parseArray(additionalFee); |
| | | for(int i = 0; i < jsonArray.size(); i++){ |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | Integer id = jsonObject.getInteger("id"); |
| | | Double amount = jsonObject.getDouble("amount"); |
| | | OrderAdditionalFee orderAdditionalFee = new OrderAdditionalFee(); |
| | | orderAdditionalFee.setOrderType(2); |
| | | orderAdditionalFee.setOrderId(orderTaxi.getId()); |
| | | orderAdditionalFee.setAdditionalFeeId(id); |
| | | orderAdditionalFee.setAmount(amount); |
| | | orderAdditionalFeeService.insert(orderAdditionalFee); |
| | | t = t.add(new BigDecimal(amount)); |
| | | } |
| | | } |
| | | |
| | | orderTaxi.setHolidayFee(null == company.getHolidayFee() ? 0D : company.getHolidayFee()); |
| | | BigDecimal sum = new BigDecimal(null == travelFee ? 0 : travelFee).add(new BigDecimal(0)) |
| | | .add(new BigDecimal(0)).add(new BigDecimal(orderTaxi.getHolidayFee())) |
| | | .add(new BigDecimal(null == orderTaxi.getTipMoney() ? 0 : orderTaxi.getTipMoney())).add(t); |
| | | BigDecimal sum = new BigDecimal(travelFee).add(new BigDecimal(parkingFee)).add(new BigDecimal(crossingFee)).add(new BigDecimal(orderTaxi.getTipMoney())); |
| | | orderTaxi.setOrderMoney(sum.setScale(2, BigDecimal.ROUND_HALF_EVEN).doubleValue()); |
| | | return orderTaxi; |
| | | } |
| | |
| | | |
| | | wx: |
| | | grantType: authorization_code #填authorization_code |
| | | appid: wxfba0dbf7c79c8593 #应用唯一标识,在微信开放平台提交应用审核通过后获得 |
| | | appSecret: 99ffb558cc6af57fd60703fb36e28829 #应用密钥AppSecret,在微信开放平台提交应用审核通过后获得 |
| | | appid: wx65d2c03f04352f90 #应用唯一标识,在微信开放平台提交应用审核通过后获得 |
| | | appSecret: ce6e3ca71b3c5bec6bca778dbeda0cdf #应用密钥AppSecret,在微信开放平台提交应用审核通过后获得 |
| | | appletsAppid: #小程序APPid |
| | | appletsAppSecret: # |
| | | mchId: 1523106371 #微信支付分配的商户号 |
| | | key: s4TQO0NqPaRc0YfGptejNjlOpFlt4y2K #key为商户平台设置的密钥key: |
| | | mchId: 1415940702 #微信支付分配的商户号 |
| | | key: OKCHUXING20221226gxyskjYXGSwengk #key为商户平台设置的密钥key: |
| | | certPath: /usr/local/server/cer/weixin/apiclient_cert.p12 |
| | | |
| | | |
| | | alipay: |
| | | appid: 2021003104609427 #应用程序唯一标识 |
| | | appPrivateKey: MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC7Kry43+tFiWnNhg9Us48Jzbjf/65hO/d0epihS4LnAO15L+V4UZfpSfIvIC5N6kEnkem+/abBnhAtSQE05s4gR3PtuP0H2SNX79+pgFliA1QvaSoA514f+APKiDUPTkmaTbp3MXCx0RGYEAEd6LOi8AUbFF2QWKDiMY76ac2l2FirVEeU8r9dIvPu1WDtTMoxAGFu6JfNsZ1ik8VyZUvULHyrXbe6Fx4KFX8kFX4PYEZ8RU3q6y9PCwMAjiPoBMs7t9s4GBrlfGoxMoC6+Lthh6rhLEq4OLoVVzrh/H+yWXg0SpFhnxN3RtIWueVWc9qsF7wtFoP4gXDWI/x6OmFRAgMBAAECggEBALhARjCpHm8B60oL4yO67+DyyECa7wuBgQUFeyOttlu6KgzW/csIZ8ecp/GEeJDzPti5Z6ZBBdwswjgSWkG9xMU6EgG/zjffpk93MHMoitVV+ZYCrPreyWYnPXQvyiwbIZHpWtrjrNEfw3YyqybKYazRI/WYgtMKrLZ/mwUhCvVq6CEwVMRDZXc2ietCtrZvbH4XuRtbXxxddzjiChhlRVwbD4Vei5eYS7F97PjHSrtjxjPyatw/mq6Gwh7tkjXuBliB2NwLcHkkm4FT4WxyLSWO8OydYPFYC5E6ENaZmZZMub3bXQ66xciCXwWMHZ7uRe5tmwtxWj8QqjLj8GtciAECgYEA8dVP6ViKSuwQ6WInDvAxoLrrcEX3D5N17L4sb0kfUtsd7S+g4MbHueXAmIqdlFXnCvjmfFUYg4kqfYU/PqaElntupuvTzwe4JUAtnmw7MB72iP6fzL1x3kBFgzn4ZaVzcRafRiiqE27+KPOkD+uNsgCMExIeTC6IgaKUbkjMjOECgYEAxiGdHN9ho44uBORW8+kdX1c92PFfpHsRcLdZkE6C+kjoS2QAMl1mM72yWHRn+rqK/Kk5BCipQ92+K/j78Zs1Zmunz+JJvQgTxQ2HFlW1tnb53K9F4xr6K1ysYdVmfeLH5wtNAJ2aLabD9Nzi/7RW4Oz83rN3bPFW4Dxgi5O0cnECgYEAgzejLJIGN7DvXDMNzmU2CGhj53+PFryEd/iYU6nxfRu3mUMGn/A73vpzDlHoPtx9iM6VAVGLA5QhognyzyO7PYur9pZvTx55JH02Q4emde3XB25hds40QsvM6+9AgKbNhMcplP/riK/o6H+KvbiqIbN6Tb6/Accd+nkk4NJPawECgYEArKbb9y39Mn4SQfcMgo2QJ+WpImPruTP5FaTgaizQW/OuYQvqU/kpt0rFn+kINufZd6Sq56HbJiWTs1PLkFV06iRD3pZNNWlVePB52A+mQjNZNmKR3v5CJAkkujgwkOBO3FnvpuqvULqypazaLoLi9ivtis8O8aM41jwm0VpL8zECgYAXoKO7mfyehcyOqHTgvUo8JOIZm4G1zxZxMImutQc13ZY0mZniGFuZJ5cXFWHpyscrt69zklpp1uhYJLsaoKfPUeZi1ZujlSA7uY4vEYUoEA+AQT541/Bn7JqOoUnLAMzsucEF0vUV/kYmePe68B3JbrxZKisgFkR5OB/8/Nh2og== #开发者应用私钥 |
| | | alipayPublicKey: 1 #应用公钥 |
| | | alipay_public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuyq8uN/rRYlpzYYPVLOPCc243/+uYTv3dHqYoUuC5wDteS/leFGX6UnyLyAuTepBJ5Hpvv2mwZ4QLUkBNObOIEdz7bj9B9kjV+/fqYBZYgNUL2kqAOdeH/gDyog1D05Jmk26dzFwsdERmBABHeizovAFGxRdkFig4jGO+mnNpdhYq1RHlPK/XSLz7tVg7UzKMQBhbuiXzbGdYpPFcmVL1Cx8q123uhceChV/JBV+D2BGfEVN6usvTwsDAI4j6ATLO7fbOBga5XxqMTKAuvi7YYeq4SxKuDi6FVc64fx/sll4NEqRYZ8Td0bSFrnlVnParBe8LRaD+IFw1iP8ejphUQIDAQAB #支付宝公钥 |
| | | appid: 2021003173699189 #应用程序唯一标识 |
| | | appPrivateKey: MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCAiHuyQXVNVPIzGR0BYANKT+pVCH99AyArbHJ67jrCc6gkyKB6pmDnOLWgKLE5i9QYaRXpVbuFxb2hsFpHYGrr5cvNvdrx1sb5mvEps4Ri+pir4yOWgEIWdDBT68FbOhOIxB++JPhcrE1pdS16aasEPcREMQ1AdFpcahBqvTGgMZ7rXL7md1SzAj6lEeauuzCn27wEAD+6X7MxHp+qlu6NdgOQNLiGEO7z6EsUN9E880O7yDYmF/D4w7ib/zPURqvCI7B4/ZMD8OvGsTY7jEV+wnXVyiJTzzxzDx89sTRiUh0uQt2IWxqAL0LP8qjCNMum9f3Ln8c5oTWBaeY54AQxAgMBAAECggEADFuS8P+EJKw/IRSQClrN1i46zHQltcJALIyfsRwIgDuYdfjoHQK0HGcCZ2SiLXM5MCOiXK3GesUZR1tqQqSNgyKz5pMTYt8QgF0aRLUizFVlqlkLSeQI9pmzL85h58B8slCQ8LojOt3CD5qZhcR1EdJSdW/14zWMnogADhMkm08mzX8DWFA9cMcr+vT8OYdJg7/W4rq63jsnPyDaOBSuLQrpNBbRLIsY0cH0K/iV5xqXgpQ+yAo7TLTlTn1Ksbifzocf5QOuok8tNNriFTc0nLWRTOWCMT3zgbrqxEeF07p5NWETQX/oTLISrQbstqzHxzxfmbrWTfLlTve188S2pQKBgQDQcWaqOe774PObjqwORJhc3R6ST1PZ4Lkq+Q114ByDg9dAAEL9Nq6MLhdVvIOiYTVea2X7Gt+2N9iJMHFTR1Tfnq5NnDZnwswy7ZfWcbF2wzT3SfW7C4ved+Qx4fZJNfLmBy3xQu9fLsWt8ZcwhoG84dnoAdkf1bhkntPWMMgFMwKBgQCd28Lvm4aw8WXBG1C2EAq7ndR/nKMR1QSbtZB6kCPJrCvQ429YHxDpN96cxoxU5jQuUQDJ9pRxPScSMU8uEbSW6LZqSrH5pb9K3ZCKPcGLK8LhNsLt+c3CBXhYSNN+mpWzZogo/MU+kGl8M/pMAUvXzInesRjDOr6iFi790IMJCwKBgB5ZRH9oa/lUaWOuxDJXnm926mqXDjhc1dkB5gnRlZU4bvCsmRRRD9ztIQyko+3ShXi33mNPKF9ZhjeDTBy5+AuPCQXXxrwYyq5nlYHtj88g4OdYZ2TSa4z6m8j/g2JpbnI7fV7xRfTv1GxdDoxMKTudDqMPEdPmxDAyR9mZxKWtAoGBAIcLFpOmaC59BICTnpNx28yu87gLxxEdO6j9RVEkeAkyCfXUa09mnC/3hLB3xltm6CLrVxJvqIPLPd55YnRV3zjucgcySVj5a1FfhCRPOoCVekzybQXqmxQtW8ui2ZNIKWLlBvyRaSfhoOwJB0n4HerJ5vQkaruxSJ4e/ipSM5cLAoGBAIzHL/DIHb6sY0BJQqa4bLKt6eM9pvd/Md7oIuNzUEkx5eVZhfiPYYMqoQxfo8ELKgAWabpHZs4HHG0YuPpm5uy7cy2FtRKVyNiRhHMRhAU4H3m4DQ3R9E1XfuPqFYc9sXVST2qLLDMthD+RGxaxjwM0ldN4SoMtFUGimV2cARF4 #开发者应用私钥 |
| | | alipayPublicKey: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgIh7skF1TVTyMxkdAWADSk/qVQh/fQMgK2xyeu46wnOoJMigeqZg5zi1oCixOYvUGGkV6VW7hcW9obBaR2Bq6+XLzb3a8dbG+ZrxKbOEYvqYq+MjloBCFnQwU+vBWzoTiMQfviT4XKxNaXUtemmrBD3ERDENQHRaXGoQar0xoDGe61y+5ndUswI+pRHmrrswp9u8BAA/ul+zMR6fqpbujXYDkDS4hhDu8+hLFDfRPPNDu8g2Jhfw+MO4m/8z1EarwiOweP2TA/DrxrE2O4xFfsJ11coiU888cw8fPbE0YlIdLkLdiFsagC9Cz/KowjTLpvX9y5/HOaE1gWnmOeAEMQIDAQAB #应用公钥 |
| | | alipay_public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjD0KOXx7r+2up36WFe+W7JwsP56FK7lfoat6cn0JGgtNkQPhyRz+9fu9jvf36TZzBCiNqjomCGBr2Dyi355p1O+e+ct515bqr+NktG+K0prd0kAM4vODZrZM6bt3IdajhCCf3xZZe04Xe0kQ9qst8McjWusRoy+L3DEpTpr0wPfGs9rZpaHE/AVT8WQ39EHBWMNjMIwhU1sxna5MHwUlJ/zRgx9vF9v+CQymDHBVPC09UkEMYm4dfV2sT85eVtsCj7mfeWPhFiI5AAkDqpRNtIoucrOZYbjF+ZkdYzBVInU9LapfsXhTYyRYLqasjgqdnRIPej1tECIy0VBESVRWYwIDAQAB #支付宝公钥 |
| | | |
| | | juhe: #聚合数据 |
| | | appKey: 943b175324b6e6c0a6f9c6713aaaa696 # |
| | | appKey: 0d3fd83eddaa33e5563f548257648577 # |
| | | |
| | | |
| | | jiguang: |
| | | appKey-driver: 367e8bd2bdfbd42b324c0b3b #极光推送应用唯一标识 |
| | | masterSecret-driver: 756330afbda2a57b344f1d48 #用于服务器端 API 调用时与 AppKey 配合使用达到鉴权的目的 |
| | | appKey-dispatch: 7eecaa0ce660780f4b364684 #极光推送应用唯一标识 |
| | | masterSecret-dispatch: fca87938cb39a72360ea3293 #用于服务器端 API 调用时与 AppKey 配合使用达到鉴权的目的 |
| | | appKey-driver: 93204c35ded9ba377a14af19 #极光推送应用唯一标识 |
| | | masterSecret-driver: e4f6f435faefad29db6ba9b2 #用于服务器端 API 调用时与 AppKey 配合使用达到鉴权的目的 |
| | | appKey-dispatch: cc212ee6dcecb26625917f40 #极光推送应用唯一标识 |
| | | masterSecret-dispatch: 0d163a25a20647665c28639e #用于服务器端 API 调用时与 AppKey 配合使用达到鉴权的目的 |
| | | |
| | | #filePath: /usr/local/server/orderPostionFile/ #存储订单轨迹文件路径 |
| | | filePath: C:/orderPostionFile/ #存储订单轨迹文件路径 |
| | |
| | | spring: |
| | | profiles: dev |
| | | datasource: |
| | | url: jdbc:mysql://8.130.76.108:10011/tianma?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true |
| | | url: jdbc:mysql://8.130.76.108:10011/tm?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true |
| | | username: root |
| | | password: kuanzhaiyx |
| | | db-name: tianma #用来搜集数据库的所有表 |
| | |
| | | guns: |
| | | muti-datasource: |
| | | open: false |
| | | url: jdbc:mysql://127.0.0.1:3306/kuanzhaiyx?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://127.0.0.1:3306/tm?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | # password: Root2020! |
| | | password: 123456 |
| | |
| | | spring: |
| | | profiles: prod |
| | | datasource: |
| | | url: jdbc:mysql://8.130.76.108:10011/tianma?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true |
| | | url: jdbc:mysql://8.130.76.108:10011/tm?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true |
| | | username: root |
| | | password: kuanzhaiyx |
| | | db-name: tianma #用来搜集数据库的所有表 |
| | |
| | | guns: |
| | | muti-datasource: |
| | | open: false |
| | | url: jdbc:mysql://122.9.140.208:10010/kuanzhaiyx?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | url: jdbc:mysql://8.130.76.108:10010/tm?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: root |
| | | # password: Root2020! |
| | | password: 123456 |
| | |
| | | </div> |
| | | </div> |
| | | @} |
| | | <div class="form-group" style="float: left;"> |
| | | <div class="checkbox" style="text-align: left"> |
| | | <label> |
| | | <input type="checkbox" name="remember" style="margin-top: 2px;">记住我 |
| | | </label> |
| | | </div> |
| | | </div> |
| | | <button type="submit" class="btn btn-primary block full-width m-b">登 录</button> |
| | | </p> |
| | | </form> |