Merge remote-tracking branch 'origin/master'
# Conflicts:
# driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/dao/mapping/OrderMapper.xml
# driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/service/IOrderService.java
# driver/guns-admin/src/main/java/com/supersavedriving/driver/modular/system/service/impl/OrderServiceImpl.java
| | |
| | | import com.supersavedriving.driver.modular.system.util.ResultUtil; |
| | | import com.supersavedriving.driver.modular.system.warpper.AddOrderWarpper; |
| | | import com.supersavedriving.driver.modular.system.warpper.HallOrderList; |
| | | import com.supersavedriving.driver.modular.system.warpper.OrderInfoWarpper; |
| | | import com.supersavedriving.driver.modular.system.warpper.ResponseWarpper; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | |
| | | |
| | | |
| | | public ResponseWarpper<> queryOrderInfo(Long orderId, HttpServletRequest request){ |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/order/queryOrderInfo") |
| | | @ServiceLog(name = "获取订单详情", url = "/api/order/queryOrderInfo") |
| | | @ApiOperation(value = "获取订单详情", tags = {"司机端-首页"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "订单id", name = "orderId", required = true, dataType = "long"), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResponseWarpper<OrderInfoWarpper> queryOrderInfo(Long orderId, HttpServletRequest request){ |
| | | if(null == orderId){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("orderId")); |
| | | } |
| | |
| | | if(null == uid){ |
| | | return ResponseWarpper.success(ResultUtil.tokenErr()); |
| | | } |
| | | ResultUtil resultUtil = orderService.receiveOrder(uid, orderId); |
| | | return ResponseWarpper.success(resultUtil); |
| | | OrderInfoWarpper orderInfoWarpper = orderService.queryOrderInfo(uid, orderId); |
| | | return ResponseWarpper.success(orderInfoWarpper); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | public ResponseWarpper driverProcessOperations(Long orderId, Integer state, HttpServletRequest request){ |
| | | if(null == orderId){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("orderId")); |
| | | } |
| | | if(null == state){ |
| | | return ResponseWarpper.success(ResultUtil.paranErr("state")); |
| | | } |
| | | try { |
| | | |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ResponseWarpper(500, e.getMessage()); |
| | | } |
| | | } |
| | | } |
| | |
| | | a.estimatedPrice, |
| | | a.estimatedMileage, |
| | | a.startPrice, |
| | | a.state |
| | | a.waitTime, |
| | | a.actualMileage, |
| | | a.state, |
| | | (UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP(a.startTime)) / 60 as travelTime |
| | | from t_order a |
| | | left join t_app_user b on (a.userId = b.id) |
| | | where a.id = #{orderId} |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | OrderInfoWarpper queryOrderInfo(Long orderId) throws Exception; |
| | | OrderInfoWarpper queryOrderInfo(Integer uid, Long orderId) throws Exception; |
| | | } |
| | |
| | | * 司机上线且空闲,下单直接给当前司机,其余进大厅 |
| | | * 司机下的订单不需要创建新用户,且只能走线下支付 |
| | | */ |
| | | |
| | | int count = this.selectCount(new EntityWrapper<Order>().eq("userPhone", addOrderWarpper.getPhone()).eq("status", 1).in("state", Arrays.asList(101, 102, 103, 104, 105, 106, 201))); |
| | | if(count > 0){ |
| | | return ResultUtil.error("该用户还有未完成的订单"); |
| | | } |
| | | Driver driver = driverService.selectById(uid); |
| | | DriverWork driverWork = driverWorkService.selectOne(new EntityWrapper<DriverWork>().eq("driverId", uid).eq("status", 1)); |
| | | if(null == driverWork){ |
| | | return ResultUtil.error("请先上班"); |
| | | } |
| | | Order order1 = this.selectOne(new EntityWrapper<Order>().eq("driverId", uid).eq("status", 1).in("state", Arrays.asList(102, 103, 104, 105, 201))); |
| | | Order order = new Order(); |
| | | if(driverWork != null && null == order1){ |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取订单详情 |
| | | * @param orderId |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Override |
| | | public OrderInfoWarpper queryOrderInfo(Long orderId) throws Exception { |
| | | return null; |
| | | public OrderInfoWarpper queryOrderInfo(Integer uid, Long orderId) throws Exception { |
| | | OrderInfoWarpper orderInfoWarpper = this.baseMapper.queryOrderInfo(orderId); |
| | | String value = redisUtil.getValue("DRIVER" + uid); |
| | | Map<String, Double> distance = GeodesyUtil.getDistance(orderInfoWarpper.getStartLng() + "," + orderInfoWarpper.getStartLat(), value); |
| | | Double wgs84 = distance.get("WGS84"); |
| | | orderInfoWarpper.setCurrentDistance(wgs84); |
| | | return orderInfoWarpper; |
| | | } |
| | | } |
| | |
| | | private Double estimatedMileage; |
| | | @ApiModelProperty("起步价") |
| | | private Double startPrice; |
| | | @ApiModelProperty("等待时长") |
| | | private Integer waitTime; |
| | | @ApiModelProperty("行驶里程") |
| | | private Double actualMileage; |
| | | @ApiModelProperty("行驶时间") |
| | | private Integer travelTime; |
| | | @ApiModelProperty("订单状态(101=待接单,102=已接单,103=前往预约点,104=到达预约点,105=开始服务,106=到达目的地,107=待评价,108=已完成,201=转单中,301=已取消)") |
| | | private Integer state; |
| | | } |
| | |
| | | <scope>system</scope> |
| | | <systemPath>${project.basedir}/lib/proguard.jar</systemPath> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.apache.httpcomponents</groupId> |
| | | <artifactId>httpmime</artifactId> |
| | | <version>4.5.6</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springframework.boot</groupId> |
| | | <artifactId>spring-boot-starter-data-redis</artifactId> |
| | | </dependency> |
| | | <!--引入本地工行支付jar end--> |
| | | </dependencies> |
| | | |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.config; |
| | | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 项目中需继承此类 |
| | | * |
| | | * @author lihen |
| | | */ |
| | | @Component |
| | | @ConfigurationProperties(prefix = "wx.conf") |
| | | public class WxConfig { |
| | | |
| | | /** |
| | | * 获取 App ID |
| | | * |
| | | * @return App ID |
| | | */ |
| | | @JsonProperty("appId") |
| | | public String appId; |
| | | |
| | | /** |
| | | * 获取 Secret |
| | | * |
| | | * @return Secret |
| | | */ |
| | | @JsonProperty("secret") |
| | | public String secret; |
| | | |
| | | public String getAppId() { |
| | | return appId; |
| | | } |
| | | |
| | | public void setAppId(String appId) { |
| | | this.appId = appId; |
| | | } |
| | | |
| | | public String getSecret() { |
| | | return secret; |
| | | } |
| | | |
| | | public void setSecret(String secret) { |
| | | this.secret = secret; |
| | | } |
| | | } |
| | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TAgent tAgent) { |
| | | System.err.println(tAgent); |
| | | String[] split = tAgent.getAreaId().split("/"); |
| | | // 查询省市 |
| | | // 黑龙江省/大兴安岭地区 |
| | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TAppUserResp; |
| | | import com.stylefeng.guns.modular.system.controller.util.ExcelUtil; |
| | | import com.stylefeng.guns.modular.system.enums.CouponStatusEnum; |
| | | import com.stylefeng.guns.modular.system.enums.OrderStateEnum; |
| | | import com.stylefeng.guns.modular.system.exports.TAppUserExceptionExport; |
| | | import com.stylefeng.guns.modular.system.model.TAppUser; |
| | | import com.stylefeng.guns.modular.system.model.TCoupon; |
| | | import com.stylefeng.guns.modular.system.model.TOrder; |
| | | import com.stylefeng.guns.modular.system.service.ITAppUserService; |
| | | import com.stylefeng.guns.modular.system.service.ITCouponService; |
| | | import com.stylefeng.guns.modular.system.service.ITOrderService; |
| | | 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.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.OutputStream; |
| | | import java.math.BigDecimal; |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | |
| | | private ITAppUserService tAppUserService; |
| | | @Autowired |
| | | private ITCouponService tCouponService; |
| | | @Autowired |
| | | private ITOrderService tOrderService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | |
| | | @RequestMapping("/userDetail") |
| | | public String userDetail(Integer tAppUserId, Model model) { |
| | | tAppUserService.detail(tAppUserId,model); |
| | | |
| | | return PREFIX + "tAppUserDetail.html"; |
| | | } |
| | | |
| | |
| | | EntityWrapper<TAppUser> wrapper = tAppUserService.getUserListWrapper(createTime,nickname,phone,id,status); |
| | | // 是否异常 |
| | | wrapper.eq("is_exception",2); |
| | | return tAppUserService.selectList(wrapper); |
| | | List<TAppUser> tAppUsers = tAppUserService.selectList(wrapper); |
| | | List<TAppUserResp> tAppUserRespList = new ArrayList<>(tAppUsers.size()); |
| | | for (TAppUser tAppUser : tAppUsers) { |
| | | TAppUserResp tAppUserResp = new TAppUserResp(); |
| | | BeanUtils.copyProperties(tAppUser,tAppUserResp); |
| | | List<TCoupon> tCoupons = tCouponService.selectList(new EntityWrapper<TCoupon>().eq("user_id", tAppUser.getId())); |
| | | List<TCoupon> notUsedList = tCoupons.stream().filter(coupon -> coupon.getCouponStatus().equals(CouponStatusEnum.NOT_USED.getCode())).collect(Collectors.toList()); |
| | | tAppUserResp.setCouponSum(tCoupons.size()); |
| | | tAppUserResp.setNotUsedCount(notUsedList.size()); |
| | | List<TOrder> orders = tOrderService.selectList(new EntityWrapper<TOrder>().eq("userId", tAppUser.getId()).orderBy(true,"createTime",false)); |
| | | if(!CollectionUtils.isEmpty(orders)){ |
| | | List<TOrder> collect1 = orders.stream().filter(order->Objects.nonNull(order.getState())) |
| | | .filter(order -> OrderStateEnum.WAIT_EVALUATED.getCode() == order.getState() || |
| | | OrderStateEnum.FINISH.getCode() == order.getState()).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(collect1)) { |
| | | tAppUserResp.setConsumeSum(collect1.size()); |
| | | // 总消费金额 |
| | | collect1.stream().map(TOrder::getPayMoney).reduce(BigDecimal::add) |
| | | .ifPresent(tAppUserResp::setConsumePrice); |
| | | } |
| | | } |
| | | tAppUserRespList.add(tAppUserResp); |
| | | } |
| | | return tAppUserRespList; |
| | | } |
| | | |
| | | |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TDriverResp; |
| | | import com.stylefeng.guns.modular.system.controller.util.ExcelUtil; |
| | | import com.stylefeng.guns.modular.system.model.TAgent; |
| | | import com.stylefeng.guns.modular.system.model.TAppUser; |
| | | import com.stylefeng.guns.modular.system.controller.util.*; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.ITAgentService; |
| | | import com.stylefeng.guns.modular.system.service.ITBranchOfficeService; |
| | | import com.stylefeng.guns.modular.system.service.ITRegionService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.logging.log4j.core.util.UuidUtil; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.apache.shiro.subject.Subject; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import com.stylefeng.guns.modular.system.model.TDriver; |
| | | import com.stylefeng.guns.modular.system.service.ITDriverService; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.OutputStream; |
| | | import java.math.BigDecimal; |
| | | import java.text.DateFormat; |
| | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | @Autowired |
| | | private ITDriverService tDriverService; |
| | | |
| | | @Autowired |
| | | private ITRegionService tRegionService; |
| | | |
| | | @Autowired |
| | | private ITAgentService tAgentService; |
| | | |
| | | @Autowired |
| | | private ITBranchOfficeService tBranchOfficeService; |
| | | @Autowired |
| | | private RedisTemplate<String,String> redisTemplate; |
| | | @Autowired |
| | | private HttpUtils httpUtils; |
| | | @Autowired |
| | | private TokenUtils tokenUtils; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | return PREFIX + "tDriver.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到佣金首页 |
| | | */ |
| | | @RequestMapping("/commission") |
| | | public String commissionIndex() { |
| | | return PREFIX + "tDriverCommission.html"; |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 跳转到修改 |
| | | */ |
| | | @RequestMapping("/tDriver_update/{tDriverId}") |
| | | public String tDriverUpdate(@PathVariable Integer tDriverId, Model model) { |
| | | @RequestMapping("/tDriver_update") |
| | | public String tDriverUpdate( Integer tDriverId, Model model) { |
| | | TDriver tDriver = tDriverService.selectById(tDriverId); |
| | | model.addAttribute("item",tDriver); |
| | | TDriverResp tDriverResp = new TDriverResp(); |
| | | BeanUtils.copyProperties(tDriver,tDriverResp); |
| | | |
| | | // 查询邀请人 |
| | | TDriver tDriver1 = tDriverService.selectById(tDriver.getInviterId()); |
| | | if(Objects.nonNull(tDriver1)){ |
| | | tDriverResp.setInviterName(tDriver1.getName()); |
| | | tDriverResp.setInviterPhone(tDriver1.getPhone()); |
| | | } |
| | | |
| | | // 查询区域 |
| | | TRegion district = tRegionService.selectOne(new EntityWrapper<TRegion>().eq("code", tDriver.getAreaCode()) |
| | | .last("LIMIT 1")); |
| | | TRegion city = tRegionService.selectOne(new EntityWrapper<TRegion>().eq("code", tDriver.getCityCode()) |
| | | .last("LIMIT 1")); |
| | | |
| | | tDriverResp.setArea(tDriver.getProvinceName()+"/"+tDriver.getCityName()+"/"+tDriver.getAreaName()); |
| | | if(Objects.nonNull(district) && Objects.nonNull(city)){ |
| | | tDriverResp.setAreaId(city.getParentId()+"/"+city.getId()+"/"+district.getId()); |
| | | } |
| | | |
| | | model.addAttribute("item",tDriverResp); |
| | | LogObjectHolder.me().set(tDriver); |
| | | return PREFIX + "tDriver_edit.html"; |
| | | } |
| | |
| | | */ |
| | | @RequestMapping("/driverDetail") |
| | | public String driverDetail(Integer tDriverId, Model model) { |
| | | tDriverService.detail(tDriverId,model); |
| | | |
| | | tDriverService.auditPage(tDriverId,model); |
| | | return PREFIX + "tDriverDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转区域页面 |
| | | */ |
| | | @RequestMapping("/areaPage") |
| | | public String areaDetail(String area,String areaId,Model model) { |
| | | List<TRegion> tRegions = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | model.addAttribute("provinceList",tRegions); |
| | | List<Integer> provinceIds = tRegions.stream().map(TRegion::getId).collect(Collectors.toList()); |
| | | // 查询市 |
| | | List<TRegion> tRegions1 = tRegionService.selectList(new EntityWrapper<TRegion>().in("parent_id", provinceIds)); |
| | | model.addAttribute("cityList",tRegions1); |
| | | |
| | | // 查询区 |
| | | List<Integer> cityIds = tRegions1.stream().map(TRegion::getId).collect(Collectors.toList()); |
| | | List<TRegion> tRegions2 = tRegionService.selectList(new EntityWrapper<TRegion>().in("parent_id", cityIds)); |
| | | model.addAttribute("districtList",tRegions2); |
| | | |
| | | if(StringUtils.hasLength(area) && StringUtils.hasLength(areaId)){ |
| | | String[] split = area.split("/"); |
| | | model.addAttribute("provinceName",split[0]); |
| | | model.addAttribute("cityName",split[1]); |
| | | model.addAttribute("districtName",split[2]); |
| | | |
| | | String[] split1 = areaId.split("/"); |
| | | model.addAttribute("provinceId",split1[0]); |
| | | model.addAttribute("cityId",split1[1]); |
| | | model.addAttribute("districtId",split1[2]); |
| | | } |
| | | return PREFIX + "tDriverArea.html"; |
| | | } |
| | | |
| | | /** |
| | |
| | | @ResponseBody |
| | | public Object list(String createTime,String phone,Integer status) { |
| | | EntityWrapper<TDriver> wrapper = tDriverService.getPageList(createTime,phone,status); |
| | | wrapper.ne("isException",2); |
| | | List<TDriver> tDrivers = tDriverService.selectList(wrapper); |
| | | return tDriverService.getTDriverResp(tDrivers); |
| | | } |
| | | /** |
| | | * 获取佣金列表 |
| | | */ |
| | | @RequestMapping(value = "/commission/list") |
| | | @ResponseBody |
| | | public Object commissionList(String name,String phone,Integer status) { |
| | | EntityWrapper<TDriver> wrapper = tDriverService.getCommissionPageList(name,phone,status); |
| | | wrapper.ne("isException",2); |
| | | List<TDriver> tDrivers = tDriverService.selectList(wrapper); |
| | | return tDriverService.getTDriverResp(tDrivers); |
| | |
| | | @ResponseBody |
| | | public Object listBack(String condition) { |
| | | return tDriverService.selectList(null); |
| | | } |
| | | /** |
| | | * ocr |
| | | */ |
| | | @RequestMapping(value = "/ocr") |
| | | @ResponseBody |
| | | public Object ocr(String imgUrl) { |
| | | /*String accessToken = redisTemplate.opsForValue().get(TokenUtils.ACCESS_TOKEN_CACHE_KEY); |
| | | if (!StringUtils.hasLength(accessToken)) { |
| | | accessToken = tokenUtils.getSimpleAccessToken(); |
| | | } |
| | | File file = new File(imgUrl); |
| | | String url = Constant.OCR_URL.replace("MODE", "scan").replace("ACCESS_TOKEN", accessToken); |
| | | String result = httpUtils.registRequest(url, file); |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | System.err.println(jsonObject); |
| | | return jsonObject;*/ |
| | | return tDriverService.ocr(imgUrl); |
| | | } |
| | | |
| | | /** |
| | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object add(TDriver tDriver) { |
| | | |
| | | int count = tDriverService.selectCount(new EntityWrapper<TDriver>().eq("phone", tDriver.getPhone())); |
| | | if(count>0){ |
| | | return "该司机已存在!"; |
| | | } |
| | | tDriverService.addOrUpdate(tDriver); |
| | | tDriverService.insert(tDriver); |
| | | return SUCCESS_TIP; |
| | | } |
| | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TDriver tDriver) { |
| | | // Object ocr = ocr("E:\\071bf986db0b00355c0ed190bbd3b16.png"); |
| | | // System.err.println(ocr); |
| | | tDriverService.addOrUpdate(tDriver); |
| | | tDriverService.updateById(tDriver); |
| | | return SUCCESS_TIP; |
| | | } |
| | |
| | | return tDriverService.selectById(tDriverId); |
| | | } |
| | | |
| | | @ApiOperation(value = "省查询",notes="省查询") |
| | | @RequestMapping(value = "/areaProvince") |
| | | @ResponseBody |
| | | public Object areaProvince(Model model) { |
| | | return tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", 0)); |
| | | } |
| | | |
| | | @ApiOperation(value = "市区查询",notes="市区查询") |
| | | @RequestMapping(value = "/areaCity") |
| | | @ResponseBody |
| | | public Object areaCity(Integer parentId,Model model) { |
| | | List<TRegion> tRegions = tRegionService.selectList(new EntityWrapper<TRegion>().eq("parent_id", parentId)); |
| | | model.addAttribute("list",tRegions); |
| | | return tRegions; |
| | | } |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "导出司机列表",notes="导出司机列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.resp; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * 接收accessToken实体 |
| | | */ |
| | | public class AccessTokenRespBody extends RespBody implements Serializable { |
| | | |
| | | /** |
| | | * 获取到的凭证 |
| | | */ |
| | | @JsonProperty("access_token") |
| | | private String accessToken; |
| | | /** |
| | | * 凭证有效时间,单位:秒 |
| | | */ |
| | | @JsonProperty("expires_in") |
| | | private int expiresIn; |
| | | |
| | | public String getAccessToken() { |
| | | return accessToken; |
| | | } |
| | | |
| | | public void setAccessToken(String accessToken) { |
| | | this.accessToken = accessToken; |
| | | } |
| | | |
| | | public int getExpiresIn() { |
| | | return expiresIn; |
| | | } |
| | | |
| | | public void setExpiresIn(int expiresIn) { |
| | | this.expiresIn = expiresIn; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.resp; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | |
| | | /** |
| | | * @author ck |
| | | * @ClassName RespBody |
| | | * @Description |
| | | * @date 2023-02-23 11:44 |
| | | */ |
| | | public class RespBody { |
| | | @JsonProperty("errcode") |
| | | private Integer errorCode; |
| | | |
| | | @JsonProperty("errmsg") |
| | | private String errorMsg; |
| | | |
| | | public Integer getErrorCode() { |
| | | return errorCode; |
| | | } |
| | | |
| | | public void setErrorCode(Integer errorCode) { |
| | | this.errorCode = errorCode; |
| | | } |
| | | |
| | | public String getErrorMsg() { |
| | | return errorMsg; |
| | | } |
| | | |
| | | public void setErrorMsg(String errorMsg) { |
| | | this.errorMsg = errorMsg; |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.resp; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TAppUser; |
| | | import com.stylefeng.guns.modular.system.model.TOrder; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | public class TAppUserResp extends TAppUser { |
| | | |
| | | @ApiModelProperty(value = "优惠券总数") |
| | | private Integer couponSum; |
| | | |
| | | @ApiModelProperty(value = "剩余优惠券") |
| | | private Integer notUsedCount; |
| | | |
| | | @ApiModelProperty(value = "消费次数") |
| | | private Integer consumeSum; |
| | | |
| | | @ApiModelProperty(value = "历史消费") |
| | | private BigDecimal consumePrice; |
| | | |
| | | public Integer getCouponSum() { |
| | | return couponSum; |
| | | } |
| | | |
| | | public void setCouponSum(Integer couponSum) { |
| | | this.couponSum = couponSum; |
| | | } |
| | | |
| | | public Integer getNotUsedCount() { |
| | | return notUsedCount; |
| | | } |
| | | |
| | | public void setNotUsedCount(Integer notUsedCount) { |
| | | this.notUsedCount = notUsedCount; |
| | | } |
| | | |
| | | public Integer getConsumeSum() { |
| | | return consumeSum; |
| | | } |
| | | |
| | | public void setConsumeSum(Integer consumeSum) { |
| | | this.consumeSum = consumeSum; |
| | | } |
| | | |
| | | public BigDecimal getConsumePrice() { |
| | | return consumePrice; |
| | | } |
| | | |
| | | public void setConsumePrice(BigDecimal consumePrice) { |
| | | this.consumePrice = consumePrice; |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty(value = "连续未上线天数") |
| | | private Integer notOnlineCount; |
| | | |
| | | |
| | | @ApiModelProperty(value = "邀请人姓名") |
| | | private String inviterName; |
| | | |
| | | @ApiModelProperty(value = "邀请人电话") |
| | | private String inviterPhone; |
| | | |
| | | @ApiModelProperty(value = "加盟区域") |
| | | private String area; |
| | | |
| | | @ApiModelProperty(value = "加盟区域ID") |
| | | private String areaId; |
| | | |
| | | @Override |
| | | public String getAreaId() { |
| | | return areaId; |
| | | } |
| | | |
| | | @Override |
| | | public void setAreaId(String areaId) { |
| | | this.areaId = areaId; |
| | | } |
| | | |
| | | public String getInviterName() { |
| | | return inviterName; |
| | | } |
| | | |
| | | public void setInviterName(String inviterName) { |
| | | this.inviterName = inviterName; |
| | | } |
| | | |
| | | public String getInviterPhone() { |
| | | return inviterPhone; |
| | | } |
| | | |
| | | public void setInviterPhone(String inviterPhone) { |
| | | this.inviterPhone = inviterPhone; |
| | | } |
| | | |
| | | @Override |
| | | public String getArea() { |
| | | return area; |
| | | } |
| | | |
| | | @Override |
| | | public void setArea(String area) { |
| | | this.area = area; |
| | | } |
| | | |
| | | public Integer getNotOnlineCount() { |
| | | return notOnlineCount; |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.util; |
| | | |
| | | public class Constant { |
| | | |
| | | /** |
| | | * OCR识别地址 |
| | | */ |
| | | public static final String OCR_URL = "https://api.weixin.qq.com/cv/ocr/driving?type=MODE&access_token=ACCESS_TOKEN"; |
| | | |
| | | /** |
| | | * 请求参数 |
| | | * 属性 类型 默认值 必填 说明 |
| | | * grant_type string 是 填写 client_credential |
| | | * appid string 是 小程序唯一凭证,即 AppID,可在「微信公众平台 - 设置 - 开发设置」页中获得。(需要已经成为开发者,且帐号没有异常状态) |
| | | * secret string 是 小程序唯一凭证密钥,即 AppSecret,获取方式同 appid |
| | | * 返回值 |
| | | * Object |
| | | * 返回的 JSON 数据包 |
| | | * <p> |
| | | * 属性 类型 说明 |
| | | * access_token string 获取到的凭证 |
| | | * expires_in number 凭证有效时间,单位:秒。目前是7200秒之内的值。 |
| | | * errcode number 错误码 |
| | | * errmsg string 错误信息 |
| | | */ |
| | | public static String ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid={0}&secret={1}"; |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.util; |
| | | |
| | | import com.google.common.collect.Lists; |
| | | import org.apache.http.Consts; |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.HttpStatus; |
| | | 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.client.methods.HttpUriRequest; |
| | | import org.apache.http.client.protocol.HttpClientContext; |
| | | import org.apache.http.conn.ConnectTimeoutException; |
| | | import org.apache.http.entity.ContentType; |
| | | import org.apache.http.entity.StringEntity; |
| | | import org.apache.http.entity.mime.MultipartEntityBuilder; |
| | | import org.apache.http.entity.mime.content.FileBody; |
| | | import org.apache.http.entity.mime.content.StringBody; |
| | | 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.util.EntityUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.*; |
| | | import java.net.SocketTimeoutException; |
| | | import java.net.URI; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Component |
| | | public class HttpUtils { |
| | | |
| | | private Logger log = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | private final static String KEY = "5cc9622f299335639dbc046f3812c52a"; |
| | | |
| | | //请求超时时间 |
| | | private final static Integer TIME_OUT = 1000; |
| | | //http连接池 |
| | | private static volatile PoolingHttpClientConnectionManager poolingHttpClientConnectionManager; |
| | | //请求配置 |
| | | private static RequestConfig requestConfig; |
| | | |
| | | public static PoolingHttpClientConnectionManager getPoolingHttpClientConnectionManager() { |
| | | if (poolingHttpClientConnectionManager == null) { |
| | | synchronized (HttpUtils.class) { |
| | | if (poolingHttpClientConnectionManager == null) { |
| | | poolingHttpClientConnectionManager = new PoolingHttpClientConnectionManager(); |
| | | //连接池最大连接数 |
| | | poolingHttpClientConnectionManager.setMaxTotal(1024); |
| | | //每个路由最大连接数 |
| | | poolingHttpClientConnectionManager.setDefaultMaxPerRoute(32); |
| | | |
| | | //配置请求的超时设置 |
| | | requestConfig = |
| | | RequestConfig.custom().setConnectionRequestTimeout(TIME_OUT).setConnectTimeout(TIME_OUT).setSocketTimeout(TIME_OUT).build(); |
| | | } |
| | | } |
| | | } |
| | | return poolingHttpClientConnectionManager; |
| | | } |
| | | |
| | | public static CloseableHttpClient getHttpClient() { |
| | | return HttpClients.custom().setConnectionManager(getPoolingHttpClientConnectionManager()).setDefaultRequestConfig(requestConfig).build(); |
| | | } |
| | | |
| | | /** |
| | | * 请求发送执行 |
| | | * |
| | | * @param httpMethd |
| | | * @return |
| | | */ |
| | | public String registRequest(HttpUriRequest httpMethd) { |
| | | CloseableHttpClient httpClient = getHttpClient(); |
| | | CloseableHttpResponse httpResponse = null; |
| | | try { |
| | | httpResponse = httpClient.execute(httpMethd, HttpClientContext.create()); |
| | | int statusCode = httpResponse.getStatusLine().getStatusCode(); |
| | | if (httpResponse.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { |
| | | log.error("响应失败 statusCode {}", statusCode); |
| | | httpMethd.abort(); |
| | | } |
| | | log.debug("响应成功 statusCode {}", statusCode); |
| | | String response = EntityUtils.toString(httpResponse.getEntity(), Consts.UTF_8); |
| | | log.debug("响应成功 response {}", response); |
| | | return response; |
| | | } catch (ConnectTimeoutException e) { |
| | | throw new RuntimeException("接口超时"); |
| | | } catch (SocketTimeoutException e) { |
| | | throw new RuntimeException("读取接口数据超时"); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("接口请求失败,请尝试检查网络环境或请求接口是否能正常访问"); |
| | | } finally { |
| | | // 关闭响应 |
| | | try { |
| | | if (httpResponse != null) { |
| | | httpResponse.close(); |
| | | } |
| | | // 关闭连接 |
| | | //httpClient.close(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("关闭流异常:IOException"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 请求发送执行 |
| | | * |
| | | * @param url |
| | | * @return |
| | | */ |
| | | public String registRequest(String url, File file) { |
| | | CloseableHttpClient httpClient = HttpClients.createDefault(); |
| | | CloseableHttpResponse httpResponse = null; |
| | | try { |
| | | HttpPost httpPost = new HttpPost(url); |
| | | RequestConfig requestConfig = RequestConfig.custom() |
| | | .setSocketTimeout(10000) |
| | | .setConnectTimeout(5000) |
| | | .build(); |
| | | httpPost.setConfig(requestConfig); |
| | | HttpEntity entity = MultipartEntityBuilder.create().addPart("img", new FileBody(file)).build(); |
| | | httpPost.setEntity(entity); |
| | | httpResponse = httpClient.execute(httpPost); |
| | | int statusCode = httpResponse.getStatusLine().getStatusCode(); |
| | | if (httpResponse.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { |
| | | log.error("响应失败 statusCode {}", statusCode); |
| | | httpPost.abort(); |
| | | } |
| | | log.debug("响应成功 statusCode {}", statusCode); |
| | | String response = EntityUtils.toString(httpResponse.getEntity(), Consts.UTF_8); |
| | | log.debug("响应成功 response {}", response); |
| | | return response; |
| | | } catch (ConnectTimeoutException e) { |
| | | throw new RuntimeException("接口超时"); |
| | | } catch (SocketTimeoutException e) { |
| | | throw new RuntimeException("读取接口数据超时"); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("接口请求失败,请尝试检查网络环境或请求接口是否能正常访问"); |
| | | } finally { |
| | | // 关闭响应 |
| | | try { |
| | | if (httpResponse != null) { |
| | | httpResponse.close(); |
| | | } |
| | | // 关闭连接 |
| | | httpClient.close(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("关闭流异常:IOException"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param type |
| | | * @param file |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public String ocr(String type, File file){ |
| | | CloseableHttpClient httpClient = HttpClients.createDefault(); |
| | | CloseableHttpResponse response = null; |
| | | String result = null; |
| | | // HttpClient请求的相关设置,可以不用配置,用默认的参数,这里设置连接和超时时长(毫秒) |
| | | RequestConfig config = RequestConfig.custom().setConnectTimeout(30000).setSocketTimeout(30000).build(); |
| | | try { |
| | | HttpPost httppost = new HttpPost("http://v.juhe.cn/certificates/query"); |
| | | // FileBody封装File类型的参数 |
| | | FileBody bin = new FileBody(file); |
| | | // StringBody封装String类型的参数 |
| | | StringBody keyBody = new StringBody(KEY, ContentType.TEXT_PLAIN); |
| | | StringBody typeBody = new StringBody(type, ContentType.TEXT_PLAIN); |
| | | // addPart将参数传入,并指定参数名称 |
| | | HttpEntity reqEntity = MultipartEntityBuilder.create() |
| | | .addPart("pic", bin).addPart("key", keyBody) |
| | | .addPart("cardType", typeBody).build(); |
| | | httppost.setEntity(reqEntity); |
| | | httppost.setConfig(config); |
| | | // 执行网络请求并返回结果 |
| | | response = httpClient.execute(httppost); |
| | | HttpEntity resEntity = response.getEntity(); |
| | | if (resEntity != null) { |
| | | result = ConvertStreamToString(resEntity.getContent(), "UTF-8"); |
| | | } |
| | | EntityUtils.consume(resEntity); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException("接口请求失败,请尝试检查网络环境或请求接口是否能正常访问"+":"+e); |
| | | } finally { |
| | | try { |
| | | response.close(); |
| | | httpClient.close(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("流关闭失败!"+":"+e); |
| | | } |
| | | } |
| | | // 得到的是JSON类型的数据需要第三方解析JSON的jar包来解析 |
| | | return result; |
| | | } |
| | | |
| | | // 此方法是把传进的字节流转化为相应的字符串并返回,此方法一般在网络请求中用到 |
| | | public static String ConvertStreamToString(InputStream is, String charset) |
| | | throws Exception { |
| | | StringBuilder sb = new StringBuilder(); |
| | | try (InputStreamReader inputStreamReader = new InputStreamReader(is,charset)) { |
| | | try (BufferedReader reader = new BufferedReader(inputStreamReader)) { |
| | | String line = null; |
| | | while ((line = reader.readLine()) != null) { |
| | | sb.append(line).append("\r\n"); |
| | | } |
| | | } |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public List<BasicNameValuePair> toPairs(Map<String, Object> params) { |
| | | List<BasicNameValuePair> pairs = Lists.newArrayList(); |
| | | if (params != null && !params.isEmpty()) { |
| | | pairs = params.entrySet().stream().map(entry -> new BasicNameValuePair(entry.getKey(), |
| | | entry.getValue().toString())).collect(Collectors.toList()); |
| | | } |
| | | return pairs; |
| | | } |
| | | |
| | | /** |
| | | * get url请求 |
| | | * |
| | | * @param url |
| | | * @return |
| | | */ |
| | | public String get(String url) { |
| | | HttpGet request = new HttpGet(); |
| | | try { |
| | | request.setURI(new URI(url)); |
| | | return registRequest(request); |
| | | } catch (Exception e) { |
| | | log.error("请求失败", e); |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * PSOT URL方式提交 |
| | | * |
| | | * @param url 请求url |
| | | * @param params 请求参数 |
| | | * @return |
| | | */ |
| | | public String postFromUrl(String url, Map<String, Object> params) { |
| | | HttpPost request = new HttpPost(url); |
| | | RequestConfig requestConfig = RequestConfig.custom() |
| | | .setSocketTimeout(10000) |
| | | .setConnectTimeout(5000) |
| | | .build(); |
| | | request.setConfig(requestConfig); |
| | | request.setEntity(new UrlEncodedFormEntity(toPairs(params), Consts.UTF_8)); |
| | | return registRequest(request); |
| | | } |
| | | |
| | | /** |
| | | * PSOT JSON方式提交 |
| | | * |
| | | * @param url 请求url |
| | | * @param params json串 |
| | | * @return |
| | | */ |
| | | public String postFromJson(String url, String params) { |
| | | HttpPost request = new HttpPost(url); |
| | | request.setHeader("Content-type", "application/json"); |
| | | request.setHeader("Accept", "application/json"); |
| | | RequestConfig requestConfig = RequestConfig.custom() |
| | | .setSocketTimeout(8000) |
| | | .setConnectTimeout(6000) |
| | | .build(); |
| | | request.setConfig(requestConfig); |
| | | StringEntity entity = new StringEntity(params, StandardCharsets.UTF_8); |
| | | entity.setContentType("application/json"); |
| | | request.setEntity(entity); |
| | | try { |
| | | return registRequest(request); |
| | | } catch (Exception e) { |
| | | log.error("请求失败", e); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | | |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.util; |
| | | |
| | | import com.stylefeng.guns.modular.system.config.WxConfig; |
| | | import com.stylefeng.guns.modular.system.controller.resp.AccessTokenRespBody; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.text.MessageFormat; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | /** |
| | | * @Description |
| | | * @Author xiaochen |
| | | * @Date 2021/11/5/00519:26 |
| | | */ |
| | | @Component |
| | | public class TokenUtils { |
| | | public final static String ACCESS_TOKEN_CACHE_KEY = "accessToken"; |
| | | @Autowired |
| | | private RedisTemplate<String, String> redisTemplate; |
| | | @Autowired |
| | | private WxConfig wxConfig; |
| | | @Autowired |
| | | private RestTemplate wxRestTemplate; |
| | | @Autowired |
| | | private WxJsonUtils wxJsonUtils; |
| | | // @Autowired |
| | | // private RedisUtils redisUtils; |
| | | |
| | | /** |
| | | * @return |
| | | */ |
| | | public String getSimpleAccessToken() { |
| | | String accessToken = redisTemplate.opsForValue().get(ACCESS_TOKEN_CACHE_KEY); |
| | | if (StringUtils.hasLength(accessToken)) { |
| | | return accessToken; |
| | | } |
| | | String requestUrl = MessageFormat.format(Constant.ACCESS_TOKEN_URL, wxConfig.getAppId(), wxConfig.getSecret()); |
| | | String respBody = wxRestTemplate.getForEntity(requestUrl, String.class).getBody(); |
| | | AccessTokenRespBody accessTokenRespBody = wxJsonUtils.parseObject(respBody, AccessTokenRespBody.class); |
| | | // 判断有误异常 |
| | | if (StringUtils.hasLength(accessTokenRespBody.getErrorMsg())) { |
| | | // 抛出错误 |
| | | throw new RuntimeException(accessTokenRespBody.getErrorCode() + ":" + accessTokenRespBody.getErrorMsg()); |
| | | } |
| | | redisTemplate.opsForValue().set(ACCESS_TOKEN_CACHE_KEY, accessTokenRespBody.getAccessToken(), 2, TimeUnit.HOURS); |
| | | return accessTokenRespBody.getAccessToken(); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.util; |
| | | |
| | | |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * 定义生成随机码的工具类 |
| | | */ |
| | | public class UUIDUtil { |
| | | |
| | | private int i = 1; |
| | | |
| | | |
| | | /** |
| | | * 定义生成原生的UUID随机码 |
| | | * @return |
| | | */ |
| | | public static String getNativeUUID(){ |
| | | return UUID.randomUUID().toString(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 生成32位随机码 |
| | | * @return |
| | | */ |
| | | public static String getRandomCode(){ |
| | | return UUIDUtil.getNativeUUID().replaceAll("-", ""); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取给定长度的随机码 |
| | | * @param num |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public static String getRandomCode(Integer num) throws Exception{ |
| | | String str = null; |
| | | if(0 < num){ |
| | | if(num % 32 > 0){ |
| | | Integer s = num / 32; |
| | | Integer l = num % 32; |
| | | StringBuffer sb = new StringBuffer(); |
| | | for(int i = 0; i < s; i++){ |
| | | sb.append(UUIDUtil.getRandomCode()); |
| | | } |
| | | sb.append(UUIDUtil.getRandomCode().substring(0, l)); |
| | | str = sb.toString(); |
| | | }else if(num % 32 == 0){ |
| | | Integer s = num / 32; |
| | | StringBuffer sb = new StringBuffer(); |
| | | for(int i = 0; i < s; i++){ |
| | | sb.append(UUIDUtil.getRandomCode()); |
| | | } |
| | | str = sb.toString(); |
| | | }else{ |
| | | str = UUIDUtil.getRandomCode().substring(0, num); |
| | | } |
| | | }else{ |
| | | throw new Exception("参数只能大于0"); |
| | | } |
| | | return str; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取根据当前时间的字符串数据 |
| | | * @return |
| | | */ |
| | | public synchronized static String getTimeStr(){ |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | return simpleDateFormat.format(new Date()); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * @Description: 获取数字随机码 |
| | | * @Author pzb |
| | | * @Date 2021/8/11 16:52 |
| | | * @Param |
| | | * @Return |
| | | * @Exception |
| | | */ |
| | | public static String getNumberRandom(Integer num){ |
| | | if(null == num){ |
| | | num = 32; |
| | | } |
| | | StringBuffer sb = new StringBuffer(); |
| | | for(int i = 0; i < num; i++){ |
| | | sb.append(Double.valueOf(Math.random() * 10).intValue()); |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.util; |
| | | |
| | | import com.fasterxml.jackson.core.JsonGenerator; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.core.type.TypeReference; |
| | | import com.fasterxml.jackson.databind.DeserializationFeature; |
| | | import com.fasterxml.jackson.databind.JsonSerializer; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.databind.SerializerProvider; |
| | | import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; |
| | | import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer; |
| | | import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.IOException; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | |
| | | @Component |
| | | public final class WxJsonUtils { |
| | | |
| | | private Logger log = LoggerFactory.getLogger(this.getClass()); |
| | | |
| | | public static final String dateFormat = "yyyy-MM-dd"; |
| | | public static final String dateTimeFormat = "yyyy-MM-dd HH:mm:ss"; |
| | | private static final ObjectMapper OM = new ObjectMapper(); |
| | | private static final JavaTimeModule timeModule = new JavaTimeModule(); |
| | | |
| | | /** |
| | | * 转换LocalDateTime |
| | | */ |
| | | static class LocalDateTimeSerializer extends JsonSerializer<LocalDateTime> { |
| | | @Override |
| | | public void serialize(LocalDateTime localDateTime, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { |
| | | jsonGenerator.writeString(localDateTime.format(DateTimeFormatter.ofPattern(dateTimeFormat))); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 转换LocalDate |
| | | */ |
| | | static class LocalDateSerializer extends JsonSerializer<LocalDate> { |
| | | @Override |
| | | public void serialize(LocalDate localDate, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { |
| | | jsonGenerator.writeString(localDate.format(DateTimeFormatter.ofPattern(dateFormat))); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 设置 ObjectMapper |
| | | * |
| | | * @return |
| | | */ |
| | | private ObjectMapper getObjectMapper() { |
| | | // 序列化 |
| | | timeModule.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer()); |
| | | timeModule.addSerializer(LocalDate.class, new LocalDateSerializer()); |
| | | // 反序列化 |
| | | timeModule.addDeserializer(LocalDateTime.class, |
| | | new LocalDateTimeDeserializer(DateTimeFormatter.ofPattern(dateTimeFormat))); |
| | | timeModule.addDeserializer(LocalDate.class, |
| | | new LocalDateDeserializer(DateTimeFormatter.ofPattern(dateFormat))); |
| | | // 允许对象忽略json中不存在的属性 |
| | | OM.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); |
| | | OM.registerModule(timeModule); |
| | | return OM; |
| | | } |
| | | |
| | | /** |
| | | * 将对象序列化 |
| | | */ |
| | | public <T> String toJsonString(T obj) { |
| | | try { |
| | | ObjectMapper om = getObjectMapper(); |
| | | return om.writeValueAsString(obj); |
| | | } catch (JsonProcessingException e) { |
| | | log.error("转json字符串失败:{}", obj); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 反序列化对象字符串 |
| | | */ |
| | | public <T> T parseObject(String json, Class<T> clazz) { |
| | | try { |
| | | ObjectMapper om = getObjectMapper(); |
| | | return om.readValue(json, clazz); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("反序列化对象字符串失败"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 反序列化字符串成为对象 |
| | | */ |
| | | public <T> T parseObject(String json, TypeReference<T> valueTypeRef) { |
| | | try { |
| | | ObjectMapper om = getObjectMapper(); |
| | | return om.readValue(json, valueTypeRef); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("反序列化字符串成为对象失败"); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TOrderRefusal; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author stylefeng |
| | | * @since 2023-02-21 |
| | | */ |
| | | @Mapper |
| | | public interface TOrderRefusalMapper extends BaseMapper<TOrderRefusal> { |
| | | |
| | | } |
| | |
| | | */ |
| | | private Integer integral; |
| | | /** |
| | | * 剩余积分 |
| | | */ |
| | | private Double score; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | private Integer status; |
| | |
| | | |
| | | @ApiModelProperty(value = "驾驶证初次领证时间") |
| | | private Date firstCertificateTime; |
| | | @ApiModelProperty(value = "佣金") |
| | | private BigDecimal commission; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "区域") |
| | | private String area; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "区域id") |
| | | private String areaId; |
| | | |
| | | public BigDecimal getCommission() { |
| | | return commission; |
| | | } |
| | | |
| | | public void setCommission(BigDecimal commission) { |
| | | this.commission = commission; |
| | | } |
| | | |
| | | public Double getScore() { |
| | | return score; |
| | | } |
| | | |
| | | public void setScore(Double score) { |
| | | this.score = score; |
| | | } |
| | | |
| | | public String getArea() { |
| | | return area; |
| | | } |
| | | |
| | | public void setArea(String area) { |
| | | this.area = area; |
| | | } |
| | | |
| | | public String getAreaId() { |
| | | return areaId; |
| | | } |
| | | |
| | | public void setAreaId(String areaId) { |
| | | this.areaId = areaId; |
| | | } |
| | | |
| | | public Date getFirstCertificateTime() { |
| | | return firstCertificateTime; |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TDriverResp; |
| | | import com.stylefeng.guns.modular.system.model.TDriver; |
| | |
| | | void auditPage(Integer id, Model model); |
| | | |
| | | /** |
| | | * 跳转详情页面 |
| | | * @param tDriverId |
| | | * @param model |
| | | * 聚合ocr识别 |
| | | * @param imgUrl |
| | | * @return |
| | | */ |
| | | void detail(Integer tDriverId, Model model); |
| | | JSONObject ocr(String imgUrl); |
| | | |
| | | /** |
| | | * 新增修改处理数据 |
| | | * @param tDriver |
| | | */ |
| | | void addOrUpdate(TDriver tDriver); |
| | | |
| | | /** |
| | | * 查询佣金列表 |
| | | * @param name |
| | | * @param phone |
| | | * @param status |
| | | * @return |
| | | */ |
| | | EntityWrapper<TDriver> getCommissionPageList(String name, String phone, Integer status); |
| | | |
| | | } |
| | |
| | | |
| | | if(!CollectionUtils.isEmpty(tDrivers)){ |
| | | // 司机数 |
| | | List<TDriver> drivers = tDrivers.stream().filter(driver -> driver.getAgentId().equals(tAgent.getId())).collect(Collectors.toList()); |
| | | List<TDriver> drivers = tDrivers.stream().filter(driver -> tAgent.getId().equals(driver.getAgentId())).collect(Collectors.toList()); |
| | | tAgentResp.setDriverCount(drivers.size()); |
| | | // 司机充值计算 |
| | | List<Integer> driverIds = drivers.stream().map(TDriver::getId).collect(Collectors.toList()); |
| | |
| | | model.addAttribute("nickname",tAppUser.getNickname()); |
| | | model.addAttribute("remark",tAppUser.getRemark()); |
| | | model.addAttribute("createTime",DateUtil.formatDate(tAppUser.getCreateTime())); |
| | | // 客户渠道 |
| | | // todo 客户渠道 |
| | | model.addAttribute("customerChannel",""); |
| | | |
| | | // 消费信息:优惠券数据 |
| | |
| | | List<TCoupon> notUsedList = tCoupons.stream().filter(coupon -> coupon.getCouponStatus().equals(CouponStatusEnum.NOT_USED.getCode())).collect(Collectors.toList()); |
| | | List<TCoupon> usedList = tCoupons.stream().filter(coupon -> coupon.getCouponStatus().equals(CouponStatusEnum.USED.getCode())).collect(Collectors.toList()); |
| | | List<TCoupon> expiredList = tCoupons.stream().filter(coupon -> coupon.getCouponStatus().equals(CouponStatusEnum.EXPIRED.getCode())).collect(Collectors.toList()); |
| | | model.addAttribute("couponSum",tCoupons.size()); |
| | | model.addAttribute("notUsedCount",notUsedList.size()); |
| | | model.addAttribute("usedCount",usedList.size()); |
| | | model.addAttribute("expiredCount",expiredList.size()); |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TDriverResp; |
| | | import com.stylefeng.guns.modular.system.controller.util.HttpUtils; |
| | | import com.stylefeng.guns.modular.system.controller.util.UUIDUtil; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.enums.OrderStateEnum; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.ITDriverService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.service.ITRegionService; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.io.File; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.Period; |
| | |
| | | private TDriverMapper tDriverMapper; |
| | | @Autowired |
| | | private TAppUserMapper tAppUserMapper; |
| | | @Autowired |
| | | private TOrderRefusalMapper tOrderRefusalMapper; |
| | | @Autowired |
| | | private TRegionMapper tRegionMapper; |
| | | @Autowired |
| | | private ITRegionService itRegionService; |
| | | @Autowired |
| | | private HttpUtils httpUtils; |
| | | |
| | | @Override |
| | | public EntityWrapper<TDriver> getPageList(String createTime, String phone, Integer status) { |
| | |
| | | && order.getState().equals(OrderStateEnum.WAIT_EVALUATED.getCode()) && order.getState().equals(OrderStateEnum.FINISH.getCode()) |
| | | && new SimpleDateFormat("yyyyMM").format(order.getCreateTime()).equals(monthDate)).collect(Collectors.toList()); |
| | | tDriverResp.setMonthOrderCount(monthOrderCount.size()); |
| | | // TODO 拒单次数 |
| | | List<TOrder> refusalCount = tOrders.stream().filter(order -> order.getDriverId().equals(tDriver.getId()) |
| | | && order.getState().equals(OrderStateEnum.CANCELED.getCode())).collect(Collectors.toList()); |
| | | tDriverResp.setRefusalCount(refusalCount.size()); |
| | | // 拒单次数 |
| | | List<TOrderRefusal> driverRefusalList = tOrderRefusalMapper.selectList(new EntityWrapper<TOrderRefusal>().eq("driver_id", tDriver.getId())); |
| | | tDriverResp.setRefusalCount(driverRefusalList.size()); |
| | | |
| | | tDriverRespList.add(tDriverResp); |
| | | } |
| | |
| | | model.addAttribute("id",tDriver.getId()); |
| | | model.addAttribute("code",tDriver.getCode()); |
| | | model.addAttribute("name",tDriver.getName()); |
| | | model.addAttribute("avatar",tDriver.getAvatar()); |
| | | model.addAttribute("phone",tDriver.getPhone()); |
| | | model.addAttribute("sex",tDriver.getSex()); |
| | | model.addAttribute("driverLicenseNumber",tDriver.getDriverLicenseNumber()); |
| | |
| | | model.addAttribute("provinceName",tDriver.getProvinceName()); |
| | | model.addAttribute("cityName",tDriver.getCityName()); |
| | | model.addAttribute("areaName",tDriver.getAreaName()); |
| | | model.addAttribute("integral",tDriver.getIntegral()); |
| | | model.addAttribute("score",tDriver.getScore()); |
| | | model.addAttribute("createTime",new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(tDriver.getCreateTime())); |
| | | |
| | | // 计算驾龄 |
| | | ZoneId zoneId = ZoneId.systemDefault(); |
| | | LocalDate firstTime = tDriver.getFirstCertificateTime().toInstant().atZone(zoneId).toLocalDate(); |
| | | LocalDate now = tDriver.getFirstCertificateTime().toInstant().atZone(zoneId).toLocalDate(); |
| | | Period period = Period.between(firstTime, now); |
| | | model.addAttribute("drivingExperience",period.getYears()); |
| | | if(Objects.nonNull(tDriver.getFirstCertificateTime())){ |
| | | ZoneId zoneId = ZoneId.systemDefault(); |
| | | LocalDate firstTime = tDriver.getFirstCertificateTime().toInstant().atZone(zoneId).toLocalDate(); |
| | | LocalDate now = tDriver.getFirstCertificateTime().toInstant().atZone(zoneId).toLocalDate(); |
| | | Period period = Period.between(firstTime, now); |
| | | model.addAttribute("drivingExperience",period.getYears()); |
| | | }else { |
| | | model.addAttribute("drivingExperience",0); |
| | | } |
| | | |
| | | List<TOrder> tOrders = tOrderMapper.selectList(new EntityWrapper<TOrder>()); |
| | | |
| | | String monthDate = new SimpleDateFormat("yyyyMM").format(new Date()); |
| | | |
| | | // 设置余额 |
| | | tDriver.setBalance(tDriver.getBackgroundBalance().add(tDriver.getBalance())); |
| | | if(Objects.nonNull(tDriver.getBackgroundBalance()) && Objects.nonNull(tDriver.getBalance())){ |
| | | // 设置余额 |
| | | tDriver.setBalance(tDriver.getBackgroundBalance().add(tDriver.getBalance())); |
| | | model.addAttribute("balance",tDriver.getBalance()); |
| | | }else { |
| | | model.addAttribute("balance",BigDecimal.ZERO); |
| | | } |
| | | |
| | | // 所属代理商 |
| | | TAgent tAgent = tAgentMapper.selectById(tDriver.getAgentId()); |
| | |
| | | } |
| | | |
| | | // 查询邀请人 |
| | | if(1 == tDriver.getInviterType()){ |
| | | if(Objects.nonNull(tDriver.getInviterType()) && 1 == tDriver.getInviterType()){ |
| | | TAppUser tAppUser = tAppUserMapper.selectById(tDriver.getInviterId()); |
| | | model.addAttribute("inviterName",tAppUser.getNickname()); |
| | | model.addAttribute("inviterPhone",tAppUser.getPhone()); |
| | | }else if(2 == tDriver.getInviterType()){ |
| | | }else if(Objects.nonNull(tDriver.getInviterType()) && 2 == tDriver.getInviterType()){ |
| | | TDriver tDriver1 = tDriverMapper.selectById(tDriver.getInviterId()); |
| | | model.addAttribute("inviterName",tDriver1.getName()); |
| | | model.addAttribute("inviterPhone",tDriver1.getPhone()); |
| | | }else { |
| | | model.addAttribute("inviterName",""); |
| | | model.addAttribute("inviterPhone",""); |
| | | } |
| | | |
| | | // 查询当前用户邀请了哪些人 |
| | | List<TDriver> list = tDriverMapper.selectList(new EntityWrapper<TDriver>().eq("inviterId", tDriver.getId())); |
| | | if(!CollectionUtils.isEmpty(list)){ |
| | | model.addAttribute("inviterCount",list.size()); |
| | | model.addAttribute("inviterCommission",0); |
| | | }else { |
| | | model.addAttribute("inviterCommission",0); |
| | | model.addAttribute("inviterCount",0); |
| | | } |
| | | |
| | | if(!CollectionUtils.isEmpty(tOrders)){ |
| | |
| | | && order.getState().equals(OrderStateEnum.WAIT_EVALUATED.getCode()) && order.getState().equals(OrderStateEnum.FINISH.getCode()) |
| | | && new SimpleDateFormat("yyyyMM").format(order.getCreateTime()).equals(monthDate)).collect(Collectors.toList()); |
| | | model.addAttribute("monthOrderCount",monthOrderCount.size()); |
| | | // TODO 拒单次数 |
| | | List<TOrder> refusalCount = tOrders.stream().filter(order -> order.getDriverId().equals(tDriver.getId()) |
| | | && order.getState().equals(OrderStateEnum.CANCELED.getCode())).collect(Collectors.toList()); |
| | | model.addAttribute("refusalCount",refusalCount.size()); |
| | | // 拒单次数 |
| | | List<TOrderRefusal> driverRefusalList = tOrderRefusalMapper.selectList(new EntityWrapper<TOrderRefusal>().eq("driver_id", tDriver.getId())); |
| | | model.addAttribute("refusalCount",driverRefusalList.size()); |
| | | // todo 累计收入 |
| | | model.addAttribute("cumulativeIncome",0); |
| | | }else { |
| | | model.addAttribute("cumulativeOrderCount",""); |
| | | model.addAttribute("monthOrderCount",""); |
| | | model.addAttribute("refusalCount",""); |
| | | model.addAttribute("cumulativeOrderCount",0); |
| | | model.addAttribute("monthOrderCount",0); |
| | | model.addAttribute("refusalCount",0); |
| | | // 累计收入 |
| | | model.addAttribute("cumulativeIncome",0); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void detail(Integer tDriverId, Model model) { |
| | | auditPage(tDriverId,model); |
| | | // TODO 查询司机 |
| | | TDriver tDriver = tDriverMapper.selectById(tDriverId); |
| | | public JSONObject ocr(String imgUrl) { |
| | | File file = new File(imgUrl); |
| | | String result = httpUtils.ocr("2", file); |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | return jsonObject; |
| | | } |
| | | |
| | | @Override |
| | | public void addOrUpdate(TDriver tDriver) { |
| | | // 对省市区做处理 |
| | | String[] split = tDriver.getAreaId().split("/"); |
| | | // 查询省市 |
| | | // 黑龙江省/大兴安岭地区 |
| | | // 702/852 |
| | | TRegion province = tRegionMapper.selectById(split[0]); |
| | | tDriver.setProvinceName(province.getName()); |
| | | tDriver.setProvinceCode(province.getCode()); |
| | | |
| | | TRegion city = tRegionMapper.selectById(split[1]); |
| | | if(Objects.isNull(city)){ |
| | | city = itRegionService.selectOne(new EntityWrapper<TRegion>().eq("name",split[1])); |
| | | } |
| | | tDriver.setCityName(city.getName()); |
| | | tDriver.setCityCode(city.getCode()); |
| | | |
| | | TRegion area = tRegionMapper.selectById(split[2]); |
| | | if(Objects.isNull(area)){ |
| | | area = itRegionService.selectOne(new EntityWrapper<TRegion>().eq("name",split[2])); |
| | | } |
| | | tDriver.setAreaName(area.getName()); |
| | | tDriver.setAreaCode(area.getCode()); |
| | | |
| | | tDriver.setCode(UUIDUtil.getNumberRandom(16)); |
| | | tDriver.setBalance(BigDecimal.ZERO); |
| | | tDriver.setBackgroundBalance(BigDecimal.ZERO); |
| | | |
| | | // 通过省市查询代理商 |
| | | List<TAgent> tAgent = tAgentMapper.selectList(new EntityWrapper<TAgent>().eq("provinceCode", province.getCode()) |
| | | .eq("cityCode", city.getCode()) |
| | | .last("LIMIT 1")); |
| | | if(!CollectionUtils.isEmpty(tAgent)){ |
| | | tDriver.setAgentId(tAgent.get(0).getId()); |
| | | } |
| | | // 查询邀约人(司机端) |
| | | List<TDriver> emergencyDriver = tDriverMapper.selectList(new EntityWrapper<TDriver>().eq("phone", tDriver.getEmergencyPhone()) |
| | | .last("LIMIT 1")); |
| | | if(!CollectionUtils.isEmpty(emergencyDriver)){ |
| | | tDriver.setInviterId(emergencyDriver.get(0).getId()); |
| | | tDriver.setInviterType(2); |
| | | } |
| | | // 通过省市区查询分公司 |
| | | List<TBranchOffice> tBranchOffice = tBranchOfficeMapper.selectList(new EntityWrapper<TBranchOffice>().eq("provinceCode", province.getCode()) |
| | | .eq("cityCode", city.getCode()) |
| | | .eq("districtCode", area.getCode()) |
| | | .last("LIMIT 1")); |
| | | if(!CollectionUtils.isEmpty(tBranchOffice)){ |
| | | tDriver.setBranchOfficeId(tBranchOffice.get(0).getId()); |
| | | } |
| | | |
| | | // ocr识别 |
| | | // JSONObject ocr = this.ocr("E:\\071bf986db0b00355c0ed190bbd3b16.png"); |
| | | // System.err.println(ocr); |
| | | } |
| | | |
| | | @Override |
| | | public EntityWrapper<TDriver> getCommissionPageList(String name, String phone, Integer status) { |
| | | EntityWrapper<TDriver> wrapper = new EntityWrapper<>(); |
| | | // 手机号 |
| | | if(StringUtils.hasLength(phone)){ |
| | | wrapper.like("phone",phone); |
| | | } |
| | | // 状态 |
| | | if(Objects.nonNull(status)){ |
| | | wrapper.eq("status",status); |
| | | } |
| | | // 姓名 |
| | | if(StringUtils.hasLength(name)){ |
| | | wrapper.like("name",name); |
| | | } |
| | | wrapper.orderBy(true,"approvalStatus"); |
| | | return wrapper; |
| | | } |
| | | } |
| | |
| | | spring: |
| | | profiles: |
| | | active: local |
| | | datasource: |
| | | url: jdbc:mysql://192.168.0.80:3306/super_save_driving?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: 123456 |
| | | db-name: super_save_driving #用来搜集数据库的所有表 |
| | | filters: wall,mergeStat |
| | | # datasource: |
| | | # url: jdbc:mysql://192.168.0.80:3306/super_save_driving?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8 |
| | | # username: root |
| | | # password: 123456 |
| | | # db-name: super_save_driving #用来搜集数据库的所有表 |
| | | # filters: wall,mergeStat |
| | | mvc: |
| | | static-path-pattern: /static/** |
| | | view: |
| | |
| | | multipart: |
| | | max-request-size: 100MB |
| | | max-file-size: 100MB |
| | | redis: |
| | | #测试环境 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | timeout: 5000 |
| | | database: 10 |
| | | |
| | | mybatis-plus: |
| | | type-aliases-package: com.stylefeng.guns.modular.system.model |
| | |
| | | configuration: |
| | | configuration.map-underscore-to-camel-case: true #是否开启自动驼峰命名规则(camel case)映射 |
| | | log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl #输出Sql,如需打印Sql注释该配置 |
| | | |
| | | |
| | | wx: |
| | | conf: |
| | | appId: wx3613e8d4c8624ea1 |
| | | secret: 25782eabe39e796a92d2fcb38947e7dc |
| | | |
| | | #eureka: |
| | | # client: |
| | |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | |
| | | <div class="row"> |
| | | <input hidden id="areaId" value="areaId"> |
| | | <div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">负责人姓名:</label> |
| | | <div class="col-sm-6"> |
| | | <input class="form-control" id="principal" name="principal" type="text"> |
| | | <div class="row" > |
| | | <div class="col-sm-12" style="text-align: center"> |
| | | <input hidden id="areaId" value="areaId"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" style="text-align: center"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >负责人姓名:</label> |
| | | <input id="principal" name="principal" type="text" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | </div> |
| | | <div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">联系电话:</label> |
| | | <div class="col-sm-6"> |
| | | <input class="form-control" id="principalPhone" name="principalPhone" type="text"> |
| | | <!--<div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <span style="color:red">*</span> |
| | | <label class="col-sm-3 control-label">负责人姓名:</label> |
| | | <div class="col-sm-6"> |
| | | <input class="form-control" id="principal" name="principal" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | </div>--> |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >联系电话:</label> |
| | | <input id="principalPhone" name="principalPhone" type="number" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | </div> |
| | | <div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">邮箱:</label> |
| | | <div class="col-sm-6"> |
| | | <input class="form-control" id="email" name="email" type="text"> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <label class="control-label" >邮箱:</label> |
| | | <input id="email" name="email" type="email" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >代理区域:</label> |
| | | <input id="area" onclick="TAgent.area()" name="area" placeholder="请选择" style="height: 30px" readonly> |
| | | </div> |
| | | </div> |
| | | |
| | | <!--<div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <span style="color:red">*</span> |
| | | <label class="col-sm-3 control-label">代理区域:</label> |
| | | <div class="col-sm-6"> |
| | | <input class="form-control" id="area" onclick="TAgent.area()" name="area" type="text" placeholder="请选择"> |
| | | </div> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | </div>--> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <label class="control-label" >开户银行:</label> |
| | | <input id="bankDeposit" name="bankDeposit" type="text" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <div class="initialLevel col-sm-6 control-label form-group" > |
| | | <label class="control-label" >银行账户:</label> |
| | | <input id="bankAccount" name="bankAccount" type="number" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">代理区域:</label> |
| | | <div class="col-sm-6"> |
| | | <input class="form-control" id="area" onclick="TAgent.area()" name="area" type="text" placeholder="请选择"> |
| | | </div> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | </div> |
| | | |
| | | <div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">开户银行:</label> |
| | | <div class="col-sm-6"> |
| | | <input class="form-control" id="bankDeposit" name="bankDeposit" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | </div> |
| | | |
| | | <div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">银行账户:</label> |
| | | <div class="col-sm-6"> |
| | | <input class="form-control" id="bankAccount" name="bankAccount" type="text"> |
| | | </div> |
| | | </div> |
| | | <div class="hr-line-dashed"></div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10" style="text-align: center"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TAgentInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TAgentInfoDlg.close()"/> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TAgentInfoDlg.addSubmit()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-1 control-label form-group" style="margin-left: 10px" > |
| | | <img src="https://lmg.jj20.com/up/allimg/1114/040221103339/210402103339-7-1200.jpg" /> |
| | | <img src="${avatar}" style="height: 100px;width: 100px"/> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >昵称:</label> |
| | |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-1 control-label form-group" style="margin-left: 10px" > |
| | | <img src="https://lmg.jj20.com/up/allimg/1114/040221103339/210402103339-7-1200.jpg" /> |
| | | <img src="${avatar}" style="height: 100px;width: 100px"/> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >昵称:</label> |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12" style="height: 100px;"> |
| | | <input hidden id="provinceName" value="${provinceName}"> |
| | | <input hidden id="cityName" value="${cityName}"> |
| | | <input hidden id="districtName" value="${districtName}"> |
| | | <input hidden id="provinceId" value="${provinceId}"> |
| | | <input hidden id="cityId" value="${cityId}"> |
| | | <input hidden id="districtId" value="${districtId}"> |
| | | |
| | | <div class="col-sm-4 control-label"> |
| | | <label class="col-sm-1" style="width: 20px;">省:</label> |
| | | <select class="input-group col-sm-2 " onclick="TDriver.areaCity()" id="province" style="width: 200px;height: 33px" name="province"> |
| | | <option value="">请选择省</option> |
| | | @for(i in provinceList){ |
| | | <option id="${i.id}" value="${i.name}"${i.name == provinceName ? 'selected=selected' : ''}>${i.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-4 control-label"> |
| | | <label class="col-sm-1" style="width: 20px;">市:</label> |
| | | <select class="input-group col-sm-2" onclick="TDriver.areaDistrict()" id="city" style="width: 200px;height: 33px" name="city"> |
| | | <option>请选择市</option> |
| | | @for(city in cityList){ |
| | | <option id="${city.id}" value="${city.name}"${city.name == cityName ? 'selected=selected' : ''}>${city.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-4 control-label"> |
| | | <label class="col-sm-1" style="width: 20px;">区:</label> |
| | | <select class="input-group col-sm-2" id="district" style="width: 200px;height: 33px" name="district"> |
| | | <option>请选择区</option> |
| | | @for(district in districtList){ |
| | | <option id="${district.id}" value="${district.name}"${district.name == districtName ? 'selected=selected' : ''}>${district.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TAppUserTableToolbar" role="group" style="text-align:center"> |
| | | <#button name="取消" icon="fa-plus" clickFun="TDriverInfoDlg.close()" /> |
| | | <#button name="确定" icon="fa-plus" clickFun="TDriver.submitArea()"/> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tDriver/tDriver.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tDriver/tDriver_info.js"></script> |
| | | <script type="text/javascript"> |
| | | </script> |
| | | @} |
| | |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">头像:</label> |
| | | <img src="https://lmg.jj20.com/up/allimg/1114/040221103339/210402103339-7-1200.jpg" /> |
| | | <img src="${avatar}" style="height: 100px;width: 100px"/> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label">紧急联系人:</label> |
| | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >驾驶证照片:</label> |
| | | <img src="https://lmg.jj20.com/up/allimg/1114/040221103339/210402103339-7-1200.jpg" /> |
| | | <img src="${driverLicense}" style="height: 100px;width: 100px"/> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">身份证照片:</label> |
| | | <img src="https://lmg.jj20.com/up/allimg/1114/040221103339/210402103339-7-1200.jpg" /> |
| | | <img src="${idcardFront}" style="height: 100px;width: 100px"/> |
| | | </div> |
| | | </div> |
| | | |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="phone" name="手机号" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="name" name="司机姓名" /> |
| | | </div> |
| | | <div class="col-sm-1"> |
| | | <select class="input-group" id="status" style="width: 80px;height: 33px" name="status"> |
| | | <option value="">状态</option> |
| | | <option value="1">正常</option> |
| | | <option value="2">冻结</option> |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TDriverCommission.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TDriverCommission.resetSearch()" space="true"/> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <button type="button" class="btn btn-primary " onclick="TDriverCommission.export()" id="export"> |
| | | <i class="fa "></i> 导出 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <!--<div class="hidden-xs" id="TDriverTableToolbar" role="group"> |
| | | @if(shiro.hasPermission("/tDriver/add")){ |
| | | <#button name="添加" icon="fa-plus" clickFun="TDriver.openAddTDriver()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tDriver/update")){ |
| | | <#button name="修改" icon="fa-edit" clickFun="TDriver.openTDriverDetail()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/tDriver/delete")){ |
| | | <#button name="删除" icon="fa-remove" clickFun="TDriver.delete()" space="true"/> |
| | | @} |
| | | </div>--> |
| | | <#table id="TDriverCommissionTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tDriver/tDriverCommission.js"></script> |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#createTime', |
| | | type: 'date', |
| | | range: true |
| | | }); |
| | | </script> |
| | | @} |
| | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >身份证正面照:</label> |
| | | <img src="https://lmg.jj20.com/up/allimg/1114/040221103339/210402103339-7-1200.jpg" /> |
| | | <img src="${idcardFront}" style="height: 100px;width: 100px"/> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">身份证背面照:</label> |
| | | <img src="https://lmg.jj20.com/up/allimg/1114/040221103339/210402103339-7-1200.jpg" /> |
| | | <img src="${idcardBack}" style="height: 100px;width: 100px"/> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label" >累计订单:</label> |
| | | <label>${name}</label> |
| | | <label>${cumulativeOrderCount}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >邀约用户人数:</label> |
| | | <label>${idcard}</label> |
| | | <label>${inviterCount}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >累计获得佣金:</label> |
| | | <label>${idcard}</label> |
| | | <label>${inviterCommission}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label" >当前积分:</label> |
| | | <label>${idcard}</label> |
| | | <label>${integral}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label" >代驾次数:</label> |
| | | <label>${idcard}</label> |
| | | <label>${cumulativeOrderCount}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label" >累计获得收入:</label> |
| | | <label>${name}</label> |
| | | <label>${cumulativeIncome}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >钱包余额:</label> |
| | | <label>${idcard}</label> |
| | | <label>${balance}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >评论分数:</label> |
| | | <label>${idcard}</label> |
| | | <label>${score}</label> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tDriver/tDriver.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tDriver/tDriver_info.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tOrderRefusal/tOrderRefusal.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tDriver/tOrderRefusal.js"></script> |
| | | <script type="text/javascript"> |
| | | /*$(function () { |
| | | $(function () { |
| | | var queryData = {}; |
| | | queryData['condition'] = $("#driverId").val();; |
| | | TOrderRefusal.table.refresh({query: queryData}); |
| | | });*/ |
| | | }); |
| | | laydate.render({ |
| | | elem: '#createTime', |
| | | type: 'date', |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6 b-r"> |
| | | <#input id="id" name="主键" underline="true"/> |
| | | <#input id="code" name="编号" underline="true"/> |
| | | <#input id="name" name="姓名" underline="true"/> |
| | | <#input id="avatar" name="头像" underline="true"/> |
| | | <#input id="phone" name="手机号" underline="true"/> |
| | | <#input id="password" name="密码" underline="true"/> |
| | | <#input id="sex" name="性别(1=男,2=女)" underline="true"/> |
| | | <#input id="source" name="来源(1=)" underline="true"/> |
| | | <#input id="emergencyContact" name="紧急联系人" underline="true"/> |
| | | <#input id="emergencyPhone" name="紧急联系电话" underline="true"/> |
| | | <#input id="driverLicenseNumber" name="驾驶证号码" underline="true"/> |
| | | <#input id="driverLicense" name="驾驶证照片" underline="true"/> |
| | | <#input id="idcard" name="身份证号码" underline="true"/> |
| | | <#input id="idcardFront" name="身份证正面照"/> |
| | | </div> |
| | | |
| | | <div class="col-sm-6"> |
| | | <#input id="idcardBack" name="身份证背面照" underline="true"/> |
| | | <#input id="inviterType" name="邀约人类型(1=用户,2=司机)" underline="true"/> |
| | | <#input id="inviterId" name="邀约人id" underline="true"/> |
| | | <#input id="agentId" name="代理商id" underline="true"/> |
| | | <#input id="branchOfficeId" name="分公司id" underline="true"/> |
| | | <#input id="balance" name="账户余额" underline="true"/> |
| | | <#input id="approvalStatus" name="审核状态(1=待审核,2=已同意,3=已拒绝)" underline="true"/> |
| | | <#input id="approvalNotes" name="审核注释" underline="true"/> |
| | | <#input id="approvalUserId" name="审核用户id" underline="true"/> |
| | | <#input id="approvalTime" name="审核时间" underline="true"/> |
| | | <#input id="serverStatus" name="服务状态(1=空闲,2=服务中)" underline="true"/> |
| | | <#input id="integral" name="剩余积分" underline="true"/> |
| | | <#input id="status" name="状态(1=正常,2=冻结,3=删除)" underline="true"/> |
| | | <#input id="createTime" name="添加时间" underline="true"/> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>添加</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <input hidden id="areaId" value="${areaId}"> |
| | | <hr/> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div style="background-color: gray;height: 35px;line-height: 35px"> |
| | | <label style="color: #0C0C0C;text-align:left;">司机信息</label> |
| | | </div> |
| | | </div> |
| | | <hr/> |
| | | <div class="col-sm-12" style="cursor: pointer;text-align: right;"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >姓名:</label> |
| | | <input id="name" type="text" style="height: 30px" required> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >手机号:</label> |
| | | <input id="phone" type="number" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TDriverInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TDriverInfoDlg.close()"/> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >紧急联系人姓名:</label> |
| | | <input id="emergencyContact" type="text" style="height: 30px" required> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >紧急联系人电话:</label> |
| | | <input id="emergencyPhone" type="number" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >邀约人姓名:</label> |
| | | <input id="inviterName" type="text" style="height: 30px"> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >邀约人电话:</label> |
| | | <input id="inviterPhone" type="number" style="height: 30px"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >服务区域:</label> |
| | | <input id="area" onclick="TDriver.area()" name="area" placeholder="请选择" style="height: 30px" readonly required> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <hr/> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div style="background-color: gray;height: 35px;line-height: 35px"> |
| | | <label style="color: #0C0C0C;text-align:right">认证资料</label> |
| | | </div> |
| | | </div> |
| | | <hr/> |
| | | |
| | | <div class="col-sm-12"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >身份证号码:</label> |
| | | <input id="idcard" type="text" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >身份证正面照:</label> |
| | | <#uploadImg id="idcardFront"/> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >身份证背面照:</label> |
| | | <#uploadImg id="idcardBack"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >驾驶证:</label> |
| | | <#uploadImg id="driverLicense"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10" style="text-align: center"> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TDriverInfoDlg.close()"/> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TDriverInfoDlg.addSubmit()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tDriver/tDriver_info.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tDriver/tDriver.js"></script> |
| | | <script type="text/javascript"> |
| | | $(function () { |
| | | var idCardPositive = new $WebUpload("idcardFront"); |
| | | idCardPositive.setUploadBarId("progressBar"); |
| | | idCardPositive.init(); |
| | | var idCardPositive = new $WebUpload("idcardBack"); |
| | | idCardPositive.setUploadBarId("progressBar"); |
| | | idCardPositive.init(); |
| | | var idCardPositive = new $WebUpload("driverLicense"); |
| | | idCardPositive.setUploadBarId("progressBar"); |
| | | idCardPositive.init(); |
| | | }); |
| | | </script> |
| | | @} |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>添加</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <input hidden id="id" value="${item.id}"/> |
| | | <input hidden id="areaId" value="${item.areaId}"> |
| | | <hr/> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div style="background-color: gray;height: 35px;line-height: 35px"> |
| | | <label style="color: #0C0C0C;text-align:left;">司机信息</label> |
| | | </div> |
| | | </div> |
| | | <hr/> |
| | | <div class="col-sm-12" style="cursor: pointer;text-align: right;"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >姓名:</label> |
| | | <input id="name" value="${item.name}" type="text" style="height: 30px" required> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >手机号:</label> |
| | | <input id="phone" value="${item.phone}" type="number" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >紧急联系人姓名:</label> |
| | | <input id="emergencyContact" value="${item.emergencyContact}" type="text" style="height: 30px" required> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >紧急联系人电话:</label> |
| | | <input id="emergencyPhone" value="${item.emergencyPhone}" type="number" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >邀约人姓名:</label> |
| | | <input id="inviterName" value="${item.inviterName}" type="text" style="height: 30px"> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >邀约人电话:</label> |
| | | <input id="inviterPhone" value="${item.inviterPhone}" type="number" style="height: 30px"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >服务区域:</label> |
| | | <input id="area" value="${item.area}" onclick="TDriver.area()" name="area" placeholder="请选择" style="height: 30px" readonly required> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <hr/> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div style="background-color: gray;height: 35px;line-height: 35px"> |
| | | <label style="color: #0C0C0C;text-align:right">认证资料</label> |
| | | </div> |
| | | </div> |
| | | <hr/> |
| | | |
| | | <div class="col-sm-12"> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >身份证号码:</label> |
| | | <input id="idcard" value="${item.idcard}" type="text" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >身份证正面照:</label> |
| | | <#uploadImg id="idcardFront" fileImg="${item.idcardFront}"/> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >身份证背面照:</label> |
| | | <#uploadImg id="idcardBack" fileImg="${item.idcardBack}"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >驾驶证:</label> |
| | | <#uploadImg id="driverLicense" fileImg="${item.driverLicense}"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10" style="text-align: center"> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TDriverInfoDlg.close()"/> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TDriverInfoDlg.editSubmit()"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!--<div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | |
| | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div>--> |
| | | <script src="${ctxPath}/static/modular/system/tDriver/tDriver_info.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tDriver/tDriver.js"></script> |
| | | <script type="text/javascript"> |
| | | $(function () { |
| | | if('' == $("#inviterName").val()){ |
| | | $("#inviterName").val('') |
| | | } |
| | | if('' == $("#inviterPhone").val()){ |
| | | $("#inviterPhone").val('') |
| | | } |
| | | |
| | | var idCardPositive = new $WebUpload("idcardFront"); |
| | | idCardPositive.setUploadBarId("progressBar"); |
| | | idCardPositive.init(); |
| | | var idCardPositive = new $WebUpload("idcardBack"); |
| | | idCardPositive.setUploadBarId("progressBar"); |
| | | idCardPositive.init(); |
| | | var idCardPositive = new $WebUpload("driverLicense"); |
| | | idCardPositive.setUploadBarId("progressBar"); |
| | | idCardPositive.init(); |
| | | }); |
| | | </script> |
| | | @} |
| | |
| | | } |
| | | } |
| | | }, |
| | | {title: '头像', field: 'avatar', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '头像', field: 'avatar', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | return '<img src="'+row.avatar+'" style="height: 60px;width: 60px"/>' |
| | | } |
| | | }, |
| | | {title: '微信openid', field: 'openid', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '微信unionid', field: 'unionid', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '紧急联系人', field: 'emergencyContact', visible: true, align: 'center', valign: 'middle'}, |
| | |
| | | {title: '用户ID', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '用户昵称', field: 'nickname', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '手机号', field: 'phone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '剩余优惠券', field: 'sex', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券总数', field: 'avatar', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '消费次数', field: 'openid', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '历史消费', field: 'unionid', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '剩余优惠券', field: 'notUsedCount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券总数', field: 'couponSum', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '消费次数', field: 'consumeSum', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '历史消费', field: 'consumePrice', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '最后一次消费时间', field: 'emergencyContact', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'status', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '操作', visible: true, align: 'center', valign: 'middle',width:150, |
| | |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['800px', '420px'], //宽高 |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDriver/tDriver_add' |
| | |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['800px', '420px'], //宽高 |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDriver/tDriver_update/' + TDriver.seItem.id |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 打开区域选择页面 |
| | | */ |
| | | TDriver.area = function () { |
| | | |
| | | var area = $("#area").val(); |
| | | var areaId = $("#areaId").val(); |
| | | |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '区域选择', |
| | | area: ['1000px', '270px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDriver/areaPage?area='+area+'&areaId='+areaId |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | |
| | | /** |
| | | * 查询市 |
| | | */ |
| | | TDriver.areaCity = function () { |
| | | var province = document.getElementById('province'); |
| | | var index= province.selectedIndex ; |
| | | var id = province.options[index].id; |
| | | var ajax = new $ax(Feng.ctxPath + "/tDriver/areaCity?parentId="+id, function (data) { |
| | | var opts=document.getElementById('city').options; |
| | | opts.length=0;// 这一句是清空原有列表项 |
| | | for(var i=0,n=data.length;i<n;i++){ |
| | | var data1=data[i]; |
| | | var opt=new Option(data1.name,data1.id,true,true); |
| | | opts.add(opt); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("查询失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 查询区 |
| | | */ |
| | | TDriver.areaDistrict = function () { |
| | | var city = document.getElementById('city'); |
| | | var cityIndex= city.selectedIndex ; |
| | | var id = city.options[cityIndex].value; |
| | | var ajax = new $ax(Feng.ctxPath + "/tDriver/areaCity?parentId="+id, function (data) { |
| | | var opts=document.getElementById('district').options; |
| | | opts.length=0;// 这一句是清空原有列表项 |
| | | for(var i=0,n=data.length;i<n;i++){ |
| | | var data1=data[i]; |
| | | var opt=new Option(data1.name,data1.id,true,true); |
| | | opts.add(opt); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("查询失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 选择省市 |
| | | */ |
| | | TDriver.submitArea = function () { |
| | | var province = document.getElementById('province'); |
| | | var provinceIndex= province.selectedIndex ; |
| | | var provinceName = province.options[provinceIndex].value; |
| | | var provinceId = province.options[provinceIndex].id; |
| | | |
| | | var city = document.getElementById('city'); |
| | | var cityIndex= city.selectedIndex ; |
| | | var cityId = city.options[cityIndex].value; |
| | | var cityName = city.options[cityIndex].innerText; |
| | | |
| | | var district = document.getElementById('district'); |
| | | var districtIndex= district.selectedIndex ; |
| | | var districtId = district.options[districtIndex].value; |
| | | var districtName = district.options[districtIndex].innerText; |
| | | |
| | | parent.$("#area").val(provinceName+'/'+cityName+'/'+districtName) |
| | | parent.$("#areaId").val(provinceId+'/'+cityId+'/'+districtId) |
| | | TDriverInfoDlg.close(); |
| | | } |
| | | |
| | | /** |
| | | * 打开编辑页面 |
| | | */ |
| | | TDriver.updateInfo = function (id) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '编辑', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDriver/tDriver_update?tDriverId='+id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | TDriver.search = function () { |
New file |
| | |
| | | /** |
| | | * 管理初始化 |
| | | */ |
| | | var TDriverCommission = { |
| | | id: "TDriverCommissionTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TDriverCommission.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '手机号', field: 'phone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '所属代理商', field: 'agentName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '性别', field: 'sex', visible: false, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.sex === 1){ |
| | | return '<span>男</span>' |
| | | }else if (row.sex === 2){ |
| | | return '<span>女</span>' |
| | | }else { |
| | | return '<span>未知</span>' |
| | | } |
| | | }}, |
| | | {title: '推广人数', field: 'cumulativeOrderCount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '关联人数', field: 'cumulativeOrderCount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '累计获得佣金', field: 'cumulativeOrderCount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '可提现佣金', field: 'monthOrderCount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '已提现金额', field: 'integral', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'status', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.status === 1){ |
| | | return '<span>正常</span>' |
| | | }else if (row.status === 2){ |
| | | return '<span>冻结</span>' |
| | | }else if (row.status === 3){ |
| | | return '<span>已删除</span>' |
| | | } |
| | | }}, |
| | | {title: '操作', visible: true, align: 'center', valign: 'middle',width:150, |
| | | formatter: function (value, row) { |
| | | if (row.status === 1){ |
| | | return '<a href="#" onclick="TDriverCommission.searchTDriverDetail('+row.id+')" style="color:green">详情</a>' |
| | | }else if (row.status === 2){ |
| | | return '<a href="#" onclick="TDriverCommission.searchTDriverDetail('+row.id+')" style="color:green">详情</a>' |
| | | } |
| | | } |
| | | } |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TDriverCommission.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TDriverCommission.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加 |
| | | */ |
| | | TDriverCommission.openAddTDriver = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDriver/tDriver_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看详情 |
| | | */ |
| | | TDriverCommission.openTDriverDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDriver/tDriver_update/' + TDriver.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看详情(使用中) |
| | | */ |
| | | TDriverCommission.searchTDriverDetail = function (id) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDriver/driverDetail?tDriverId=' + id |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | TDriverCommission.delete = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tDriver/delete", function (data) { |
| | | Feng.success("删除成功!"); |
| | | TDriverCommission.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("删除失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("tDriverId",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 停用页面 |
| | | */ |
| | | TDriverCommission.stop = function (id) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '停用', |
| | | area: ['45%', '50%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDriver/tDriver_start_and_stop?id='+id |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 启动页面 |
| | | */ |
| | | TDriverCommission.start = function (id) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '启用', |
| | | area: ['45%', '50%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tDriver/tDriver_start_and_stop?id='+id |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 提交启用冻结 |
| | | */ |
| | | TDriverCommission.updateStatus = function () { |
| | | var ajax = new $ax(Feng.ctxPath + "/tDriver/update-status", function (data) { |
| | | Feng.success("修改成功!"); |
| | | TDriverInfoDlg.close(); |
| | | parent.TDriverCommission.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",$("#id").val()); |
| | | ajax.set("status",$("#status").val()); |
| | | if($("#status").val() == 1){ |
| | | ajax.set("remark",$("#stopRemark").val()); |
| | | } |
| | | if($("#status").val() == 2){ |
| | | ajax.set("remark",$("#startRemark").val()); |
| | | } |
| | | ajax.start(); |
| | | }; |
| | | |
| | | /** |
| | | * 司机信息导出 |
| | | */ |
| | | TDriverCommission.export=function(){ |
| | | var createTime=$("#name").val() |
| | | var phone=$("#phone").val() |
| | | var status=$("#status").val() |
| | | window.location.href=Feng.ctxPath + "/tDriver/export?name="+name |
| | | +"&status="+status |
| | | +"&phone="+phone |
| | | ; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | TDriverCommission.search = function () { |
| | | var queryData = {}; |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['phone'] = $("#phone").val(); |
| | | queryData['status'] = $("#status").val(); |
| | | TDriverCommission.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | /** |
| | | * 重置 |
| | | */ |
| | | TDriverCommission.resetSearch = function (){ |
| | | $("#name").val(''); |
| | | $("#phone").val(''); |
| | | $("#status").val(''); |
| | | TDriverCommission.search(); |
| | | } |
| | | |
| | | $(function () { |
| | | var defaultColunms = TDriverCommission.initColumn(); |
| | | var table = new BSTable(TDriverCommission.id, "/tDriver/commission/list", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TDriverCommission.table = table.init(); |
| | | }); |
| | |
| | | .set('serverStatus') |
| | | .set('integral') |
| | | .set('status') |
| | | .set('area') |
| | | .set('areaId') |
| | | .set('createTime'); |
| | | } |
| | | |
New file |
| | |
| | | /** |
| | | * 管理初始化 |
| | | */ |
| | | var TOrderRefusal = { |
| | | id: "TOrderRefusalTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TOrderRefusal.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '拒单时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '订单编号', field: 'code', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '起点地址', field: 'startAddress', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '终点地址', field: 'endAddress', visible: true, align: 'center', valign: 'middle'} |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TOrderRefusal.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TOrderRefusal.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加 |
| | | */ |
| | | TOrderRefusal.openAddTOrderRefusal = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tOrderRefusal/tOrderRefusal_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看详情 |
| | | */ |
| | | TOrderRefusal.openTOrderRefusalDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tOrderRefusal/tOrderRefusal_update/' + TOrderRefusal.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | TOrderRefusal.delete = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tOrderRefusal/delete", function (data) { |
| | | Feng.success("删除成功!"); |
| | | TOrderRefusal.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("删除失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("tOrderRefusalId",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | // TOrderRefusal.search = function () { |
| | | // var queryData = {}; |
| | | // queryData['condition'] = $("#condition").val(); |
| | | // TOrderRefusal.table.refresh({query: queryData}); |
| | | // }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TOrderRefusal.initColumn(); |
| | | var table = new BSTable(TOrderRefusal.id, "/tOrderRefusal/list", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TOrderRefusal.table = table.init(); |
| | | }); |