修复企业认证部分bug
parent
8697754df8
commit
e8f33f6d10
|
@ -0,0 +1,45 @@
|
|||
package com.muyu.cloud.market.domin.resp;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Author:weiran
|
||||
* @Package:com.muyu.cloud.market.domin.resp
|
||||
* @Project:cloud-market
|
||||
* @name:Chosehowpay
|
||||
* @Date:2024/9/1 14:17
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Tag(name = "产品规格", description = "返回产品规格")
|
||||
public class ChosehowpayResp {
|
||||
/**
|
||||
* 产品Id
|
||||
*/
|
||||
private Integer productId;
|
||||
/**
|
||||
* 产品名称
|
||||
*/
|
||||
private String productName;
|
||||
/**
|
||||
* 产品规格Id
|
||||
*/
|
||||
private Integer productSpecificationId;
|
||||
/**
|
||||
* 产品规格类型
|
||||
*/
|
||||
private String productSpecificationName;
|
||||
/***
|
||||
* 对应价格
|
||||
*/
|
||||
private BigDecimal middlePrice;
|
||||
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
package com.muyu.cloud.market.controller;
|
||||
import com.muyu.cloud.market.domin.User;
|
||||
import com.muyu.cloud.market.domin.req.CompanyListReq;
|
||||
import com.muyu.cloud.market.service.CompanyService;
|
||||
import com.muyu.cloud.market.util.OssUtil;
|
||||
|
@ -59,6 +60,21 @@ public class CompanyController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断是否进行了企业绑定
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/ifcompanyauthentication")
|
||||
@Operation(summary = "是否企业绑定了",description = "是否企业绑定了")
|
||||
public Result ifcompanyauthentication(){
|
||||
User user = companyService.ifcompanyauthentication();
|
||||
if (user.getIsCompanyid()==0 || user.getIsCompanyid()==null){
|
||||
return Result.error("请先进行企业绑定");
|
||||
}
|
||||
return Result.success(null,"绑定成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.muyu.cloud.market.domin.Product;
|
|||
import com.muyu.cloud.market.domin.req.ProductAddReq;
|
||||
import com.muyu.cloud.market.domin.req.ProductListReq;
|
||||
import com.muyu.cloud.market.domin.req.ProductUpdReq;
|
||||
import com.muyu.cloud.market.domin.resp.ChosehowpayResp;
|
||||
import com.muyu.cloud.market.domin.resp.ProductListResp;
|
||||
import com.muyu.cloud.market.domin.resp.ProductTotalListResp;
|
||||
import com.muyu.cloud.market.service.ProductApiService;
|
||||
|
@ -112,6 +113,15 @@ public class ProductApiController {
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 产品的支付规格及对应的价格
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/specification")
|
||||
@Operation(summary = "产品规格",description = "查询产品的支付规格及对应的价格")
|
||||
public Result selectspecification(@Validated @RequestBody ChosehowpayResp chosehowpayResp){
|
||||
return Result.success(productApiService.selectspecification(chosehowpayResp));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.cloud.market.mapper;
|
|||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.cloud.market.domin.Product;
|
||||
import com.muyu.cloud.market.domin.resp.ChosehowpayResp;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
|
@ -19,4 +20,11 @@ public interface ProductApiMapper extends BaseMapper<Product> {
|
|||
|
||||
@Select("SELECT product_type FROM product GROUP BY product_type")
|
||||
List<String> selectDistinctProductTypes();
|
||||
|
||||
/**
|
||||
* 产品的支付规格及对应的价格
|
||||
* @return
|
||||
*/
|
||||
List<ChosehowpayResp> selectspecification(ChosehowpayResp chosehowpayResp);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.cloud.market.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.cloud.market.domin.Company;
|
||||
import com.muyu.cloud.market.domin.User;
|
||||
import com.muyu.cloud.market.domin.req.CompanyListReq;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
|
@ -20,4 +21,11 @@ public interface CompanyService extends IService<Company> {
|
|||
* @return
|
||||
*/
|
||||
void companyauthentication(CompanyListReq companyListReq, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 判断是否进行了企业认证
|
||||
* @return
|
||||
*/
|
||||
User ifcompanyauthentication();
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.cloud.market.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.cloud.market.domin.Product;
|
||||
import com.muyu.cloud.market.domin.req.ProductListReq;
|
||||
import com.muyu.cloud.market.domin.resp.ChosehowpayResp;
|
||||
import com.muyu.cloud.market.domin.resp.ProductListResp;
|
||||
import com.muyu.cloud.market.domin.resp.ProductTotalListResp;
|
||||
|
||||
|
@ -38,4 +39,9 @@ public interface ProductApiService extends IService<Product> {
|
|||
List<String> selectproductTypeList();
|
||||
|
||||
|
||||
/**
|
||||
* 产品的支付规格及对应的价格
|
||||
* @return
|
||||
*/
|
||||
List<ChosehowpayResp> selectspecification(ChosehowpayResp chosehowpayResp);
|
||||
}
|
||||
|
|
|
@ -74,4 +74,21 @@ public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> impl
|
|||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否进行了企业认证
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public User ifcompanyauthentication() {
|
||||
//获取当前登录人信息
|
||||
String token = SecurityUtils.getToken();// 获取当前Token
|
||||
LoginUser loginUser = tokenService.getLoginUser(token); // 获取当前登录用户
|
||||
if (loginUser == null) {
|
||||
throw new RuntimeException("用户未登录或Token无效");
|
||||
}
|
||||
Long userid = loginUser.getUserid();
|
||||
User user = userService.getById(userid);
|
||||
return user;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.cloud.market.domin.Product;
|
||||
import com.muyu.cloud.market.domin.req.ProductListReq;
|
||||
import com.muyu.cloud.market.domin.resp.ChosehowpayResp;
|
||||
import com.muyu.cloud.market.domin.resp.ProductListResp;
|
||||
import com.muyu.cloud.market.domin.resp.ProductTotalListResp;
|
||||
import com.muyu.cloud.market.mapper.ProductApiMapper;
|
||||
|
@ -88,5 +89,14 @@ public class ProductApiServiceImpl extends ServiceImpl<ProductApiMapper, Product
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* 产品的支付规格及对应的价格
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ChosehowpayResp> selectspecification(ChosehowpayResp chosehowpayResp) {
|
||||
return productApiMapper.selectspecification(chosehowpayResp);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="com.muyu.cloud.market.mapper.ProductApiMapper">
|
||||
|
||||
<select id="selectspecification" resultType="com.muyu.cloud.market.domin.resp.ChosehowpayResp">
|
||||
select
|
||||
product.product_id,
|
||||
product.product_name,
|
||||
product_specification.product_specification_id,
|
||||
product_specification.product_specification_name,
|
||||
middle_specification_product.middle_price
|
||||
from product
|
||||
left join middle_specification_product on product.product_id = middle_specification_product.middle_product
|
||||
left join product_specification on middle_specification_product.middle_specification=product_specification.product_specification_id
|
||||
WHERE product.product_id = #{productId}
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue