cloudroam
2025-03-31 6a570e438ef2565ade370d9beb73670c5cbc39fc
fix 登录
已修改6个文件
36 ■■■■■ 文件已修改
src/main/java/com/mzl/flower/config/ResourceServerConfig.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/dto/response/customer/CustomerDTO.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/mapper/customer/CustomerMapper.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/service/customer/CustomerService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/web/customer/CustomerController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/mzl/flower/config/ResourceServerConfig.java
@@ -54,6 +54,7 @@
                .antMatchers("/api/customer/flower/list").permitAll()
                .antMatchers("/api/customer/flower/list/view").permitAll()
                .antMatchers("/api/customer/flower/up/stock").permitAll()
//                .antMatchers("/api/customer/info/**").permitAll()
                .antMatchers("api/pub/customer/home/**").permitAll()
                .antMatchers("/api/customer/point/goods/**").permitAll()
                .antMatchers("/api/upload/oss/file").permitAll()
src/main/java/com/mzl/flower/dto/response/customer/CustomerDTO.java
@@ -60,4 +60,15 @@
    private UserGrowthRecordDTO userGrowthRecord;
    private Integer orderNum;
    @ApiModelProperty("会员到期时间")
    private LocalDateTime memberOvertime;
    @ApiModelProperty("会员到期日期")
    private String memberOverDate;
    @ApiModelProperty("会员/非会员")
    private Boolean isMember;
    private String contactTel;
}
src/main/java/com/mzl/flower/mapper/customer/CustomerMapper.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mzl.flower.dto.request.customer.QueryCustomerDTO;
import com.mzl.flower.dto.response.customer.CustomerDTO;
import com.mzl.flower.dto.response.supplier.SupplierDTO;
import com.mzl.flower.entity.customer.Customer;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@@ -37,4 +38,7 @@
    Boolean updateMemberLevelByPoint(@Param("levelId") Long levelId, @Param("startPoint") int startPoint, @Param("endPoint") int endPoint);
    @Select("select * from t_customer_info where  user_id  = ( select id from t_user where tel =#{phone} and type = 'customer')")
    CustomerDTO findCustomerByPhone(String phone);
}
src/main/java/com/mzl/flower/service/customer/CustomerService.java
@@ -13,6 +13,7 @@
import com.mzl.flower.dto.request.menber.UserGrowthRecordDTO;
import com.mzl.flower.dto.response.customer.CustomerDTO;
import com.mzl.flower.dto.response.partner.PartnerDTO;
import com.mzl.flower.dto.response.supplier.SupplierDTO;
import com.mzl.flower.entity.customer.Customer;
import com.mzl.flower.entity.partner.Partner;
import com.mzl.flower.enums.TrueOrFalseEnum;
@@ -28,6 +29,8 @@
import org.springframework.util.ObjectUtils;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
@Service
@@ -252,4 +255,13 @@
        return null;
    }
    public CustomerDTO findCustomerByPhone(String phone) {
        CustomerDTO customerByPhone = customerMapper.findCustomerByPhone(phone);
        if (customerByPhone != null && customerByPhone.getMemberOvertime() != null) {
            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
            customerByPhone.setMemberOverDate(customerByPhone.getMemberOvertime().format(formatter));
        }
        customerByPhone.setContactTel(phone);
        return customerByPhone;
    }
}
src/main/java/com/mzl/flower/web/customer/CustomerController.java
@@ -89,4 +89,10 @@
        customerService.isEnable(id);
        return returnData(R.SUCCESS.getCode(),null);
    }
    @GetMapping("/info/{phone}")
    @ApiOperation(value = "用户详情", notes = "用户详情")
    public ResponseEntity<ReturnDataDTO<CustomerDTO>> findCustomerByPhone(@PathVariable("phone") String phone) {
        return returnData(R.SUCCESS.getCode(),customerService.findCustomerByPhone(phone));
    }
}
src/main/resources/application.yml
@@ -1,7 +1,7 @@
server:
  port: 8080
  servlet:
    context-path: /smart_message
    context-path: /flower
spring:
  application: