| | |
| | | */ |
| | | @GetMapping("/getOrderPage") |
| | | @ApiOperation(value = "获取相关信息",tags = "app用户端-下单页面") |
| | | public R<OrderPageVO> getOrderPage(@RequestParam(value = "communityId",required = false) Integer communityId) { |
| | | return R.ok(appUserService.getOrderPage(communityId)); |
| | | public R<OrderPageVO> getOrderPage(@RequestParam(value = "communityId",required = false) Integer communityId , |
| | | @RequestParam(value = "regionExtend",required = false) String regionExtend) { |
| | | return R.ok(appUserService.getOrderPage(communityId,regionExtend)); |
| | | } |
| | | |
| | | /** |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.core.context.SecurityContextHolder; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.ruoyi.common.constant.Constants; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysMenu; |
| | |
| | | */ |
| | | @Api(value = "登录控制器",tags = "登录控制器") |
| | | @RestController |
| | | @RequestMapping("/system") |
| | | public class SysLoginController { |
| | | |
| | | @Autowired |
| | |
| | | druid: |
| | | # 主库数据源 |
| | | master: |
| | | url: jdbc:mysql://127.0.0.1:3306/paotui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | url: jdbc:mysql://47.109.140.106:3306/paotui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: 123456 |
| | | password: weier0306 |
| | | # 从库数据源 |
| | | slave: |
| | | # 从数据源开关/默认关闭 |
| | |
| | | # redis 配置 |
| | | redis: |
| | | # 地址 |
| | | host: 127.0.0.1 |
| | | # host: 127.0.0.1 |
| | | host: 47.109.140.106 |
| | | # 端口,默认为6379 |
| | | port: 6379 |
| | | # 数据库索引 |
| | | database: 0 |
| | | # 密码 |
| | | password: 123456 |
| | | password: weier0306 |
| | | # 连接超时时间 |
| | | timeout: 10s |
| | | jedis: |
| | |
| | | appletsAppSecret: e1a8dba539294da6b935e8f0f3b09aac |
| | | mchId: 1719862902 |
| | | key: 5Kb8zX9qR2TdF7Yw3vHnJgLp6sA4cE1M |
| | | callbackPath: http://221.182.45.100:8086 |
| | | callbackPath: http://47.109.140.106:8080 |
| | | certPath: classpath:cert/apiclient_cert.p12 |
| | | RASPath: |
| | | ali: |
| | |
| | | package com.ruoyi.errand.object.vo.app; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | |
| | | @ApiModel("用户个人中心信息") |
| | |
| | | @ApiModelProperty("头像") |
| | | private String avatar; |
| | | |
| | | @ApiModelProperty("是否跑腿员") |
| | | private Boolean isCourier; |
| | | |
| | | @ApiModelProperty(value = "是否跑腿员",hidden = true) |
| | | private Integer courierId; |
| | | |
| | | @ApiModelProperty("用户") |
| | | private String name; |
| | | |
| | |
| | | @TableField("name") |
| | | private String name; |
| | | @ApiModelProperty("图片地址") |
| | | private String image_url; |
| | | private String imageUrl; |
| | | } |
| | |
| | | |
| | | LoginVO register(RegisterDTO registerDTO); |
| | | |
| | | OrderPageVO getOrderPage( Integer communityId); |
| | | OrderPageVO getOrderPage( Integer communityId,String regionExtend); |
| | | |
| | | AppUserInfoVO getMyInfo(); |
| | | |
| | |
| | | loginVO.setFailureTime(TimeUnit.MILLISECONDS.toSeconds((long)jwt.get("exp"))); |
| | | loginVO.setPhone(appUser.getPhone()); |
| | | loginVO.setSkipPage(1); |
| | | loginVO.setIsCourier(appUser.getCourierId()!=null); |
| | | loginVO.setIsCourier(false); |
| | | if (appUser.getCourierId()!=null){ |
| | | Courier courier = courierMapper.selectById(appUser.getCourierId()); |
| | | if (courier!=null && courier.getDelFlag().equals(0) && courier.getStatus().equals(1)){ |
| | | loginVO.setIsCourier(true); |
| | | } |
| | | } |
| | | return R.ok(loginVO); |
| | | } |
| | | |
| | |
| | | loginVO.setFailureTime(TimeUnit.MILLISECONDS.toSeconds((long)jwt.get("exp"))); |
| | | loginVO.setPhone(appUser.getPhone()); |
| | | loginVO.setSkipPage(1); |
| | | loginVO.setIsCourier(appUser.getCourierId()!=null); |
| | | loginVO.setIsCourier(false); |
| | | if (appUser.getCourierId()!=null){ |
| | | Courier courier = courierMapper.selectById(appUser.getCourierId()); |
| | | if (courier!=null && courier.getDelFlag().equals(0) && courier.getStatus().equals(1)){ |
| | | loginVO.setIsCourier(true); |
| | | } |
| | | } |
| | | |
| | | |
| | | return R.ok(loginVO); |
| | | } |
| | | |
| | |
| | | loginVO.setFailureTime(TimeUnit.MILLISECONDS.toSeconds((long)jwt.get("exp"))); |
| | | loginVO.setPhone(appUser2.getPhone()); |
| | | loginVO.setSkipPage(1); |
| | | loginVO.setIsCourier(appUser2.getCourierId()!=null); |
| | | |
| | | loginVO.setIsCourier(false); |
| | | if (appUser2.getCourierId()!=null){ |
| | | Courier courier = courierMapper.selectById(appUser2.getCourierId()); |
| | | if (courier!=null && courier.getDelFlag().equals(0) && courier.getStatus().equals(1)){ |
| | | loginVO.setIsCourier(true); |
| | | } |
| | | } |
| | | return loginVO; |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public OrderPageVO getOrderPage(Integer communityId) { |
| | | public OrderPageVO getOrderPage(Integer communityId,String regionExtend) { |
| | | AppUser appUser = (AppUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); |
| | | //更换绑定的小区 |
| | | if (communityId!=null&& !Objects.equals(appUser.getCommunityId(), communityId)){ |
| | | appUser.setCommunityId(communityId); |
| | | this.updateById(appUser); |
| | | } |
| | | if (regionExtend!=null&& !Objects.equals(appUser.getRegionExtend(), regionExtend)){ |
| | | appUser.setRegionExtend(regionExtend); |
| | | this.updateById(appUser); |
| | | } |
| | | List<OrderPageVO> orderPage = this.getBaseMapper().getOrderPage(appUser.getId()); |
| | |
| | | public AppUserInfoVO getMyInfo() { |
| | | AppUser appUser = (AppUser) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); |
| | | AppUserInfoVO myInfo = this.getBaseMapper().getMyInfo(appUser.getId()); |
| | | |
| | | myInfo.setIsCourier(false); |
| | | if (myInfo.getCourierId()!=null){ |
| | | Courier courier = courierMapper.selectById(myInfo.getCourierId()); |
| | | if (courier!=null && courier.getDelFlag().equals(0) && courier.getStatus().equals(1)){ |
| | | myInfo.setIsCourier(true); |
| | | } |
| | | } |
| | | myInfo.setEndTimeStamp(myInfo.getEndTime() != null ? |
| | | myInfo.getEndTime().atZone(ZoneId.systemDefault()).toInstant().toEpochMilli() : |
| | | null); |
| | |
| | | Map<String,Object> courier= appUserMapper.getCourierByCommunityId(order.getCommunityId()); |
| | | if (courier == null || courier.isEmpty() ||null == courier.get("id") ) { |
| | | log.warn("未找到社区ID={}对应的骑手", order.getCommunityId()); |
| | | return R.ok(); |
| | | return R.ok(order.getId()); |
| | | } |
| | | if (courier.get("status").equals("0")){ |
| | | log.warn("当前社区骑手离职中,骑手id={}", courier.get("courierId")); |
| | | return R.ok(); |
| | | return R.ok(order.getId()); |
| | | } |
| | | Integer courierIdLong = (Integer) courier.get("courierId"); |
| | | order.setCourierId(courierIdLong); |
| | |
| | | //小程序弹窗通知 |
| | | notifyDeliveryPerson((Long) courier.get("id"), order,1);//1=新订单 |
| | | |
| | | //登录访问 |
| | | return R.ok(order.getId().toString()); |
| | | return R.ok(order.getId()); |
| | | } |
| | | |
| | | |
| | |
| | | <select id="getMyInfo" resultType="com.ruoyi.errand.object.vo.app.AppUserInfoVO"> |
| | | select |
| | | tau.avatar, |
| | | tau.courier_id, |
| | | tau.name, |
| | | tau.phone, |
| | | tau.sex, |
| | |
| | | WHERE create_time BETWEEN #{start} AND #{end} |
| | | and del_flag=0 and status !=3 |
| | | GROUP BY |
| | | CASE #{datePattern} |
| | | WHEN 'HH时' THEN DATE_FORMAT(create_time, '%H时') |
| | | WHEN 'EEEE' THEN ELT(DAYOFWEEK(create_time), '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六') |
| | | WHEN 'dd日' THEN DATE_FORMAT(create_time, '%d日') |
| | | WHEN 'MM月' THEN DATE_FORMAT(create_time, '%m月') |
| | | WHEN 'yyyy-MM-dd' THEN DATE_FORMAT(create_time, '%Y-%m-%d') |
| | | ELSE DATE_FORMAT(create_time, '%Y-%m-%d') |
| | | END |
| | | ORDER BY create_time |
| | | `date` |
| | | ORDER BY `date` |
| | | </select> |
| | | <select id="getCourierByCommunityId" resultType="java.util.Map"> |
| | | select |
| | |
| | | and community_id =#{communityId} |
| | | </if> |
| | | GROUP BY |
| | | CASE #{datePattern} |
| | | WHEN 'HH时' THEN DATE_FORMAT(order_time, '%H时') |
| | | WHEN 'EEEE' THEN ELT(DAYOFWEEK(order_time), '星期日', '星期一', '星期二', '星期三', '星期四', '星期五', '星期六') |
| | | WHEN 'dd日' THEN DATE_FORMAT(order_time, '%d日') |
| | | WHEN 'MM月' THEN DATE_FORMAT(order_time, '%m月') |
| | | WHEN 'yyyy-MM-dd' THEN DATE_FORMAT(order_time, '%Y-%m-%d') |
| | | ELSE DATE_FORMAT(order_time, '%Y-%m-%d') |
| | | END |
| | | ORDER BY order_time |
| | | `date` |
| | | ORDER BY `date` |
| | | </select> |
| | | |
| | | <select id="selectPageTotal" resultType="java.lang.Long"> |
| | |
| | | .authorizeHttpRequests((requests) -> { |
| | | permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll()); |
| | | // 对于登录login 注册register 验证码captchaImage 允许匿名访问 |
| | | requests.antMatchers("/login", "/register", "/captchaImage","/screen/data","/common/upload","/system/user/profile/updatePwd").permitAll() |
| | | requests.antMatchers("/system/login", "/register", "/captchaImage","/screen/data","/common/upload","/system/user/profile/updatePwd").permitAll() |
| | | // 静态资源,可匿名访问 |
| | | .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() |
| | | .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**","/swagger-ui/").permitAll() |