| | |
| | | import com.stylefeng.guns.core.base.tips.SuccessTip; |
| | | import com.stylefeng.guns.core.exception.GunsException; |
| | | import com.stylefeng.guns.core.exception.ServiceExceptionEnum; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TAgentResp; |
| | | import com.stylefeng.guns.modular.system.controller.util.ExcelUtil; |
| | |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | public String index(Model model) { |
| | | model.addAttribute("userType", Objects.requireNonNull(ShiroKit.getUser()).getRoleType()); |
| | | return PREFIX + "tAgent.html"; |
| | | } |
| | | |
| | |
| | | values[i][7] = d.getEmergencyContact(); |
| | | values[i][8] = d.getEmergencyPhone(); |
| | | values[i][9] = String.valueOf(d.getAccountBalance()); |
| | | values[i][10] = String.valueOf(d.getUserTagId()); |
| | | values[i][10] = String.valueOf(Objects.nonNull(d.getUserTagId())?d.getUserTagId():""); |
| | | Integer status1 = d.getStatus(); |
| | | if(1 == status1){ |
| | | values[i][11] = "正常"; |
| | |
| | | * 跳转到首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | | public String index(Model model) { |
| | | model.addAttribute("userType", Objects.requireNonNull(ShiroKit.getUser()).getRoleType()); |
| | | return PREFIX + "tBranchOffice.html"; |
| | | } |
| | | |
| | |
| | | } |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | Date startTime = DateUtil.getDate_str4(split[0]); |
| | | Date endTime = DateUtil.getDate_str4(split[1]); |
| | | Date startTime = DateUtil.getDate_str3(split[0]+" 00:00:00"); |
| | | Date endTime = DateUtil.getDate_str3(split[1]+" 23:59:59"); |
| | | wrapper.between("createTime",startTime,endTime); |
| | | } |
| | | wrapper.ne("status", StatusEnum.DELETE.getCode()); |
| | |
| | | // 开始,结束时间 |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | Date startTime = DateUtil.getDate_str4(split[0]); |
| | | Date endTime = DateUtil.getDate_str4(split[1]); |
| | | Date startTime = DateUtil.getDate_str3(split[0]+" 00:00:00"); |
| | | Date endTime = DateUtil.getDate_str3(split[1]+" 23:59:59"); |
| | | wrapper.between("create_time",startTime,endTime); |
| | | } |
| | | wrapper.ne("status", StatusEnum.DELETE.getCode()); |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.base.tips.SuccessTip; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | |
| | | import com.stylefeng.guns.modular.system.model.TRechargeRecord; |
| | | import com.stylefeng.guns.modular.system.model.TRegion; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import com.stylefeng.guns.modular.system.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.Period; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | |
| | | @ResponseBody |
| | | public Object list(String createTime,String phone,Integer status) { |
| | | EntityWrapper<TDriver> wrapper = tDriverService.getPageList(createTime,phone,status); |
| | | wrapper.ne("isException",2); |
| | | wrapper.orderBy("createTime",false); |
| | | List<TDriver> tDrivers = tDriverService.selectList(wrapper); |
| | | return tDriverService.getTDriverResp(tDrivers); |
| | | List<TDriverResp> tDriverResp = tDriverService.getTDriverResp(tDrivers); |
| | | for (TDriverResp driverResp : tDriverResp) { |
| | | TDriverWork tDriverWork = tDriverWorkService.selectOne(new EntityWrapper<TDriverWork>() |
| | | .eq("driverId", driverResp.getId()) |
| | | .orderBy("workTime", false) |
| | | .last("LIMIT 1")); |
| | | if(Objects.nonNull(tDriverWork)){ |
| | | // 如果是下班状态,计算未上线天数,,如果为上班状态,则设置为0 |
| | | if(tDriverWork.getStatus() == 1){ |
| | | driverResp.setNotOnlineCount(0); |
| | | }else { |
| | | Period period = Period.between(DateUtil.dateToLocalDate(tDriverWork.getOffWorkTime()), LocalDate.now()); |
| | | driverResp.setNotOnlineCount(Math.abs(period.getDays())); |
| | | } |
| | | }else { |
| | | if(Objects.nonNull(driverResp.getApprovalTime())){ |
| | | // 没有上班记录,计算审核时间 |
| | | Period period = Period.between(DateUtil.dateToLocalDate(driverResp.getApprovalTime()), LocalDate.now()); |
| | | driverResp.setNotOnlineCount(Math.abs(period.getDays())); |
| | | }else { |
| | | driverResp.setNotOnlineCount(0); |
| | | } |
| | | } |
| | | } |
| | | return tDriverResp; |
| | | } |
| | | /** |
| | | * 获取佣金列表 |
| | |
| | | String time1 = format.format(date); |
| | | String fileName = "DriverInfo"+time1+".xls"; |
| | | String[] title = new String[] {"编号","姓名","手机号","性别","驾驶证号码","身份证号码", |
| | | "身份证","所属代理商","所属分公司","钱包余额","累计订单量","当月订单量","积分","拒单次数","状态","添加时间"}; |
| | | "身份证","所属代理商","所属分公司","钱包余额","累计订单量","当月订单量","积分","拒单次数","状态","审核状态","添加时间"}; |
| | | EntityWrapper<TDriver> wrapper = tDriverService.getPageList(createTime,phone,status); |
| | | // 是否异常 |
| | | List<TDriver> list = tDriverService.selectList(wrapper); |
| | | |
| | | List<TDriverResp> tDriverResp = tDriverService.getTDriverResp(list); |
| | | wrapper.orderBy("createTime",false); |
| | | List<TDriver> tDrivers = tDriverService.selectList(wrapper); |
| | | List<TDriverResp> tDriverResp = tDriverService.getTDriverResp(tDrivers); |
| | | |
| | | String[][] values = new String[tDriverResp.size()][]; |
| | | for (int i = 0; i < tDriverResp.size(); i++) { |
| | |
| | | }else { |
| | | values[i][14] = "删除"; |
| | | } |
| | | values[i][15] = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(d.getCreateTime()); |
| | | Integer approvalStatus = d.getApprovalStatus(); |
| | | if(1 == approvalStatus){ |
| | | values[i][15] = "待审核"; |
| | | }else if(2 == approvalStatus){ |
| | | values[i][15] = "已同意"; |
| | | }else { |
| | | values[i][15] = "已拒绝"; |
| | | } |
| | | values[i][16] = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(d.getCreateTime()); |
| | | } |
| | | HSSFWorkbook wb = ExcelUtil.getHSSFWorkbook("Variance"+time1, title, values, null); |
| | | ExcelUtil.setResponseHeader(response, fileName); |
| | |
| | | "身份证","累计订单量","当月订单量","积分","连续未上线(天)","状态","添加时间"}; |
| | | EntityWrapper<TDriver> wrapper = tDriverService.getPageList(createTime,phone,status); |
| | | wrapper.eq("isException",2); |
| | | // 是否异常 |
| | | List<TDriver> list = tDriverService.selectList(wrapper); |
| | | |
| | | List<TDriverResp> tDriverResp = tDriverService.getTDriverResp(list); |
| | | wrapper.orderBy("createTime",false); |
| | | List<TDriver> tDrivers = tDriverService.selectList(wrapper); |
| | | List<TDriverResp> tDriverResp = tDriverService.getTDriverResp(tDrivers); |
| | | for (TDriverResp driverResp : tDriverResp) { |
| | | TDriverWork tDriverWork = tDriverWorkService.selectOne(new EntityWrapper<TDriverWork>() |
| | | .eq("driverId", driverResp.getId()) |
| | | .orderBy("workTime", false) |
| | | .last("LIMIT 1")); |
| | | if(Objects.nonNull(tDriverWork)){ |
| | | // 如果是下班状态,计算未上线天数,,如果为上班状态,则设置为0 |
| | | if(tDriverWork.getStatus() == 1){ |
| | | driverResp.setNotOnlineCount(0); |
| | | }else { |
| | | Period period = Period.between(DateUtil.dateToLocalDate(tDriverWork.getOffWorkTime()), LocalDate.now()); |
| | | driverResp.setNotOnlineCount(Math.abs(period.getDays())); |
| | | } |
| | | }else { |
| | | // 没有上班记录,计算审核时间 |
| | | Period period = Period.between(DateUtil.dateToLocalDate(driverResp.getApprovalTime()), LocalDate.now()); |
| | | driverResp.setNotOnlineCount(Math.abs(period.getDays())); |
| | | } |
| | | } |
| | | |
| | | String[][] values = new String[tDriverResp.size()][]; |
| | | for (int i = 0; i < tDriverResp.size(); i++) { |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | @ApiOperation(value = "导出司机异常列表",notes="导出司机异常列表") |
| | | @ApiOperation(value = "导出司机佣金列表",notes="导出司机佣金列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | |
| | | EntityWrapper<TEdition> wrapper = new EntityWrapper<>(); |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | Date startTime = DateUtil.getDate_str4(split[0]); |
| | | Date endTime = DateUtil.getDate_str4(split[1]); |
| | | Date startTime = DateUtil.getDate_str3(split[0]+" 00:00:00"); |
| | | Date endTime = DateUtil.getDate_str3(split[1]+" 23:59:59"); |
| | | wrapper.between("createTime",startTime,endTime); |
| | | } |
| | | if(StringUtils.hasLength(editionNo)){ |
| | |
| | | } |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | Date startTime = DateUtil.getDate_str4(split[0]); |
| | | Date endTime = DateUtil.getDate_str4(split[1]); |
| | | Date startTime = DateUtil.getDate_str3(split[0]+" 00:00:00"); |
| | | Date endTime = DateUtil.getDate_str3(split[1]+" 23:59:59"); |
| | | wrapper.between("createTime",startTime,endTime); |
| | | } |
| | | wrapper.ne("status",3); |
| | |
| | | // 开始,结束时间 |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | Date startTime = DateUtil.getDate_str4(split[0]); |
| | | Date endTime = DateUtil.getDate_str4(split[1]); |
| | | Date startTime = DateUtil.getDate_str3(split[0]+" 00:00:00"); |
| | | Date endTime = DateUtil.getDate_str3(split[1]+" 23:59:59"); |
| | | wrapper.between("createTime",startTime,endTime); |
| | | } |
| | | wrapper.ne("status", StatusEnum.DELETE.getCode()); |
| | |
| | | import com.stylefeng.guns.modular.system.service.IMenuService; |
| | | import com.stylefeng.guns.modular.system.service.IUserService; |
| | | import com.stylefeng.guns.modular.system.util.AESUtils; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import org.apache.shiro.authc.SimpleAuthenticationInfo; |
| | | import org.apache.shiro.authc.UsernamePasswordToken; |
| | | import org.apache.shiro.subject.Subject; |
| | |
| | | |
| | | @Autowired |
| | | private IUserService userService; |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | private Map<String, Integer> loginFailures = new HashMap<>(); |
| | | |
| | |
| | | * 点击登录执行的动作 |
| | | */ |
| | | @RequestMapping(value = "/login", method = RequestMethod.POST) |
| | | public String loginVali(String username, String password, String remember, Model model, HttpServletRequest request) { |
| | | public String loginVali(String username, String password,String sms_code, String remember, Model model, HttpServletRequest request) { |
| | | Integer f = loginFailures.get(username); |
| | | f = f == null ? 0 : f; |
| | | // 校验账号,密码是否正确,如果错误,对次数进行加1 |
| | |
| | | return "/login.html"; |
| | | } |
| | | } |
| | | |
| | | // if(!"aaaa".equals(sms_code)){ |
| | | // String value = redisUtil.getValue(user.getPhone()); |
| | | // if(ToolUtil.isEmpty(value) || !sms_code.equals(value)){ |
| | | // model.addAttribute("tips", "无效的验证码"); |
| | | // return "/login.html"; |
| | | // } |
| | | // } |
| | | |
| | | |
| | | //验证验证码是否正确 |
| | | if (KaptchaUtil.getKaptchaOnOff()) { |
| | | String kaptcha = super.getPara("kaptcha").trim(); |
| | | String code = (String) super.getSession().getAttribute(Constants.KAPTCHA_SESSION_KEY); |
| | | if (ToolUtil.isEmpty(kaptcha) || !kaptcha.equalsIgnoreCase(code)) { |
| | | throw new InvalidKaptchaException(); |
| | | } |
| | | } |
| | | |
| | | model.addAttribute("number", "3"); |
| | | Subject currentUser = ShiroKit.getSubject(); |
| | | UsernamePasswordToken token = new UsernamePasswordToken(username, password.toCharArray()); |
| | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDate; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | List<DataStatisticsOrderYearResp> getStatisticsOrderByMonthIds(@Param("ids")List<Integer> ids, @Param("dayDate")String dayDate); |
| | | |
| | | /** |
| | | * 查询司机当月有效订单数量 |
| | | * @param driverId |
| | | * @param orderMoney |
| | | * @param month |
| | | * @return |
| | | */ |
| | | Integer getValidOrderCount(@Param("driverId") Integer driverId,@Param("orderMoney") BigDecimal orderMoney, @Param("month")String month); |
| | | } |
| | |
| | | </where> |
| | | GROUP BY `month` |
| | | </select> |
| | | <select id="getValidOrderCount" resultType="java.lang.Integer"> |
| | | select count(id) |
| | | from t_order |
| | | <where> |
| | | <if test="driverId != null"> |
| | | AND driverId = #{driverId} |
| | | </if> |
| | | <if test="orderMoney != null"> |
| | | AND orderMoney > #{orderMoney} |
| | | </if> |
| | | <if test="month != null"> |
| | | AND DATE_FORMAT(createTime, '%Y-%m') = #{month} |
| | | </if> |
| | | AND (`state` = 107 OR `state` = 108 OR `state` = 109) |
| | | </where> |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import org.springframework.ui.Model; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | * @param map |
| | | */ |
| | | void getStatisticsOrderByMonthIds(List<Integer> ids, String dayDate, Model model, Map<String, Object> map); |
| | | |
| | | /** |
| | | * 查询司机当月有效订单数量 |
| | | * @param driverId |
| | | * @param orderMoney |
| | | * @param month |
| | | * @return |
| | | */ |
| | | Integer getValidOrderCount(Integer driverId, BigDecimal orderMoney, String month); |
| | | } |
| | |
| | | // 开始,结束时间 |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | Date startTime = DateUtil.getDate_str4(split[0]); |
| | | Date endTime = DateUtil.getDate_str4(split[1]); |
| | | Date startTime = DateUtil.getDate_str3(split[0]+" 00:00:00"); |
| | | Date endTime = DateUtil.getDate_str3(split[1]+" 23:59:59"); |
| | | wrapper.between("createTime",startTime,endTime); |
| | | } |
| | | // 判断是否为代理商 |
| | |
| | | // 开始,结束时间 |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | Date startTime = DateUtil.getDate_str4(split[0]); |
| | | Date endTime = DateUtil.getDate_str4(split[1]); |
| | | Date startTime = DateUtil.getDate_str3(split[0]+" 00:00:00"); |
| | | Date endTime = DateUtil.getDate_str3(split[1]+" 23:59:59"); |
| | | wrapper.between("createtime",startTime,endTime); |
| | | } |
| | | // if(Objects.nonNull(startTime) && Objects.nonNull(endTime)){ |
| | |
| | | // 开始,结束时间 |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | startTime = split[0]; |
| | | endTime = split[1]; |
| | | startTime = split[0]+" 00:00:00"; |
| | | endTime = split[1] + " 23:59:59"; |
| | | } |
| | | Integer roleType = Objects.requireNonNull(ShiroKit.getUser()).getRoleType(); |
| | | Integer objectId = Objects.requireNonNull(ShiroKit.getUser()).getObjectId(); |
| | |
| | | // 开始,结束时间 |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | startTime = split[0]; |
| | | endTime = split[1]; |
| | | startTime = split[0] + " 00:00:00"; |
| | | endTime = split[1] + " 23:59:59"; |
| | | } |
| | | Integer roleType = Objects.requireNonNull(ShiroKit.getUser()).getRoleType(); |
| | | Integer objectId = Objects.requireNonNull(ShiroKit.getUser()).getObjectId(); |
| | |
| | | // 开始,结束时间 |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | Date startTime = DateUtil.getDate_str4(split[0]); |
| | | Date endTime = DateUtil.getDate_str4(split[1]); |
| | | Date startTime = DateUtil.getDate_str3(split[0]+" 00:00:00"); |
| | | Date endTime = DateUtil.getDate_str3(split[1]+" 23:59:59"); |
| | | wrapper.between("createTime",startTime,endTime); |
| | | } |
| | | wrapper.orderBy(true,"approvalStatus"); |
| | |
| | | // 开始,结束时间 |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | startTime = split[0]; |
| | | endTime = split[1]; |
| | | startTime = split[0] + " 00:00:00"; |
| | | endTime = split[1] + " 23:59:59"; |
| | | } |
| | | List<TEvaluateResp> list = tEvaluateMapper.selectPageList(startTime, endTime, userName, driverName, orderType, score); |
| | | Integer roleType = Objects.requireNonNull(ShiroKit.getUser()).getRoleType(); |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.modular.system.controller.resp.DataStatisticsOrderYearResp; |
| | | import com.stylefeng.guns.modular.system.controller.resp.PerformanceTableResp; |
| | |
| | | import com.stylefeng.guns.modular.system.dao.TAppUserMapper; |
| | | import com.stylefeng.guns.modular.system.dao.TBranchOfficeMapper; |
| | | import com.stylefeng.guns.modular.system.dao.TDriverMapper; |
| | | import com.stylefeng.guns.modular.system.dao.TOrderMapper; |
| | | import com.stylefeng.guns.modular.system.enums.OrderStateEnum; |
| | | import com.stylefeng.guns.modular.system.model.TAppUser; |
| | | import com.stylefeng.guns.modular.system.model.TBranchOffice; |
| | | import com.stylefeng.guns.modular.system.model.TDriver; |
| | | import com.stylefeng.guns.modular.system.model.TOrder; |
| | | import com.stylefeng.guns.modular.system.dao.TOrderMapper; |
| | | import com.stylefeng.guns.modular.system.service.ITOrderService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.stylefeng.guns.modular.system.util.DateUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | // 开始,结束时间 |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | startTime = split[0]; |
| | | endTime = split[1]; |
| | | startTime = split[0] + " 00:00:00"; |
| | | endTime = split[1] + " 23:59:59"; |
| | | } |
| | | Integer roleType = Objects.requireNonNull(ShiroKit.getUser()).getRoleType(); |
| | | Integer objectId = Objects.requireNonNull(ShiroKit.getUser()).getObjectId(); |
| | |
| | | model.addAttribute("monthResp",resps); |
| | | map.put("monthResp",resps); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Integer getValidOrderCount(Integer driverId, BigDecimal orderMoney, String month) { |
| | | // 查询司机当月有效订单数量 |
| | | return tOrderMapper.getValidOrderCount(driverId,orderMoney,month); |
| | | } |
| | | } |
| | |
| | | // 开始,结束时间 |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | startTime = split[0]; |
| | | endTime = split[1]; |
| | | startTime = split[0] + " 00:00:00"; |
| | | endTime = split[1] + " 23:59:59"; |
| | | } |
| | | Integer roleType = Objects.requireNonNull(ShiroKit.getUser()).getRoleType(); |
| | | Integer objectId = Objects.requireNonNull(ShiroKit.getUser()).getObjectId(); |
| | |
| | | // 开始,结束时间 |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | startTime = split[0]; |
| | | endTime = split[1]; |
| | | startTime = split[0] + " 00:00:00"; |
| | | endTime = split[1] + " 23:59:59"; |
| | | } |
| | | Integer roleType = Objects.requireNonNull(ShiroKit.getUser()).getRoleType(); |
| | | Integer objectId = Objects.requireNonNull(ShiroKit.getUser()).getObjectId(); |
| | |
| | | // 开始,结束时间 |
| | | if(StringUtils.hasLength(businessTime)){ |
| | | String[] split = businessTime.split(" - "); |
| | | startTime = split[0]; |
| | | endTime = split[1]; |
| | | startTime = split[0] + " 00:00:00"; |
| | | endTime = split[1] + " 23:59:59"; |
| | | } |
| | | Integer roleType = Objects.requireNonNull(ShiroKit.getUser()).getRoleType(); |
| | | Integer objectId = Objects.requireNonNull(ShiroKit.getUser()).getObjectId(); |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.modular.system.enums.UserTypeEnum; |
| | | import com.stylefeng.guns.modular.system.model.TAppUser; |
| | | import com.stylefeng.guns.modular.system.model.TDriver; |
| | | import com.stylefeng.guns.modular.system.service.ITDriverService; |
| | | import com.stylefeng.guns.modular.system.service.ITLocationService; |
| | | import com.stylefeng.guns.modular.system.service.IUserCouponRecordService; |
| | | import com.stylefeng.guns.modular.system.model.TDriverWork; |
| | | import com.stylefeng.guns.modular.system.model.TOrder; |
| | | import com.stylefeng.guns.modular.system.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.Period; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private ITLocationService locationService; |
| | | |
| | | @Autowired |
| | | private ITDriverService driverService; |
| | | @Autowired |
| | | private ITAppUserService appUserService; |
| | | @Autowired |
| | | private ITOrderService orderService; |
| | | @Autowired |
| | | private ITDriverWorkService tDriverWorkService; |
| | | |
| | | |
| | | |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 每半天检测用户是否有异常 |
| | | */ |
| | | @Scheduled(cron = "0 0 0,12 * * ? ") |
| | | public void queryUserIsException(){ |
| | | try { |
| | | List<TAppUser> appUserList = appUserService.selectList(new EntityWrapper<TAppUser>().ne("status", 3)); |
| | | for (TAppUser tAppUser : appUserList) { |
| | | TOrder tOrder = orderService.selectOne(new EntityWrapper<TOrder>() |
| | | .eq("userId", tAppUser.getId()) |
| | | .last("LIMIT 1")); |
| | | // 客户一个月未下单,状态异常 |
| | | Period period = Period.between(DateUtil.dateToLocalDate(tOrder.getCreateTime()), LocalDate.now()); |
| | | int day = Math.abs(period.getDays()); |
| | | if(day > 29){ |
| | | tAppUser.setIsException(2); |
| | | } |
| | | } |
| | | appUserService.updateBatchById(appUserList); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 每半天检测司机是否有异常 |
| | | */ |
| | | @Scheduled(cron = "0 0 9,21 * * ? ") |
| | | public void queryDriverIsException(){ |
| | | try { |
| | | List<TDriver> driverList = driverService.selectList(new EntityWrapper<TDriver>().ne("status", 3)); |
| | | for (TDriver driver : driverList) { |
| | | // 15天未上线异常,当月有效订单低于30单,异常 |
| | | Integer count = orderService.getValidOrderCount(driver.getId(),new BigDecimal(14),new SimpleDateFormat("yyyy-MM").format(new Date())); |
| | | if(count < 30){ |
| | | driver.setIsException(2); |
| | | } |
| | | TDriverWork tDriverWork = tDriverWorkService.selectOne(new EntityWrapper<TDriverWork>() |
| | | .eq("driverId", driver.getId()) |
| | | .orderBy("workTime", false) |
| | | .last("LIMIT 1")); |
| | | if(Objects.nonNull(tDriverWork)){ |
| | | // 如果是下班状态,计算未上线天数,,如果为上班状态,则设置为0 |
| | | if(tDriverWork.getStatus() == 2){ |
| | | Period period = Period.between(DateUtil.dateToLocalDate(tDriverWork.getOffWorkTime()), LocalDate.now()); |
| | | int day = Math.abs(period.getDays()); |
| | | if(day>14){ |
| | | driver.setIsException(2); |
| | | } |
| | | } |
| | | }else { |
| | | // 没有上班记录,计算审核时间 |
| | | Period period = Period.between(DateUtil.dateToLocalDate(driver.getApprovalTime()), LocalDate.now()); |
| | | int day = Math.abs(period.getDays()); |
| | | if(day>14){ |
| | | driver.setIsException(2); |
| | | } |
| | | } |
| | | } |
| | | driverService.updateBatchById(driverList); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | <iframe class="J_iframe" name="iframe0" width="100%" height="100%" src="${ctxPath}/blackboard?type=${type}" frameborder="0" data-id="${ctxPath}/blackboard" seamless></iframe> |
| | | </div> |
| | | <div class="footer"> |
| | | <div class="pull-right">© 2019-2021 <a href="#" onclick="return false" target="_blank">超省新代驾</a> |
| | | <div class="pull-right">© 2023 <a href="#" onclick="return false" target="_blank">超省新代驾</a> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <form class="m-t" role="form" action="${ctxPath}/login" method="post"> |
| | | <div class="item"> |
| | | <img src="${ctxPath}/static/img/account.png" /> |
| | | <input hidden id="number" value="${number}"> |
| | | <input class="itemInput" type="text" name="username" id="username" placeholder="请输入您的账号" required="" value=""> |
| | | </div> |
| | | <div class="item"> |
| | |
| | | @if(kaptcha.getKaptchaOnOff() == true){ |
| | | <div class="form-group" style="float: left;"> |
| | | <div class="col-sm-8" style="padding-left: 0px; padding-right: 0px;"> |
| | | <input class="form-control" type="text" name="kaptcha" id="verifyNumber" placeholder="验证码" > |
| | | <input class="form-control" type="text" name="kaptcha" id="verifyNumber" placeholder="验证码" required> |
| | | </div> |
| | | <div class="col-sm-4" style="padding-left: 0px; padding-right: 0px;"> |
| | | <img src="${ctxPath}/kaptcha" id="kaptcha" width="100%" height="100%"/> |
| | |
| | | <script src="${ctxPath}/static/crypto-js/crypto-js.js"></script> |
| | | <script> |
| | | $(function () { |
| | | if($("#number").val()==5){ |
| | | document.getElementById("verifyNumber").setAttribute("required","") |
| | | $("#verify").show() |
| | | }else { |
| | | $("#number").val(0) |
| | | $("#verify").hide() |
| | | } |
| | | // if($("#number").val()==5){ |
| | | // document.getElementById("verifyNumber").setAttribute("required","") |
| | | // $("#verify").show() |
| | | // }else { |
| | | // $("#number").val(0) |
| | | // $("#verify").hide() |
| | | // } |
| | | $("#verify").show() |
| | | |
| | | $("#kaptcha").on('click', function () { |
| | | $("#kaptcha").attr('src', '${ctxPath}/kaptcha?' + Math.floor(Math.random() * 100)).fadeIn(); |
| | |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <input hidden id="userType" value="${userType}"> |
| | | <div class="col-sm-2"> |
| | | <#NameCon id="principal" name="姓名" /> |
| | | </div> |
| | |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <input hidden id="userType" value="${userType}"> |
| | | <div class="col-sm-2"> |
| | | <#NameCon id="branchOfficeName" name="分公司名称" /> |
| | | </div> |
| | |
| | | $("#homePageBanner").hide() |
| | | } |
| | | }) |
| | | //监听下拉菜单的变动操作 |
| | | $("#jumpType").change(function(){ |
| | | if(this.value == 1){ |
| | | $("#jumpUrlIsShow").hide() |
| | | } |
| | | if(this.value == 2){ |
| | | $("#jumpUrlIsShow").show() |
| | | } |
| | | }) |
| | | </script> |
| | | @} |
| | |
| | | $("#homePageBanner").hide() |
| | | } |
| | | }) |
| | | //监听下拉菜单的变动操作 |
| | | $("#jumpType").change(function(){ |
| | | if(this.value == 1){ |
| | | $("#jumpUrlIsShow").hide() |
| | | } |
| | | if(this.value == 2){ |
| | | $("#jumpUrlIsShow").show() |
| | | } |
| | | }) |
| | | </script> |
| | | @} |
| | |
| | | <div class="initialLevel col-sm-12 control-label form-group" id="coupon1" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label">优惠券限制数量:</label> |
| | | <input id="couponCount" name="couponCount" type="number" min="0" maxlength="4" placeholder="最多4位数字" style="height: 30px" required> |
| | | <input id="couponCount" name="couponCount1" type="number" min="0" maxlength="4" placeholder="最多4位数字" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label">优惠券限制数量:</label> |
| | | <input id="couponCount" name="couponCount" type="number" min="0" maxlength="4" placeholder="最多4位数字" style="height: 30px" required> |
| | | <input id="couponCount" name="couponCount2" type="number" min="1" maxlength="4" placeholder="最多4位数字" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="phone" 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 class="col-sm-2"> |
| | | <#SelectCon id="status" name="状态" > |
| | | <option value="">状态</option> |
| | | <option value="1">正常</option> |
| | | <option value="2">冻结</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="查询" icon="fa-search" clickFun="TDriverException.search()"/> |
| | |
| | | M.forEach(function(marker) { |
| | | new AMap.Marker({ |
| | | map: map, |
| | | icon: marker[2]==301?'//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-1.png':((marker[2]==109||marker[2]==107||marker[2]==108)?'//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-2.png': |
| | | icon: marker[2]==301?'//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-1.png':((marker[2]==109||marker[2]==107||marker[2]==108)?'https://csxdj.obs.cn-south-1.myhuaweicloud.com/c1d2f38187de40daa353fcc70993288e.png': |
| | | (marker[2]==101?'//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-3.png':'//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-4.png') |
| | | ), |
| | | position: [marker[0], marker[1]], |
| | |
| | | M.forEach(function(marker) { |
| | | new AMap.Marker({ |
| | | map: map, |
| | | icon: marker[2]==1?'//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-5.png':'//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-6.png', |
| | | icon: 'https://csxdj.obs.cn-south-1.myhuaweicloud.com/c1d2f38187de40daa353fcc70993288e.png', |
| | | position: [marker[0], marker[1]], |
| | | offset: new AMap.Pixel(-13, -30) |
| | | }); |
| | |
| | | * 删除 |
| | | */ |
| | | TBranchOffice.delete = function (id) { |
| | | |
| | | var userType = $('#userType').val() |
| | | if(userType == 2){ |
| | | Feng.error("无权删除分公司!") |
| | | return; |
| | | } |
| | | |
| | | var ajax = new $ax(Feng.ctxPath + "/tBranchOffice/delete", function (data) { |
| | | Feng.success("删除成功!"); |
| | | TBranchOffice.table.refresh(); |
| | |
| | | {title: '投诉时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '投诉人昵称', field: 'userName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '投诉人电话', field: 'userPhone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '投诉司机电话', field: 'driverPhone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '投诉原因', field: 'reason', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '备注', field: 'notes', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '处理状态', field: 'state', visible: true, align: 'center', valign: 'middle', |
| | |
| | | return; |
| | | } |
| | | |
| | | var couponCount = $('#couponCount').val(); |
| | | var couponType = $('#couponType').val(); |
| | | if(couponType == 2 && (couponCount == null || couponCount == '')){ |
| | | if(couponType == 2 && ($("input[name=couponCount2]").val() == null || $("input[name=couponCount2]").val() == '')){ |
| | | Feng.info("请填写优惠券限制数量!") |
| | | return; |
| | | } |
| | | |
| | | // if(couponType == 2 && $("input[name=couponCount2]").val() < 1){ |
| | | // Feng.info("新人优惠券限制数量必须大于0!") |
| | | // return; |
| | | // } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCoupon/add", function(data){ |
| | | if(500 == data.code){ |