| | |
| | | orderTaxi.setGetoffLat(lat); |
| | | orderTaxi.setGetoffAddress(address); |
| | | orderTaxi.setGetoffTime(new Date()); |
| | | orderTaxi.setEndServiceTime(new Date()); |
| | | if(orderTaxi.getPayManner()==3){ |
| | | orderTaxi.setState(9); |
| | | Driver driver = driverService.selectById(orderTaxi.getDriverId()); |
| | |
| | | transactionDetails.setOrderId(orderTaxi.getId()); |
| | | transactionDetailsMapper.insert(transactionDetails); |
| | | driverService.updateById(driver); |
| | | }else { |
| | | orderTaxi.setState(6); |
| | | } |
| | | orderTaxi.setEndServiceTime(new Date()); |
| | | //打表计费,直接订单完成支付, |
| | | if(orderTaxi.getPayManner()==2){ |
| | | orderTaxi = this.setMoney2(orderTaxi, 0D, 0D); |
| | | //在线上计费的基础上随机加0.01-1的金额 |
| | | Double orderMoney = orderTaxi.getOrderMoney() + (new BigDecimal(Math.random()).setScale(2, BigDecimal.ROUND_DOWN).doubleValue()); |
| | | orderTaxi.setState(8); |
| | | orderTaxi.setOrderMoney(orderMoney); |
| | | orderTaxi.setPayMoney(orderMoney); |
| | | Driver driver = driverService.selectById(orderTaxi.getDriverId()); |
| | | |
| | | Company company = companyService.selectById(driver.getFranchiseeId()); |
| | | if(Objects.isNull(company)){ |
| | | company = companyService.selectById(driver.getCompanyId()); |
| | | } |
| | | TransactionDetails transactionDetails = new TransactionDetails(); |
| | | driver.setBalance(driver.getBalance() - company.getFixedDeduction()); |
| | | transactionDetails.setMoney(company.getFixedDeduction()); |
| | | // 新增扣除使用费记录 |
| | | transactionDetails.setUserId(driver.getId()); |
| | | transactionDetails.setInsertTime(new Date()); |
| | | transactionDetails.setRemark("软件使用费"); |
| | | transactionDetails.setState(2); |
| | | transactionDetails.setType(1); |
| | | transactionDetails.setUserType(2); |
| | | transactionDetails.setOrderType(6); |
| | | transactionDetails.setOrderId(orderTaxi.getId()); |
| | | transactionDetailsMapper.insert(transactionDetails); |
| | | driverService.updateById(driver); |
| | | } |
| | | //线上计费,计算费用后修改为待支付 |
| | | if(orderTaxi.getPayManner()==1){ |
| | | orderTaxi = this.setMoney2(orderTaxi, 0D, 0D); |
| | | orderTaxi.setState(7); |
| | | } |
| | | //回滚司机状态为空闲 |
| | | Driver driver = driverService.selectById(orderTaxi.getDriverId()); |
| | | driver.setState(2); |
| | | driverService.updateById(driver); |
| | | |
| | | pushUtil.removeTask(orderId, 2);//删除定时任务,结束推送数据 |
| | | systemNoticeService.addSystemNotice(1, "司机已结束本次行程,谢谢使用", orderTaxi.getUserId()); |
| | | break; |
| | |
| | | this.updateById(orderTaxi); |
| | | |
| | | // TODO: 2020/6/5 推送状态 |
| | | OrderTaxi finalOrderTaxi = orderTaxi; |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | pushUtil.pushOrderState(1, orderTaxi.getUserId(), orderTaxi.getId(), 2, orderTaxi.getState()); |
| | | pushUtil.pushOrderState(2, orderTaxi.getDriverId(), orderTaxi.getId(), 2, orderTaxi.getState()); |
| | | pushUtil.pushOrderState(1, finalOrderTaxi.getUserId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState()); |
| | | pushUtil.pushOrderState(2, finalOrderTaxi.getDriverId(), finalOrderTaxi.getId(), 2, finalOrderTaxi.getState()); |
| | | } |
| | | }).start(); |
| | | return ResultUtil.success(); |
| | |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.IInviteService; |
| | | import com.stylefeng.guns.modular.system.service.ITCompanyService; |
| | | import com.stylefeng.guns.modular.system.service.ITDriverService; |
| | | import com.stylefeng.guns.modular.system.util.HttpRequestUtil; |
| | | import com.stylefeng.guns.modular.system.util.PushURL; |
| | | import org.apache.commons.lang.time.DateUtils; |
| | |
| | | |
| | | @Autowired |
| | | private ITUserService tUserService; |
| | | |
| | | @Autowired |
| | | private ITDriverService driverService; |
| | | |
| | | /** |
| | | * 跳转到用户管理首页 |
| | |
| | | String nickName, |
| | | String phone, |
| | | Integer isAuth, |
| | | Integer state,String companyName) { |
| | | Integer state,String companyName, String inviteUser) { |
| | | String beginTime = null; |
| | | String endTime = null; |
| | | if (SinataUtil.isNotEmpty(insertTime)){ |
| | |
| | | endTime = timeArray[1]; |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | List<Map<String, Object>> userList = tUserService.getUserList(page, beginTime, endTime, ShiroKit.getUser().getRoleType(), ShiroKit.getUser().getObjectId(), isAuth, state, id, nickName, phone, companyName); |
| | | List<Map<String, Object>> userList = tUserService.getUserList(page, beginTime, endTime, ShiroKit.getUser().getRoleType(), ShiroKit.getUser().getObjectId(), isAuth, |
| | | state, id, nickName, phone, companyName, inviteUser); |
| | | for (Map<String, Object> stringObjectMap : userList) { |
| | | String string = stringObjectMap.get("id").toString(); |
| | | int i = inviteService.selectCount(new EntityWrapper<Invite>() |
| | |
| | | .eq("userType",1) |
| | | ); |
| | | stringObjectMap.put("inviteNumber", i); |
| | | Invite invite = inviteService.selectOne(new EntityWrapper<Invite>().eq("userId", string)); |
| | | if(null != invite){ |
| | | String inviteUser1 = ""; |
| | | if(1 == invite.getUserType()){ |
| | | inviteUser1 = tUserService.selectById(invite.getInviteUserId()).getPhone(); |
| | | }else{ |
| | | inviteUser1 = driverService.selectById(invite.getInviteUserId()).getPhone(); |
| | | } |
| | | stringObjectMap.put("inviteUser", inviteUser1); |
| | | } |
| | | |
| | | } |
| | | page.setRecords(userList); |
| | | return super.packForBT(page); |
| | |
| | | shellList.add("紧急联系人电话"); |
| | | shellList.add("是否实名认证"); |
| | | shellList.add("历史出行次数"); |
| | | shellList.add("邀请人"); |
| | | shellList.add("邀请次数"); |
| | | shellList.add("历史消费"); |
| | | shellList.add("积分"); |
| | |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("inviteUser"))){ |
| | | shellList.add(object.get("inviteUser").toString()); |
| | | }else{ |
| | | shellList.add("-"); |
| | | } |
| | | if(SinataUtil.isNotEmpty(object.get("inviteNumber"))){ |
| | | shellList.add(object.get("inviteNumber").toString()); |
| | | }else{ |
| | |
| | | @Param("id") String id, |
| | | @Param("nickName") String nickName, |
| | | @Param("phone") String phone, |
| | | @Param("companyName") String companyName); |
| | | @Param("companyName") String companyName, |
| | | @Param("inviteUser") String inviteUser); |
| | | |
| | | /** |
| | | * 根据用户ID获取用户详情 |
| | |
| | | LEFT JOIN (select * from t_company where flag != 3) as ci on ci.id = ui.companyId |
| | | LEFT JOIN (SELECT COUNT(id) as num,userId from t_order_taxi where FIND_IN_SET(state,'8,9') GROUP BY userId) as ot on ot.userId = ui.id |
| | | LEFT JOIN (SELECT sum(money) as num,userId from t_pub_transaction_details where userType = 1 and type = 1 and state = 2 GROUP BY userId) as td on td.userId = ui.id |
| | | LEFT JOIN t_invite inv1 on (ui.id = inv1.userId and inv1.userType = 1) |
| | | left join t_user uu on (inv1.inviteUserId = uu.id) |
| | | LEFT JOIN t_invite inv2 on (ui.id = inv2.userId and inv2.userType = 2) |
| | | left join t_driver dd on (inv2.inviteUserId = dd.id) |
| | | where 1 = 1 |
| | | <if test="inviteUser != null and inviteUser != ''"> |
| | | and (uu.phone LIKE CONCAT('%',#{inviteUser},'%') or dd.phone LIKE CONCAT('%',#{inviteUser},'%')) |
| | | </if> |
| | | ) as o |
| | | <where> |
| | | o.flag != 3 |
| | |
| | | /** |
| | | * 使用范围(1=用户,2=司机) |
| | | */ |
| | | @TableField("useType") |
| | | private Integer useType; |
| | | @TableField("userType") |
| | | private Integer userType; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty("头像") |
| | |
| | | @Param("id") String id, |
| | | @Param("nickName") String nickName, |
| | | @Param("phone") String phone, |
| | | @Param("companyName") String companyName); |
| | | @Param("companyName") String companyName, |
| | | @Param("inviteUser") String inviteUser); |
| | | |
| | | /** |
| | | * 根据用户ID获取用户详情 |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.modular.system.model.Invite; |
| | | import com.stylefeng.guns.modular.system.model.TDriver; |
| | | import com.stylefeng.guns.modular.system.model.TUser; |
| | | import com.stylefeng.guns.modular.system.dao.TUserMapper; |
| | | import com.stylefeng.guns.modular.system.service.IInviteService; |
| | | import com.stylefeng.guns.modular.system.service.ITDriverService; |
| | | import com.stylefeng.guns.modular.system.service.ITUserService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | |
| | | @Service |
| | | public class TUserServiceImpl extends ServiceImpl<TUserMapper, TUser> implements ITUserService { |
| | | |
| | | @Autowired |
| | | private IInviteService inviteService; |
| | | |
| | | @Autowired |
| | | private ITDriverService driverService; |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getUserList(Page<Map<String, Object>> page, String beginTime, String endTime,Integer roleType,Integer nowUserId, Integer isAuth, Integer state, String id, String nickName,String phone,String companyName) { |
| | | return this.baseMapper.getUserList(page, beginTime, endTime,roleType,nowUserId, isAuth, state, id, nickName,phone,companyName); |
| | | public List<Map<String, Object>> getUserList(Page<Map<String, Object>> page, String beginTime, String endTime,Integer roleType,Integer nowUserId, Integer isAuth, |
| | | Integer state, String id, String nickName,String phone,String companyName, String inviteUser) { |
| | | return this.baseMapper.getUserList(page, beginTime, endTime,roleType,nowUserId, isAuth, state, id, nickName,phone,companyName, inviteUser); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getUserListNoPage(Integer roleType, Integer nowUserId) { |
| | | return this.baseMapper.getUserListNoPage(roleType, nowUserId); |
| | | List<Map<String, Object>> userListNoPage = this.baseMapper.getUserListNoPage(roleType, nowUserId); |
| | | for (Map<String, Object> map : userListNoPage) { |
| | | String string = map.get("id").toString(); |
| | | Invite invite = inviteService.selectOne(new EntityWrapper<Invite>().eq("userId", string)); |
| | | if(null != invite){ |
| | | String inviteUser1 = ""; |
| | | if(1 == invite.getUserType()){ |
| | | TUser tUser = this.selectById(invite.getInviteUserId()); |
| | | if(null != tUser){ |
| | | inviteUser1 = tUser.getPhone(); |
| | | } |
| | | }else{ |
| | | TDriver tDriver = driverService.selectById(invite.getInviteUserId()); |
| | | if(null != tDriver){ |
| | | inviteUser1 = tDriver.getPhone(); |
| | | } |
| | | } |
| | | map.put("inviteUser", inviteUser1); |
| | | } |
| | | } |
| | | |
| | | return userListNoPage; |
| | | } |
| | | |
| | | @Override |
| | |
| | | # password: XianNing@2024! |
| | | # db-name: guns #用来搜集数据库的所有表 |
| | | # filters: wall,mergeStat |
| | | url: jdbc:mysql://127.0.0.1:10633/xianning?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true |
| | | # url: jdbc:mysql://127.0.0.1:10633/xianning?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true |
| | | # username: root |
| | | # password: XianNing@2024! |
| | | # db-name: guns #用来搜集数据库的所有表 |
| | | # filters: wall,mergeStat |
| | | url: jdbc:mysql://127.0.0.1:3306/xianning?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true |
| | | username: root |
| | | password: XianNing@2024! |
| | | # db-name: guns #用来搜集数据库的所有表 |
| | | # filters: wall,mergeStat |
| | | # url: jdbc:mysql://192.168.110.34:3306/xianning?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true |
| | | # username: root |
| | | # password: 123456 |
| | | password: 123456 |
| | | # db-name: guns #用来搜集数据库的所有表 |
| | | # filters: wall,mergeStat |
| | | |
| | | |
| | | #spring: |
| | | # profiles: local |
| | | # datasource: |
| | | # url: jdbc:mysql://127.0.0.1:3306/oktravel?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8 |
| | | # username: root |
| | | # password: root |
| | | # db-name: oktravel #用来搜集数据库的所有表 |
| | | # filters: wall,mergeStat |
| | | |
| | | |
| | | |
| | |
| | | - dataSourceGuns |
| | | - dataSourceBiz |
| | | |
| | | --- |
| | | |
| | | #spring: |
| | | # profiles: produce |
| | | # datasource: |
| | | # url: jdbc:mysql://120.24.34.190:3306/mask?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8 |
| | | # username: root |
| | | # password: Root2020! |
| | | # db-name: mask #用来搜集数据库的所有表 |
| | | # filters: wall,mergeStat |
| | | |
| | | --- |
| | | |
| | |
| | | <option value="2">冻结</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="inviteUser" name="邀请人" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TUser.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TUser.resetSearch()" space="true"/> |
| | |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '邀请人', field: 'inviteUser', visible: true, align: 'center', valign: 'middle',width:'6%', |
| | | formatter: function (value, row) { |
| | | var temp = row.id |
| | | var btn = ""; |
| | | if(row.inviteUser != '' && row.inviteUser != null) { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis" title="' + row.inviteUser + '" onfocus="TUser.tooltip()" >' + row.inviteUser + '</p>'] |
| | | }else { |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis" title="-" onfocus="TUser.tooltip()" >-</p>'] |
| | | } |
| | | return btn; |
| | | } |
| | | }, |
| | | {title: '邀请次数', field: 'inviteNumber', visible: true, align: 'center', valign: 'middle',width:'5%', |
| | | formatter: function (value, row) { |
| | | var temp = row.id |
| | |
| | | queryData['phone'] = $("#phone").val(); |
| | | queryData['isAuth'] = $("#isAuth").val(); |
| | | queryData['state'] = $("#state").val(); |
| | | queryData['inviteUser'] = $("#inviteUser").val(); |
| | | TUser.table.refresh({query: queryData}); |
| | | }; |
| | | TUser.resetSearch = function () { |
| | |
| | | $("#phone").val(""); |
| | | $("#isAuth").val(""); |
| | | $("#state").val(""); |
| | | $("#inviteUser").val(""); |
| | | TUser.search(); |
| | | }; |
| | | |
| | |
| | | @Param("money") Double money, @Param("pageNum") Integer pageNum, |
| | | @Param("size") Integer size); |
| | | |
| | | |
| | | List<Map<String, Object>> queryCoupon1(@Param("uid") Integer uid, @Param("cityCode") String cityCode, |
| | | @Param("state") Integer state, @Param("couponUseType") Integer couponUseType, |
| | | @Param("money") Double money, @Param("pageNum") Integer pageNum, |
| | | @Param("size") Integer size); |
| | | |
| | | /** |
| | | * 获取优惠券列表 |
| | | * @param state |
| | |
| | | |
| | | |
| | | |
| | | <select id="queryCoupon1" resultType="map"> |
| | | select |
| | | a.id as id, |
| | | a.money as money, |
| | | a.couponUseType as userType, |
| | | DATE_FORMAT(a.expirationTime, '%Y-%m-%d') as time, |
| | | a.couponType as `type`, |
| | | a.fullMoney as fullMoney, |
| | | a.state as state, |
| | | b.`name` as `name`, |
| | | c.citys |
| | | from t_user_coupon_record a |
| | | left join t_company b on (a.companyId = b.id) |
| | | left join t_sys_coupon_record c on (a.couponId = c.id) |
| | | where a.expirationTime >= now() |
| | | <if test="null != uid"> |
| | | and a.userId = #{uid} |
| | | </if> |
| | | <if test="null != cityCode and '' != cityCode"> |
| | | and JSON_CONTAINS(c.citys, #{cityCode}) |
| | | </if> |
| | | <if test="null != state"> |
| | | and a.state = #{state} |
| | | </if> |
| | | <if test="null != couponUseType"> |
| | | and a.couponUseType = #{couponUseType} |
| | | </if> |
| | | <if test="null != money"> |
| | | and if(a.couponType = 1, a.money <= #{money}, a.fullMoney <= #{money}) |
| | | </if> |
| | | order by a.insertTime desc |
| | | <if test="null != pageNum and null != size"> |
| | | limit #{pageNum}, #{size} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="queryMyCoupons" resultType="map"> |
| | |
| | | a.couponType as `type`, |
| | | a.fullMoney as fullMoney, |
| | | a.state as state, |
| | | b.`name` as `name` |
| | | b.`name` as `name`, |
| | | c.citys |
| | | from t_user_coupon_record a |
| | | left join t_company b on (a.companyId = b.id) |
| | | left join t_sys_coupon_record c on (a.couponId = c.id) |
| | | where 1 = 1 |
| | | <if test="null != uid"> |
| | | and a.userId = #{uid} |
| | |
| | | */ |
| | | List<Map<String, Object>> queryCoupon(Integer uid, Integer companyId, Integer state, Integer couponUseType, Double money, Integer pageNum, Integer size) throws Exception; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取优惠券列表 |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | List<Map<String, Object>> queryCoupon1(Integer uid, String cityCode, Integer state, Integer couponUseType, Double money, Integer pageNum, Integer size) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * 获取优惠券列表 |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.dao.UserCouponRecordMapper; |
| | | import com.stylefeng.guns.modular.system.model.UserCouponRecord; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | return userCouponRecordMapper.queryCoupon(uid, companyId, state, couponUseType, money, pageNum, size); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> queryCoupon1(Integer uid, String cityCode, Integer state, Integer couponUseType, Double money, Integer pageNum, Integer size) throws Exception { |
| | | pageNum = (pageNum - 1) * size; |
| | | List<Map<String, Object>> list = userCouponRecordMapper.queryCoupon1(uid, cityCode, state, couponUseType, money, pageNum, size); |
| | | for (Map<String, Object> map : list) { |
| | | Object citys = map.get("citys"); |
| | | if(null != citys){ |
| | | List<String> names = new ArrayList<>(); |
| | | String s = citys.toString(); |
| | | JSONArray jsonArray = JSON.parseArray(s); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | String name = jsonObject.getString("name"); |
| | | names.add(name); |
| | | } |
| | | map.put("citys", JSON.toJSONString(names)); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 获取优惠券列表 |
| | |
| | | @Override |
| | | public List<Map<String, Object>> queryMyCoupons(Integer state, Integer pageNum, Integer size, Integer uid) throws Exception { |
| | | pageNum = (pageNum - 1) * size; |
| | | return userCouponRecordMapper.queryMyCoupons(state, pageNum, size, uid); |
| | | List<Map<String, Object>> list = userCouponRecordMapper.queryMyCoupons(state, pageNum, size, uid); |
| | | for (Map<String, Object> map : list) { |
| | | Object citys = map.get("citys"); |
| | | if(null != citys){ |
| | | List<String> names = new ArrayList<>(); |
| | | String s = citys.toString(); |
| | | JSONArray jsonArray = JSON.parseArray(s); |
| | | for (int i = 0; i < jsonArray.size(); i++) { |
| | | JSONObject jsonObject = jsonArray.getJSONObject(i); |
| | | String name = jsonObject.getString("name"); |
| | | names.add(name); |
| | | } |
| | | map.put("citys", JSON.toJSONString(names)); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | |
| | | private String name; |
| | | @ApiModelProperty("状态(1=未使用,2=已使用,3=已过期)") |
| | | private Integer state; |
| | | @ApiModelProperty("适用城市") |
| | | private String city; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | this.state = state; |
| | | } |
| | | |
| | | public String getCity() { |
| | | return city; |
| | | } |
| | | |
| | | public void setCity(String city) { |
| | | this.city = city; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "CouponWarpper{" + |
| | |
| | | couponWarpper.setFullMoney(null != map.get("fullMoney") ? Double.valueOf(String.valueOf(map.get("fullMoney"))) : 0); |
| | | couponWarpper.setName(null != map.get("name") ? String.valueOf(map.get("name")) : ""); |
| | | couponWarpper.setState(null != map.get("state") ? Integer.valueOf(String.valueOf(map.get("state"))) : 0); |
| | | couponWarpper.setCity(null != map.get("citys") ? String.valueOf(map.get("citys")) : ""); |
| | | list.add(couponWarpper); |
| | | } |
| | | } |
| | |
| | | warpper.setStartLon(orderTaxi.getStartLon()); |
| | | warpper.setEndLat(orderTaxi.getEndLat()); |
| | | warpper.setEndLon(orderTaxi.getEndLon()); |
| | | ResultUtil<Double> forecastPrice = getForecastPrice(warpper); |
| | | if(forecastPrice.getCode() != 200){ |
| | | return ResultUtil.error(forecastPrice.getMsg()); |
| | | } |
| | | orderTaxi.setOrderMoney(forecastPrice.getData()); |
| | | |
| | | if (!StringUtils.hasLength(orderTaxi.getPassengers()) || StringUtils.hasLength(orderTaxi.getPassengersPhone()) ){ |
| | | // 如果没有填写乘车人电话或者姓名 那么用用户的 |
| | |
| | | @Override |
| | | public List<Map<String, Object>> queryCoupon(Integer orderId, Integer uid, Integer pageNum, Integer size) throws Exception { |
| | | OrderTaxi orderTaxi = this.selectById(orderId); |
| | | List<Map<String, Object>> list = userCouponRecordService.queryCoupon(uid, null, 1, 2, orderTaxi.getOrderMoney(), pageNum, size); |
| | | List<Map<String, Object>> list1 = userCouponRecordService.queryCoupon(uid, null, 1, 0, orderTaxi.getOrderMoney(), pageNum, size); |
| | | Driver driver = driverService.selectById(orderTaxi.getDriverId()); |
| | | Integer companyId = driver.getCompanyId(); |
| | | List<CompanyCity> companyCityList = companyCityService.selectList(new EntityWrapper<CompanyCity>().eq("companyId", companyId)); |
| | | List<Map<String, Integer>> cityCode = new ArrayList<>(); |
| | | for (CompanyCity companyCity : companyCityList) { |
| | | Map<String, Integer> city = new HashMap<>(); |
| | | if(ToolUtil.isNotEmpty(companyCity.getAreaCode())){ |
| | | city.put("code", Integer.valueOf(companyCity.getAreaCode())); |
| | | }else if(ToolUtil.isEmpty(companyCity.getAreaCode()) && ToolUtil.isNotEmpty(companyCity.getCityCode())){ |
| | | city.put("code", Integer.valueOf(companyCity.getCityCode())); |
| | | }else if(ToolUtil.isEmpty(companyCity.getCityCode()) && ToolUtil.isNotEmpty(companyCity.getProvinceCode())){ |
| | | city.put("code", Integer.valueOf(companyCity.getProvinceCode())); |
| | | } |
| | | } |
| | | List<Map<String, Object>> list = userCouponRecordService.queryCoupon1(uid, JSON.toJSONString(cityCode), 1, 2, orderTaxi.getOrderMoney(), pageNum, size); |
| | | List<Map<String, Object>> list1 = userCouponRecordService.queryCoupon1(uid, JSON.toJSONString(cityCode), 1, 0, orderTaxi.getOrderMoney(), pageNum, size); |
| | | list.addAll(list1); |
| | | return list; |
| | | } |
| | |
| | | |
| | | |
| | | systemNoticeService.addSystemNotice(1, "您已使用" + (type == 1 ? "微信" : "支付宝") + "成功完成出行订单支付,谢谢使用!", orderTaxi.getUserId(), 1); |
| | | //添加司机消息提醒 |
| | | systemNoticeService.addSystemNotice(2, "用户已线上完成支付", driver.getId(), 1); |
| | | //推送状态,让司机端播报语音 |
| | | pushUtil.pushOrderState(2, orderTaxi.getDriverId(), orderTaxi.getId(), 2, orderTaxi.getState(), 0); |
| | | }else{ |
| | | System.err.println("预支付数据异常(orderId = " + id + ")"); |
| | | } |