huliguo
6 天以前 adac148db7cefc6848933989d407b1827749a5a6
bug修改
13个文件已修改
108 ■■■■■ 已修改文件
pt-admin/src/main/java/com/ruoyi/web/controller/errand/AppUserController.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pt-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pt-admin/src/main/resources/application-druid.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pt-admin/src/main/resources/application.yml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pt-errand/src/main/java/com/ruoyi/errand/object/vo/app/AppUserInfoVO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pt-errand/src/main/java/com/ruoyi/errand/object/vo/app/BannerVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pt-errand/src/main/java/com/ruoyi/errand/service/AppUserService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pt-errand/src/main/java/com/ruoyi/errand/service/impl/AppUserServiceImpl.java 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pt-errand/src/main/java/com/ruoyi/errand/service/impl/OrderServiceImpl.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pt-errand/src/main/java/com/ruoyi/errand/utils/DeliveryWebSocket.java 补丁 | 查看 | 原始文档 | blame | 历史
pt-errand/src/main/resources/mapper/AppUserMapper.xml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pt-errand/src/main/resources/mapper/OrderMapper.xml 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pt-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pt-admin/src/main/java/com/ruoyi/web/controller/errand/AppUserController.java
@@ -105,8 +105,9 @@
     */
    @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));
    }
    /**
pt-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
@@ -11,10 +11,7 @@
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;
@@ -36,6 +33,7 @@
 */
@Api(value = "登录控制器",tags = "登录控制器")
@RestController
@RequestMapping("/system")
public class SysLoginController {
    @Autowired
pt-admin/src/main/resources/application-druid.yml
@@ -6,9 +6,9 @@
        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:
                # 从数据源开关/默认关闭
pt-admin/src/main/resources/application.yml
@@ -68,13 +68,14 @@
  # 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:
@@ -149,7 +150,7 @@
  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:
pt-errand/src/main/java/com/ruoyi/errand/object/vo/app/AppUserInfoVO.java
@@ -1,13 +1,10 @@
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("用户个人中心信息")
@@ -16,6 +13,12 @@
    @ApiModelProperty("头像")
    private String avatar;
    @ApiModelProperty("是否跑腿员")
    private Boolean isCourier;
    @ApiModelProperty(value = "是否跑腿员",hidden = true)
    private Integer courierId;
    @ApiModelProperty("用户")
    private String name;
pt-errand/src/main/java/com/ruoyi/errand/object/vo/app/BannerVO.java
@@ -13,5 +13,5 @@
    @TableField("name")
    private String name;
    @ApiModelProperty("图片地址")
    private String image_url;
    private String imageUrl;
}
pt-errand/src/main/java/com/ruoyi/errand/service/AppUserService.java
@@ -32,7 +32,7 @@
    LoginVO register(RegisterDTO registerDTO);
    OrderPageVO getOrderPage( Integer communityId);
    OrderPageVO getOrderPage( Integer communityId,String regionExtend);
    AppUserInfoVO getMyInfo();
pt-errand/src/main/java/com/ruoyi/errand/service/impl/AppUserServiceImpl.java
@@ -159,7 +159,13 @@
        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);
    }
@@ -207,7 +213,15 @@
        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);
    }
@@ -257,17 +271,28 @@
        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());
@@ -304,7 +329,13 @@
    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);
pt-errand/src/main/java/com/ruoyi/errand/service/impl/OrderServiceImpl.java
@@ -223,11 +223,11 @@
        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);
@@ -236,8 +236,7 @@
        //小程序弹窗通知
        notifyDeliveryPerson((Long) courier.get("id"), order,1);//1=新订单
        //登录访问
        return R.ok(order.getId().toString());
        return R.ok(order.getId());
    }
pt-errand/src/main/java/com/ruoyi/errand/utils/DeliveryWebSocket.java
pt-errand/src/main/resources/mapper/AppUserMapper.xml
@@ -40,6 +40,7 @@
    <select id="getMyInfo" resultType="com.ruoyi.errand.object.vo.app.AppUserInfoVO">
        select
            tau.avatar,
            tau.courier_id,
            tau.name,
            tau.phone,
            tau.sex,
@@ -81,15 +82,8 @@
        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
pt-errand/src/main/resources/mapper/OrderMapper.xml
@@ -101,15 +101,8 @@
            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">
pt-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
@@ -119,7 +119,7 @@
            .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()