Merge remote-tracking branch 'origin/dev'
commit
6b81784684
|
@ -58,10 +58,6 @@ public class Product extends BaseEntity {
|
||||||
*产品规格(按次购买/按日期购买)购买多少次
|
*产品规格(按次购买/按日期购买)购买多少次
|
||||||
*/
|
*/
|
||||||
private String productSpecification;
|
private String productSpecification;
|
||||||
/**
|
|
||||||
*产品库存
|
|
||||||
*/
|
|
||||||
private Integer productInventory;
|
|
||||||
/**
|
/**
|
||||||
*产品销量
|
*产品销量
|
||||||
*/
|
*/
|
||||||
|
@ -79,7 +75,15 @@ public class Product extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
*接口地址
|
*接口地址
|
||||||
*/
|
*/
|
||||||
private String productAddress;
|
private String apiAddress;
|
||||||
|
/**
|
||||||
|
* 返回格式
|
||||||
|
*/
|
||||||
|
private String returnFormat;
|
||||||
|
/**
|
||||||
|
*请求方式
|
||||||
|
*/
|
||||||
|
private String requestMethod;
|
||||||
|
|
||||||
public static Product addProductList(ProductAddReq productAddReq){
|
public static Product addProductList(ProductAddReq productAddReq){
|
||||||
return Product.builder()
|
return Product.builder()
|
||||||
|
@ -89,11 +93,12 @@ public class Product extends BaseEntity {
|
||||||
.productContent(productAddReq.getProductContent())
|
.productContent(productAddReq.getProductContent())
|
||||||
.productState(productAddReq.getProductState())
|
.productState(productAddReq.getProductState())
|
||||||
.productSpecification(productAddReq.getProductSpecification())
|
.productSpecification(productAddReq.getProductSpecification())
|
||||||
.productInventory(productAddReq.getProductInventory())
|
|
||||||
.productSales(productAddReq.getProductSales())
|
.productSales(productAddReq.getProductSales())
|
||||||
.productType(productAddReq.getProductType())
|
.productType(productAddReq.getProductType())
|
||||||
.productShelvesdate(productAddReq.getProductShelvesdate())
|
.productShelvesdate(productAddReq.getProductShelvesdate())
|
||||||
.productAddress(productAddReq.getProductAddress())
|
.apiAddress(productAddReq.getApiAddress())
|
||||||
|
.returnFormat(productAddReq.getReturnFormat())
|
||||||
|
.requestMethod(productAddReq.getRequestMethod())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,11 +111,12 @@ public class Product extends BaseEntity {
|
||||||
.productContent(productUpdReq.getProductContent())
|
.productContent(productUpdReq.getProductContent())
|
||||||
.productState(productUpdReq.getProductState())
|
.productState(productUpdReq.getProductState())
|
||||||
.productSpecification(productUpdReq.getProductSpecification())
|
.productSpecification(productUpdReq.getProductSpecification())
|
||||||
.productInventory(productUpdReq.getProductInventory())
|
|
||||||
.productSales(productUpdReq.getProductSales())
|
.productSales(productUpdReq.getProductSales())
|
||||||
.productType(productUpdReq.getProductType())
|
.productType(productUpdReq.getProductType())
|
||||||
.productShelvesdate(productUpdReq.getProductShelvesdate())
|
.productShelvesdate(productUpdReq.getProductShelvesdate())
|
||||||
.productAddress(productUpdReq.getProductAddress())
|
.apiAddress(productUpdReq.getApiAddress())
|
||||||
|
.returnFormat(productUpdReq.getReturnFormat())
|
||||||
|
.requestMethod(productUpdReq.getRequestMethod())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package com.muyu.cloud.market.domin;
|
package com.muyu.cloud.market.domin;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
@ -27,7 +29,8 @@ public class User {
|
||||||
/**
|
/**
|
||||||
* 用户ID
|
* 用户ID
|
||||||
*/
|
*/
|
||||||
private Integer userId;
|
@TableId(value = "user_id",type = IdType.AUTO)
|
||||||
|
private long userId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门ID
|
* 部门ID
|
||||||
|
@ -129,6 +132,14 @@ public class User {
|
||||||
* 用户余额
|
* 用户余额
|
||||||
*/
|
*/
|
||||||
private BigDecimal userMoney;
|
private BigDecimal userMoney;
|
||||||
|
/**
|
||||||
|
* 是否个人绑定
|
||||||
|
*/
|
||||||
|
private Integer isPersonlink;
|
||||||
|
/**
|
||||||
|
* 是否企业绑定
|
||||||
|
*/
|
||||||
|
private Integer isCompanyid;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,14 @@
|
||||||
package com.muyu.cloud.market.domin.req;
|
package com.muyu.cloud.market.domin.req;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:weiran
|
* @Author:weiran
|
||||||
* @Package:com.muyu.cloud.background.domin.req
|
* @Package:com.muyu.cloud.background.domin.req
|
||||||
|
@ -57,5 +60,15 @@ public class CompanyListReq {
|
||||||
*企业地址
|
*企业地址
|
||||||
*/
|
*/
|
||||||
private String companyAddress;
|
private String companyAddress;
|
||||||
|
/**
|
||||||
|
*审核状态
|
||||||
|
*/
|
||||||
|
@Schema(description = "审核状态",defaultValue = "0",type = "Integer")
|
||||||
|
private Integer reviewStatus;
|
||||||
|
/**
|
||||||
|
* 公司注册账户余额
|
||||||
|
*/
|
||||||
|
@Schema(description = "公司注册账户余额",defaultValue = "0",type = "BigDecimal")
|
||||||
|
private BigDecimal companyMoney;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,10 +50,6 @@ public class ProductAddReq {
|
||||||
*产品规格(按次购买/按日期购买)购买多少次
|
*产品规格(按次购买/按日期购买)购买多少次
|
||||||
*/
|
*/
|
||||||
private String productSpecification;
|
private String productSpecification;
|
||||||
/**
|
|
||||||
*产品库存
|
|
||||||
*/
|
|
||||||
private Integer productInventory;
|
|
||||||
/**
|
/**
|
||||||
*产品销量
|
*产品销量
|
||||||
*/
|
*/
|
||||||
|
@ -71,5 +67,13 @@ public class ProductAddReq {
|
||||||
/**
|
/**
|
||||||
*接口地址
|
*接口地址
|
||||||
*/
|
*/
|
||||||
private String productAddress;
|
private String apiAddress;
|
||||||
|
/**
|
||||||
|
* 返回格式
|
||||||
|
*/
|
||||||
|
private String returnFormat;
|
||||||
|
/**
|
||||||
|
*请求方式
|
||||||
|
*/
|
||||||
|
private String requestMethod;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,15 @@ public class ProductListReq {
|
||||||
/**
|
/**
|
||||||
*接口地址
|
*接口地址
|
||||||
*/
|
*/
|
||||||
private String productAddress;
|
private String apiAddress;
|
||||||
|
/**
|
||||||
|
* 返回格式
|
||||||
|
*/
|
||||||
|
private String returnFormat;
|
||||||
|
/**
|
||||||
|
*请求方式
|
||||||
|
*/
|
||||||
|
private String requestMethod;
|
||||||
/**
|
/**
|
||||||
* 页码,从1开始
|
* 页码,从1开始
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -49,10 +49,6 @@ public class ProductUpdReq {
|
||||||
*产品规格(按次购买/按日期购买)购买多少次
|
*产品规格(按次购买/按日期购买)购买多少次
|
||||||
*/
|
*/
|
||||||
private String productSpecification;
|
private String productSpecification;
|
||||||
/**
|
|
||||||
*产品库存
|
|
||||||
*/
|
|
||||||
private Integer productInventory;
|
|
||||||
/**
|
/**
|
||||||
*产品销量
|
*产品销量
|
||||||
*/
|
*/
|
||||||
|
@ -70,5 +66,13 @@ public class ProductUpdReq {
|
||||||
/**
|
/**
|
||||||
*接口地址
|
*接口地址
|
||||||
*/
|
*/
|
||||||
private String productAddress;
|
private String apiAddress;
|
||||||
|
/**
|
||||||
|
* 返回格式
|
||||||
|
*/
|
||||||
|
private String returnFormat;
|
||||||
|
/**
|
||||||
|
*请求方式
|
||||||
|
*/
|
||||||
|
private String requestMethod;
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,15 @@ public class ProductListResp {
|
||||||
/**
|
/**
|
||||||
*接口地址
|
*接口地址
|
||||||
*/
|
*/
|
||||||
private String productAddress;
|
private String apiAddress;
|
||||||
|
/**
|
||||||
|
* 返回格式
|
||||||
|
*/
|
||||||
|
private String returnFormat;
|
||||||
|
/**
|
||||||
|
*请求方式
|
||||||
|
*/
|
||||||
|
private String requestMethod;
|
||||||
|
|
||||||
@Schema(description = "创建人",defaultValue = "muyu",type = "String")
|
@Schema(description = "创建人",defaultValue = "muyu",type = "String")
|
||||||
private String createBy;
|
private String createBy;
|
||||||
|
@ -78,7 +86,9 @@ public class ProductListResp {
|
||||||
.productContent(product.getProductContent())
|
.productContent(product.getProductContent())
|
||||||
.productState(product.getProductState())
|
.productState(product.getProductState())
|
||||||
.productSales(product.getProductSales())
|
.productSales(product.getProductSales())
|
||||||
.productAddress(product.getProductAddress())
|
.apiAddress(product.getApiAddress())
|
||||||
|
.returnFormat(product.getReturnFormat())
|
||||||
|
.requestMethod(product.getRequestMethod())
|
||||||
.createBy(product.getCreateBy())
|
.createBy(product.getCreateBy())
|
||||||
.createTime(product.getCreateTime())
|
.createTime(product.getCreateTime())
|
||||||
.build();
|
.build();
|
||||||
|
|
|
@ -25,6 +25,12 @@
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.json</groupId>
|
||||||
|
<artifactId>json</artifactId>
|
||||||
|
<version>20210307</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 图片上传 -->
|
<!-- 图片上传 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.aliyun.oss</groupId>
|
<groupId>com.aliyun.oss</groupId>
|
||||||
|
|
|
@ -1,10 +1,16 @@
|
||||||
package com.muyu.cloud.market.controller;
|
package com.muyu.cloud.market.controller;
|
||||||
|
import com.muyu.cloud.market.domin.req.CompanyListReq;
|
||||||
|
import com.muyu.cloud.market.service.CompanyService;
|
||||||
import com.muyu.cloud.market.util.OssUtil;
|
import com.muyu.cloud.market.util.OssUtil;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
@ -22,6 +28,8 @@ import org.springframework.web.multipart.MultipartFile;
|
||||||
@RequestMapping("/company")
|
@RequestMapping("/company")
|
||||||
@Tag(name = "企业管理控制层",description = "进行企业管理、查看等相关操作")
|
@Tag(name = "企业管理控制层",description = "进行企业管理、查看等相关操作")
|
||||||
public class CompanyController {
|
public class CompanyController {
|
||||||
|
@Autowired
|
||||||
|
private CompanyService companyService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,6 +46,23 @@ public class CompanyController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业绑定
|
||||||
|
* @param companyListReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(path = "/companyauthentication")
|
||||||
|
@Operation(summary = "企业绑定",description = "企业绑定")
|
||||||
|
public Result companyauthentication(@Validated @RequestBody CompanyListReq companyListReq, HttpServletRequest request){
|
||||||
|
companyService.companyauthentication(companyListReq,request);
|
||||||
|
return Result.success(null,"绑定成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.cloud.market.controller;
|
||||||
|
|
||||||
import com.muyu.cloud.market.domin.req.LinkEmailReq;
|
import com.muyu.cloud.market.domin.req.LinkEmailReq;
|
||||||
import com.muyu.cloud.market.service.UserService;
|
import com.muyu.cloud.market.service.UserService;
|
||||||
|
import com.muyu.cloud.market.util.OssUtil;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
@ -9,6 +10,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:weiran
|
* @Author:weiran
|
||||||
|
@ -50,4 +52,17 @@ public class UserController {
|
||||||
userService.linkemail(linkEmailReq,request);
|
userService.linkemail(linkEmailReq,request);
|
||||||
return Result.success(null, "操作成功");
|
return Result.success(null, "操作成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 图片上传
|
||||||
|
* @param file
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping(path = "/upload")
|
||||||
|
@Operation(summary = "图片上传",description = "图片上传")
|
||||||
|
public Result upload(MultipartFile file){
|
||||||
|
String s= OssUtil.uploadMultipartFile(file);
|
||||||
|
return Result.success(s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,8 @@ package com.muyu.cloud.market.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.cloud.market.domin.Company;
|
import com.muyu.cloud.market.domin.Company;
|
||||||
|
import com.muyu.cloud.market.domin.req.CompanyListReq;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author:weiran
|
* @Author:weiran
|
||||||
|
@ -11,4 +13,11 @@ import com.muyu.cloud.market.domin.Company;
|
||||||
* @Date:2024/8/27 14:17
|
* @Date:2024/8/27 14:17
|
||||||
*/
|
*/
|
||||||
public interface CompanyService extends IService<Company> {
|
public interface CompanyService extends IService<Company> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业绑定
|
||||||
|
* @param companyListReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
void companyauthentication(CompanyListReq companyListReq, HttpServletRequest request);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,4 +36,6 @@ public interface ProductApiService extends IService<Product> {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<String> selectproductTypeList();
|
List<String> selectproductTypeList();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,16 @@
|
||||||
package com.muyu.cloud.market.service.impl;
|
package com.muyu.cloud.market.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.cloud.market.domin.Company;
|
import com.muyu.cloud.market.domin.Company;
|
||||||
|
import com.muyu.cloud.market.domin.req.CompanyListReq;
|
||||||
import com.muyu.cloud.market.mapper.CompanyMapper;
|
import com.muyu.cloud.market.mapper.CompanyMapper;
|
||||||
import com.muyu.cloud.market.service.CompanyService;
|
import com.muyu.cloud.market.service.CompanyService;
|
||||||
|
import com.muyu.common.security.service.TokenService;
|
||||||
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
|
import com.muyu.common.system.domain.LoginUser;
|
||||||
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,4 +22,27 @@ import org.springframework.stereotype.Service;
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> implements CompanyService {
|
public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> implements CompanyService {
|
||||||
|
@Autowired
|
||||||
|
private CompanyMapper companyMapper;
|
||||||
|
@Autowired
|
||||||
|
private TokenService tokenService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 企业绑定
|
||||||
|
* @param companyListReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void companyauthentication(CompanyListReq companyListReq, HttpServletRequest request) {
|
||||||
|
// //获取当前登录人信息
|
||||||
|
// String token = SecurityUtils.getToken();// 获取当前Token
|
||||||
|
// LoginUser loginUser = tokenService.getLoginUser(token); // 获取当前登录用户
|
||||||
|
// if (loginUser == null) {
|
||||||
|
// throw new RuntimeException("用户未登录或Token无效");
|
||||||
|
// }
|
||||||
|
// Long userid = loginUser.getUserid();
|
||||||
|
LambdaQueryWrapper<Company> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,6 +80,7 @@ public class ProductApiServiceImpl extends ServiceImpl<ProductApiMapper, Product
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 产品类型查询
|
* 产品类型查询
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@ -88,4 +89,5 @@ public class ProductApiServiceImpl extends ServiceImpl<ProductApiMapper, Product
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,10 +87,14 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements co
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String sendcode(String email) {
|
public String sendcode(String email) {
|
||||||
|
if (email.isEmpty()){
|
||||||
|
throw new RuntimeException("邮箱不能为空");
|
||||||
|
}
|
||||||
//生成验证码
|
//生成验证码
|
||||||
String code = RandomUtil.randomNumbers(4);
|
String code = RandomUtil.randomNumbers(4);
|
||||||
//验证码存入redis中
|
//验证码存入redis中
|
||||||
redisTemplate.opsForValue().set(email, code,5, TimeUnit.MINUTES);
|
redisTemplate.opsForValue().set(email, code,5, TimeUnit.MINUTES);
|
||||||
|
|
||||||
MimeMessage mimeMessage = javaMailSender.createMimeMessage();
|
MimeMessage mimeMessage = javaMailSender.createMimeMessage();
|
||||||
try {
|
try {
|
||||||
MimeMessageHelper helper = new MimeMessageHelper(mimeMessage,true);
|
MimeMessageHelper helper = new MimeMessageHelper(mimeMessage,true);
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue