241009更新
This commit is contained in:
15
.idea/deployment.xml
generated
Normal file
15
.idea/deployment.xml
generated
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="PublishConfigData" serverName="nbg" remoteFilesAllowedToDisappearOnAutoupload="false" confirmBeforeUploading="false">
|
||||||
|
<option name="confirmBeforeUploading" value="false" />
|
||||||
|
<serverData>
|
||||||
|
<paths name="nbg">
|
||||||
|
<serverdata>
|
||||||
|
<mappings>
|
||||||
|
<mapping deploy="/" local="$PROJECT_DIR$/target" web="/" />
|
||||||
|
</mappings>
|
||||||
|
</serverdata>
|
||||||
|
</paths>
|
||||||
|
</serverData>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
14
.idea/webServers.xml
generated
Normal file
14
.idea/webServers.xml
generated
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="WebServers">
|
||||||
|
<option name="servers">
|
||||||
|
<webServer id="a8fd968b-4825-43b5-bc54-7470bfb7a789" name="nbg" url="http://47.119.165.234">
|
||||||
|
<fileTransfer host="47.119.165.234" port="21888">
|
||||||
|
<advancedOptions>
|
||||||
|
<advancedOptions dataProtectionLevel="Private" passiveMode="true" shareSSLContext="true" />
|
||||||
|
</advancedOptions>
|
||||||
|
</fileTransfer>
|
||||||
|
</webServer>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
BIN
file/qr/friendPay_583486.png
Normal file
BIN
file/qr/friendPay_583486.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 56 KiB |
9
pom.xml
9
pom.xml
@@ -262,7 +262,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.binarywang</groupId>
|
<groupId>com.github.binarywang</groupId>
|
||||||
<artifactId>weixin-java-miniapp</artifactId>
|
<artifactId>weixin-java-miniapp</artifactId>
|
||||||
<version>4.5.0</version>
|
<version>4.6.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 阿里云 OSS -->
|
<!-- 阿里云 OSS -->
|
||||||
@@ -271,6 +271,12 @@
|
|||||||
<artifactId>aliyun-sdk-oss</artifactId>
|
<artifactId>aliyun-sdk-oss</artifactId>
|
||||||
<version>3.17.0</version>
|
<version>3.17.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- 快递100-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.kuaidi100-api</groupId>
|
||||||
|
<artifactId>sdk</artifactId>
|
||||||
|
<version>1.0.13</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!--诺诺开票接口-->
|
<!--诺诺开票接口-->
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -293,7 +299,6 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
@@ -0,0 +1,114 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.DesignCollectService;
|
||||||
|
import com.gxwebsoft.cms.entity.DesignCollect;
|
||||||
|
import com.gxwebsoft.cms.param.DesignCollectParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计征集控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-08 15:21:56
|
||||||
|
*/
|
||||||
|
@Api(tags = "设计征集管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/design-collect")
|
||||||
|
public class DesignCollectController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private DesignCollectService designCollectService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询设计征集")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<DesignCollect>> page(DesignCollectParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(designCollectService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部设计征集")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<DesignCollect>> list(DesignCollectParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(designCollectService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据id查询设计征集")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<DesignCollect> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(designCollectService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加设计征集")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody DesignCollect designCollect) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
designCollect.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (designCollectService.save(designCollect)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改设计征集")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody DesignCollect designCollect) {
|
||||||
|
if (designCollectService.updateById(designCollect)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除设计征集")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (designCollectService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加设计征集")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<DesignCollect> list) {
|
||||||
|
if (designCollectService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改设计征集")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<DesignCollect> batchParam) {
|
||||||
|
if (batchParam.update(designCollectService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除设计征集")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (designCollectService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
package com.gxwebsoft.cms.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.cms.service.DesignSignUpService;
|
||||||
|
import com.gxwebsoft.cms.entity.DesignSignUp;
|
||||||
|
import com.gxwebsoft.cms.param.DesignSignUpParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计征集报名控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-08 15:21:56
|
||||||
|
*/
|
||||||
|
@Api(tags = "设计征集报名管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/cms/design-sign-up")
|
||||||
|
public class DesignSignUpController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private DesignSignUpService designSignUpService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询设计征集报名")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<DesignSignUp>> page(DesignSignUpParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(designSignUpService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部设计征集报名")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<DesignSignUp>> list(DesignSignUpParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(designSignUpService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('cms:designSignUp:list')")
|
||||||
|
@ApiOperation("根据id查询设计征集报名")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<DesignSignUp> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(designSignUpService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加设计征集报名")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody DesignSignUp designSignUp) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
designSignUp.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (designSignUpService.save(designSignUp)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改设计征集报名")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody DesignSignUp designSignUp) {
|
||||||
|
if (designSignUpService.updateById(designSignUp)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除设计征集报名")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (designSignUpService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加设计征集报名")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<DesignSignUp> list) {
|
||||||
|
if (designSignUpService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改设计征集报名")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<DesignSignUp> batchParam) {
|
||||||
|
if (batchParam.update(designSignUpService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除设计征集报名")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (designSignUpService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -148,7 +148,6 @@ public class MpController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("小程序基本信息")
|
@ApiOperation("小程序基本信息")
|
||||||
@GetMapping("/getMpInfo")
|
@GetMapping("/getMpInfo")
|
||||||
public ApiResult<?> getMpInfo() {
|
public ApiResult<?> getMpInfo() {
|
||||||
@@ -302,7 +301,27 @@ public class MpController extends BaseController {
|
|||||||
// final List<Goods> goods = goodsService.list(new LambdaQueryWrapper<Goods>().ne(Goods::getType, 0).last("limit 10"));
|
// final List<Goods> goods = goodsService.list(new LambdaQueryWrapper<Goods>().ne(Goods::getType, 0).last("limit 10"));
|
||||||
// final List<Goods> foods = goodsService.list(new LambdaQueryWrapper<Goods>().eq(Goods::getType, 1).last("limit 10"));
|
// final List<Goods> foods = goodsService.list(new LambdaQueryWrapper<Goods>().eq(Goods::getType, 1).last("limit 10"));
|
||||||
|
|
||||||
layout.put("goods",goodsService.getGoodsSpecType0());
|
List<Goods> goodsList = goodsService.getGoodsSpecType0(param);
|
||||||
|
if (getLoginUser() != null) {
|
||||||
|
for (Goods goods : goodsList) {
|
||||||
|
if (getLoginUser().getGradeId().equals(33)) {
|
||||||
|
if (goods.getDealerGift()) goods.setShowGift(true);
|
||||||
|
goods.setPrice(goods.getDealerPrice());
|
||||||
|
}
|
||||||
|
// 会员店
|
||||||
|
if (getLoginUser().getGradeId().equals(31)) {
|
||||||
|
if (goods.getPriceGift()) goods.setShowGift(true);
|
||||||
|
}
|
||||||
|
if (getLoginUser().getGradeId().equals(0)) {
|
||||||
|
goods.setPrice(goods.getSalePrice());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
for (Goods goods : goodsList) {
|
||||||
|
goods.setPrice(goods.getSalePrice());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
layout.put("goods", goodsList);
|
||||||
layout.put("foods", goodsService.getGoodsSpecType1());
|
layout.put("foods", goodsService.getGoodsSpecType1());
|
||||||
|
|
||||||
return success(layout);
|
return success(layout);
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ public class Article implements Serializable {
|
|||||||
@ApiModelProperty(value = "封面图")
|
@ApiModelProperty(value = "封面图")
|
||||||
private String image;
|
private String image;
|
||||||
|
|
||||||
|
private Integer imageWidth;
|
||||||
|
|
||||||
|
private Integer imageHeight;
|
||||||
|
|
||||||
@ApiModelProperty(value = "来源")
|
@ApiModelProperty(value = "来源")
|
||||||
private String source;
|
private String source;
|
||||||
|
|
||||||
|
|||||||
61
src/main/java/com/gxwebsoft/cms/entity/DesignCollect.java
Normal file
61
src/main/java/com/gxwebsoft/cms/entity/DesignCollect.java
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计征集
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-08 15:21:56
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "DesignCollect对象", description = "设计征集")
|
||||||
|
@TableName("cms_design_collect")
|
||||||
|
public class DesignCollect implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0已发布, 1待审核 2已驳回 3违规内容")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
63
src/main/java/com/gxwebsoft/cms/entity/DesignSignUp.java
Normal file
63
src/main/java/com/gxwebsoft/cms/entity/DesignSignUp.java
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
package com.gxwebsoft.cms.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计征集报名
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-08 15:21:56
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "DesignSignUp对象", description = "设计征集报名")
|
||||||
|
@TableName("cms_design_sign_up")
|
||||||
|
public class DesignSignUp implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private Integer designId;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0已发布, 1待审核 2已驳回 3违规内容")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.DesignCollect;
|
||||||
|
import com.gxwebsoft.cms.param.DesignCollectParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计征集Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-08 15:21:56
|
||||||
|
*/
|
||||||
|
public interface DesignCollectMapper extends BaseMapper<DesignCollect> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<DesignCollect>
|
||||||
|
*/
|
||||||
|
List<DesignCollect> selectPageRel(@Param("page") IPage<DesignCollect> page,
|
||||||
|
@Param("param") DesignCollectParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<DesignCollect> selectListRel(@Param("param") DesignCollectParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.cms.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.cms.entity.DesignSignUp;
|
||||||
|
import com.gxwebsoft.cms.param.DesignSignUpParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计征集报名Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-08 15:21:56
|
||||||
|
*/
|
||||||
|
public interface DesignSignUpMapper extends BaseMapper<DesignSignUp> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<DesignSignUp>
|
||||||
|
*/
|
||||||
|
List<DesignSignUp> selectPageRel(@Param("page") IPage<DesignSignUp> page,
|
||||||
|
@Param("param") DesignSignUpParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<DesignSignUp> selectListRel(@Param("param") DesignSignUpParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -110,12 +110,10 @@
|
|||||||
</if>
|
</if>
|
||||||
<if test="param.keywords != null">
|
<if test="param.keywords != null">
|
||||||
AND (a.title LIKE CONCAT('%', #{param.keywords}, '%')
|
AND (a.title LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
OR a.phone LIKE CONCAT('%', #{param.keywords}, '%')
|
|
||||||
OR a.region LIKE CONCAT('%', #{param.keywords}, '%')
|
|
||||||
OR a.user_id = #{param.keywords}
|
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
ORDER BY a.sort_number ASC, a.create_time DESC
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 分页查询 -->
|
<!-- 分页查询 -->
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
<?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.gxwebsoft.cms.mapper.DesignCollectMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_design_collect a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.title != null">
|
||||||
|
AND a.title LIKE CONCAT('%', #{param.title}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.content != null">
|
||||||
|
AND a.content LIKE CONCAT('%', #{param.content}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.image != null">
|
||||||
|
AND a.image LIKE CONCAT('%', #{param.image}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.DesignCollect">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.DesignCollect">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
<?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.gxwebsoft.cms.mapper.DesignSignUpMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM cms_design_sign_up a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.designId != null">
|
||||||
|
AND a.design_id = #{param.designId}
|
||||||
|
</if>
|
||||||
|
<if test="param.name != null">
|
||||||
|
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.phone != null">
|
||||||
|
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.content != null">
|
||||||
|
AND a.content LIKE CONCAT('%', #{param.content}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.cms.entity.DesignSignUp">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.cms.entity.DesignSignUp">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.gxwebsoft.cms.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计征集查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-08 15:21:56
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "DesignCollectParam对象", description = "设计征集查询参数")
|
||||||
|
public class DesignCollectParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0已发布, 1待审核 2已驳回 3违规内容")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
}
|
||||||
57
src/main/java/com/gxwebsoft/cms/param/DesignSignUpParam.java
Normal file
57
src/main/java/com/gxwebsoft/cms/param/DesignSignUpParam.java
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
package com.gxwebsoft.cms.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计征集报名查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-08 15:21:56
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "DesignSignUpParam对象", description = "设计征集报名查询参数")
|
||||||
|
public class DesignSignUpParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer designId;
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序(数字越小越靠前)")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0已发布, 1待审核 2已驳回 3违规内容")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.cms.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.cms.entity.DesignCollect;
|
||||||
|
import com.gxwebsoft.cms.param.DesignCollectParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计征集Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-08 15:21:56
|
||||||
|
*/
|
||||||
|
public interface DesignCollectService extends IService<DesignCollect> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<DesignCollect>
|
||||||
|
*/
|
||||||
|
PageResult<DesignCollect> pageRel(DesignCollectParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<DesignCollect>
|
||||||
|
*/
|
||||||
|
List<DesignCollect> listRel(DesignCollectParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return DesignCollect
|
||||||
|
*/
|
||||||
|
DesignCollect getByIdRel(Integer id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.cms.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.cms.entity.DesignSignUp;
|
||||||
|
import com.gxwebsoft.cms.param.DesignSignUpParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计征集报名Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-08 15:21:56
|
||||||
|
*/
|
||||||
|
public interface DesignSignUpService extends IService<DesignSignUp> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<DesignSignUp>
|
||||||
|
*/
|
||||||
|
PageResult<DesignSignUp> pageRel(DesignSignUpParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<DesignSignUp>
|
||||||
|
*/
|
||||||
|
List<DesignSignUp> listRel(DesignSignUpParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return DesignSignUp
|
||||||
|
*/
|
||||||
|
DesignSignUp getByIdRel(Integer id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.gxwebsoft.cms.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.cms.mapper.DesignCollectMapper;
|
||||||
|
import com.gxwebsoft.cms.service.DesignCollectService;
|
||||||
|
import com.gxwebsoft.cms.entity.DesignCollect;
|
||||||
|
import com.gxwebsoft.cms.param.DesignCollectParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计征集Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-08 15:21:56
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DesignCollectServiceImpl extends ServiceImpl<DesignCollectMapper, DesignCollect> implements DesignCollectService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<DesignCollect> pageRel(DesignCollectParam param) {
|
||||||
|
PageParam<DesignCollect, DesignCollectParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
List<DesignCollect> list = baseMapper.selectPageRel(page, param);
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DesignCollect> listRel(DesignCollectParam param) {
|
||||||
|
List<DesignCollect> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<DesignCollect, DesignCollectParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DesignCollect getByIdRel(Integer id) {
|
||||||
|
DesignCollectParam param = new DesignCollectParam();
|
||||||
|
param.setId(id);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.gxwebsoft.cms.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.cms.mapper.DesignSignUpMapper;
|
||||||
|
import com.gxwebsoft.cms.service.DesignSignUpService;
|
||||||
|
import com.gxwebsoft.cms.entity.DesignSignUp;
|
||||||
|
import com.gxwebsoft.cms.param.DesignSignUpParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设计征集报名Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-08 15:21:56
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DesignSignUpServiceImpl extends ServiceImpl<DesignSignUpMapper, DesignSignUp> implements DesignSignUpService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<DesignSignUp> pageRel(DesignSignUpParam param) {
|
||||||
|
PageParam<DesignSignUp, DesignSignUpParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
List<DesignSignUp> list = baseMapper.selectPageRel(page, param);
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DesignSignUp> listRel(DesignSignUpParam param) {
|
||||||
|
List<DesignSignUp> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<DesignSignUp, DesignSignUpParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DesignSignUp getByIdRel(Integer id) {
|
||||||
|
DesignSignUpParam param = new DesignSignUpParam();
|
||||||
|
param.setId(id);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -67,7 +67,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
"/5zbYEPkyV4.txt",
|
"/5zbYEPkyV4.txt",
|
||||||
"/api/love/user-plan-log/wx-pay/**",
|
"/api/love/user-plan-log/wx-pay/**",
|
||||||
"/api/cms/form-record",
|
"/api/cms/form-record",
|
||||||
"/api/shop/merchant-account/getMerchantAccountByPhone"
|
"/api/shop/merchant-account/getMerchantAccountByPhone",
|
||||||
|
"/api/shop/order-delivery/notify"
|
||||||
)
|
)
|
||||||
.permitAll()
|
.permitAll()
|
||||||
.anyRequest()
|
.anyRequest()
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class RequestUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 预付请求付款(余额支付)
|
// 预付请求付款(余额支付)
|
||||||
public Object balancePay(Order order){
|
public Object balancePay(Order order) {
|
||||||
// 设置租户ID
|
// 设置租户ID
|
||||||
setTenantId(order.getTenantId().toString());
|
setTenantId(order.getTenantId().toString());
|
||||||
// 设置token
|
// 设置token
|
||||||
@@ -52,7 +52,7 @@ public class RequestUtil {
|
|||||||
.body(JSONUtil.toJSONString(order))//表单内容
|
.body(JSONUtil.toJSONString(order))//表单内容
|
||||||
.timeout(20000)//超时,毫秒
|
.timeout(20000)//超时,毫秒
|
||||||
.execute().body();
|
.execute().body();
|
||||||
|
System.out.println("body:" + body);
|
||||||
return JSONUtil.parseObject(body, ApiResult.class).getData();
|
return JSONUtil.parseObject(body, ApiResult.class).getData();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -62,7 +62,7 @@ public class RequestUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 微信支付通知
|
// 微信支付通知
|
||||||
public String pushWxPayNotify(Transaction transaction, Payment payment){
|
public String pushWxPayNotify(Transaction transaction, Payment payment) {
|
||||||
// 设置租户ID
|
// 设置租户ID
|
||||||
setTenantId(payment.getTenantId().toString());
|
setTenantId(payment.getTenantId().toString());
|
||||||
// 推送支付通知地址
|
// 推送支付通知地址
|
||||||
@@ -131,9 +131,9 @@ public class RequestUtil {
|
|||||||
map.put("realName", merchantAccount.getRealName());
|
map.put("realName", merchantAccount.getRealName());
|
||||||
map.put("phone", merchantAccount.getPhone());
|
map.put("phone", merchantAccount.getPhone());
|
||||||
map.put("password", merchantAccount.getPassword());
|
map.put("password", merchantAccount.getPassword());
|
||||||
map.put("merchantId",merchantAccount.getMerchantId());
|
map.put("merchantId", merchantAccount.getMerchantId());
|
||||||
map.put("merchantName",merchantAccount.getMerchantName());
|
map.put("merchantName", merchantAccount.getMerchantName());
|
||||||
map.put("merchantAvatar",merchantAccount.getMerchantAvatar());
|
map.put("merchantAvatar", merchantAccount.getMerchantAvatar());
|
||||||
final ArrayList<Object> roles = new ArrayList<>();
|
final ArrayList<Object> roles = new ArrayList<>();
|
||||||
final UserRole userRole = new UserRole();
|
final UserRole userRole = new UserRole();
|
||||||
userRole.setUserId(merchantAccount.getUserId());
|
userRole.setUserId(merchantAccount.getUserId());
|
||||||
@@ -156,7 +156,7 @@ public class RequestUtil {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ApiResult<?> updateUserBalance(String path,User user) {
|
public ApiResult<?> updateUserBalance(String path, User user) {
|
||||||
try {
|
try {
|
||||||
// 链式构建请求
|
// 链式构建请求
|
||||||
final String body = HttpRequest.put(host.concat(path))
|
final String body = HttpRequest.put(host.concat(path))
|
||||||
@@ -172,6 +172,23 @@ public class RequestUtil {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public User getParent(Integer userId) {
|
||||||
|
try {
|
||||||
|
// 链式构建请求
|
||||||
|
final String result = HttpRequest.get(host.concat("/system/user-referee/getReferee/" + userId))
|
||||||
|
.header("Authorization", ACCESS_TOKEN)
|
||||||
|
.header("Tenantid", TENANT_ID)
|
||||||
|
.timeout(20000)
|
||||||
|
.execute().body();
|
||||||
|
JSONObject jsonObject = JSONObject.parseObject(result);
|
||||||
|
final String data = jsonObject.getString("data");
|
||||||
|
return JSONObject.parseObject(data, User.class);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// 更新用户信息
|
// 更新用户信息
|
||||||
public void updateUser(User user) {
|
public void updateUser(User user) {
|
||||||
String path = "/system/user/";
|
String path = "/system/user/";
|
||||||
@@ -183,7 +200,7 @@ public class RequestUtil {
|
|||||||
.body(JSONUtil.toJSONString(user))
|
.body(JSONUtil.toJSONString(user))
|
||||||
.timeout(20000)
|
.timeout(20000)
|
||||||
.execute().body();
|
.execute().body();
|
||||||
|
System.out.println("body = " + body);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -242,4 +259,21 @@ public class RequestUtil {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ApiResult<?> getWxConfig() {
|
||||||
|
String path = "/system/setting?settingKey=mp-weixin";
|
||||||
|
try {
|
||||||
|
// 链式构建请求
|
||||||
|
final String body = HttpRequest.get(host.concat(path))
|
||||||
|
.header("Authorization", ACCESS_TOKEN)
|
||||||
|
.header("tenantId", TENANT_ID)
|
||||||
|
.timeout(20000)
|
||||||
|
.execute().body();
|
||||||
|
System.out.println("body = " + body);
|
||||||
|
return JSONUtil.parseObject(body, ApiResult.class);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ public class FileController extends BaseController {
|
|||||||
* 文件上传位置(服务器)
|
* 文件上传位置(服务器)
|
||||||
*/
|
*/
|
||||||
private String getUploadDir() {
|
private String getUploadDir() {
|
||||||
return config.getUploadPath() + "file/";
|
return config.getUploadPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
43
src/main/java/com/gxwebsoft/shop/config/WxMaProperties.java
Normal file
43
src/main/java/com/gxwebsoft/shop/config/WxMaProperties.java
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
package com.gxwebsoft.shop.config;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@ConfigurationProperties(prefix = "wx.miniapp")
|
||||||
|
@Configuration
|
||||||
|
public class WxMaProperties {
|
||||||
|
private List<Config> configs;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class Config {
|
||||||
|
/**
|
||||||
|
* 设置微信小程序的appid
|
||||||
|
*/
|
||||||
|
private String appid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置微信小程序的Secret
|
||||||
|
*/
|
||||||
|
private String secret;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置微信小程序消息服务器配置的token
|
||||||
|
*/
|
||||||
|
private String token;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置微信小程序消息服务器配置的EncodingAESKey
|
||||||
|
*/
|
||||||
|
private String aesKey;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 消息格式,XML或者JSON
|
||||||
|
*/
|
||||||
|
private String msgDataFormat;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.gxwebsoft.shop.consts;
|
||||||
|
|
||||||
|
public class BalanceScene {
|
||||||
|
public static final Integer BALANCE_SCENE_DIRECT_INCOME = 0;
|
||||||
|
public static final Integer BALANCE_SCENE_SUPPLIER = 1;
|
||||||
|
public static final Integer BALANCE_SCENE_DIFF = 2;
|
||||||
|
public static final Integer BALANCE_SCENE_OUT_TAKE = 3;
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
package com.gxwebsoft.shop.consts;
|
||||||
|
|
||||||
|
public class OrderPayType {
|
||||||
|
public static final Integer PAY_TYPE_BALANCE = 0;
|
||||||
|
public static final Integer PAY_TYPE_WECHAT = 1;
|
||||||
|
// 朋友代付
|
||||||
|
public static final Integer PAY_TYPE_FRIEND = 18;
|
||||||
|
}
|
||||||
@@ -55,11 +55,13 @@ public class CartController extends BaseController {
|
|||||||
@ApiOperation("查询全部购物车")
|
@ApiOperation("查询全部购物车")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public ApiResult<CartVo> list(CartParam param) {
|
public ApiResult<CartVo> list(CartParam param) {
|
||||||
|
param.setIsShow(true);
|
||||||
if (ObjectUtil.isEmpty(getLoginUser())) {
|
if (ObjectUtil.isEmpty(getLoginUser())) {
|
||||||
return success("请先登录",new CartVo());
|
return success("请先登录", new CartVo());
|
||||||
}
|
}
|
||||||
// 附加用户ID
|
// 附加用户ID
|
||||||
param.setUserId(getLoginUserId());
|
param.setUserId(getLoginUserId());
|
||||||
|
param.setLoginUser(getLoginUser());
|
||||||
return success(cartService.listRel(param));
|
return success(cartService.listRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,7 +77,7 @@ public class CartController extends BaseController {
|
|||||||
@PostMapping()
|
@PostMapping()
|
||||||
public ApiResult<?> save(@RequestBody Cart cart) {
|
public ApiResult<?> save(@RequestBody Cart cart) {
|
||||||
if (ObjectUtil.isEmpty(getLoginUser())) {
|
if (ObjectUtil.isEmpty(getLoginUser())) {
|
||||||
return success("请先登录",null);
|
return success("请先登录", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修正用户ID
|
// 修正用户ID
|
||||||
@@ -85,18 +87,27 @@ public class CartController extends BaseController {
|
|||||||
cart.setCartNum(1);
|
cart.setCartNum(1);
|
||||||
}
|
}
|
||||||
// 超出最大限制
|
// 超出最大限制
|
||||||
if (cartService.count(new LambdaUpdateWrapper<Cart>().eq(Cart::getUserId,cart.getUserId())) > 50) {
|
if (cartService.count(new LambdaUpdateWrapper<Cart>().eq(Cart::getUserId, cart.getUserId())) > 50) {
|
||||||
return fail("购物车宝贝数量已满,建议您先去结算或清理~");
|
return fail("购物车宝贝数量已满,建议您先去结算或清理~");
|
||||||
}
|
}
|
||||||
// 叠加
|
// 叠加
|
||||||
final Cart one = cartService.getOne(new LambdaQueryWrapper<Cart>().eq(Cart::getGoodsId, cart.getGoodsId()).eq(Cart::getSpec, cart.getSpec()).eq(Cart::getUserId, cart.getUserId()).eq(Cart::getType, cart.getType()).last("limit 1"));
|
if (!cart.getIsNew()) {
|
||||||
|
LambdaQueryWrapper<Cart> cartLambdaQueryWrapper = new LambdaQueryWrapper<Cart>()
|
||||||
|
.eq(Cart::getGoodsId, cart.getGoodsId())
|
||||||
|
.eq(Cart::getUserId, cart.getUserId())
|
||||||
|
.eq(Cart::getType, cart.getType());
|
||||||
|
if (cart.getSpec() != null) cartLambdaQueryWrapper.eq(Cart::getSpec, cart.getSpec());
|
||||||
|
cartLambdaQueryWrapper.last("limit 1");
|
||||||
|
final Cart one = cartService.getOne(cartLambdaQueryWrapper);
|
||||||
if (ObjectUtil.isNotEmpty(one)) {
|
if (ObjectUtil.isNotEmpty(one)) {
|
||||||
|
one.setIsNew(false);
|
||||||
one.setCartNum(one.getCartNum() + cart.getCartNum());
|
one.setCartNum(one.getCartNum() + cart.getCartNum());
|
||||||
cartService.updateById(one);
|
cartService.updateById(one);
|
||||||
return success("添加成功",one.getId());
|
return success("添加成功", one.getId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (cartService.save(cart)) {
|
if (cartService.save(cart)) {
|
||||||
return success("添加成功",cart.getId());
|
return success("添加成功", cart.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
return fail("添加失败");
|
return fail("添加失败");
|
||||||
@@ -157,10 +168,10 @@ public class CartController extends BaseController {
|
|||||||
@PutMapping("/onSelectAll/{yes}")
|
@PutMapping("/onSelectAll/{yes}")
|
||||||
public ApiResult<?> onSelectAll(@PathVariable("yes") Boolean yes) {
|
public ApiResult<?> onSelectAll(@PathVariable("yes") Boolean yes) {
|
||||||
if (ObjectUtil.isEmpty(getLoginUser())) {
|
if (ObjectUtil.isEmpty(getLoginUser())) {
|
||||||
return success("请先登录",null);
|
return success("请先登录", null);
|
||||||
}
|
}
|
||||||
final List<Cart> carts = cartService.list(new LambdaUpdateWrapper<Cart>()
|
final List<Cart> carts = cartService.list(new LambdaUpdateWrapper<Cart>()
|
||||||
.eq(Cart::getSelected,!yes)
|
.eq(Cart::getSelected, !yes)
|
||||||
.eq(Cart::getUserId, getLoginUserId()));
|
.eq(Cart::getUserId, getLoginUserId()));
|
||||||
carts.forEach(d -> {
|
carts.forEach(d -> {
|
||||||
d.setSelected(yes);
|
d.setSelected(yes);
|
||||||
|
|||||||
@@ -26,9 +26,7 @@ import org.springframework.util.CollectionUtils;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.*;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.gxwebsoft.common.core.utils.CommonUtil.toTreeData;
|
import static com.gxwebsoft.common.core.utils.CommonUtil.toTreeData;
|
||||||
@@ -61,7 +59,7 @@ public class GoodsCategoryController extends BaseController {
|
|||||||
// 收集分类ID
|
// 收集分类ID
|
||||||
final Set<Integer> categoryIds = goodsCategoryList.stream().map(GoodsCategory::getCategoryId).collect(Collectors.toSet());
|
final Set<Integer> categoryIds = goodsCategoryList.stream().map(GoodsCategory::getCategoryId).collect(Collectors.toSet());
|
||||||
if (categoryIds.isEmpty()) {
|
if (categoryIds.isEmpty()) {
|
||||||
return success("分类为空",goodsCategoryList);
|
return success("分类为空", goodsCategoryList);
|
||||||
}
|
}
|
||||||
// List转为树形结构
|
// List转为树形结构
|
||||||
final List<GoodsCategory> list = toTreeData(goodsCategoryList, 0, GoodsCategory::getParentId, GoodsCategory::getCategoryId, GoodsCategory::setChildren);
|
final List<GoodsCategory> list = toTreeData(goodsCategoryList, 0, GoodsCategory::getParentId, GoodsCategory::getCategoryId, GoodsCategory::setChildren);
|
||||||
@@ -104,9 +102,9 @@ public class GoodsCategoryController extends BaseController {
|
|||||||
public ApiResult<List<GoodsCategory>> listCategoryParentIdTree(@PathVariable("parentId") Integer parentId) {
|
public ApiResult<List<GoodsCategory>> listCategoryParentIdTree(@PathVariable("parentId") Integer parentId) {
|
||||||
// 查询非店铺分类
|
// 查询非店铺分类
|
||||||
final List<GoodsCategory> list = goodsCategoryService.list(new LambdaQueryWrapper<GoodsCategory>()
|
final List<GoodsCategory> list = goodsCategoryService.list(new LambdaQueryWrapper<GoodsCategory>()
|
||||||
.eq(GoodsCategory::getParentId,parentId)
|
.eq(GoodsCategory::getParentId, parentId)
|
||||||
.eq(GoodsCategory::getType,0)
|
.eq(GoodsCategory::getType, 0)
|
||||||
.eq(GoodsCategory::getMerchantId,0));
|
.eq(GoodsCategory::getMerchantId, 0));
|
||||||
|
|
||||||
final Set<Integer> categoryIds = list.stream().map(GoodsCategory::getCategoryId).collect(Collectors.toSet());
|
final Set<Integer> categoryIds = list.stream().map(GoodsCategory::getCategoryId).collect(Collectors.toSet());
|
||||||
final List<Goods> goods = goodsService.list(new LambdaQueryWrapper<Goods>().in(Goods::getCategoryId, categoryIds));
|
final List<Goods> goods = goodsService.list(new LambdaQueryWrapper<Goods>().in(Goods::getCategoryId, categoryIds));
|
||||||
@@ -121,9 +119,9 @@ public class GoodsCategoryController extends BaseController {
|
|||||||
final Map<Integer, List<GoodsSpec>> collectGoodsSpec = specs.stream().collect(Collectors.groupingBy(GoodsSpec::getGoodsId));
|
final Map<Integer, List<GoodsSpec>> collectGoodsSpec = specs.stream().collect(Collectors.groupingBy(GoodsSpec::getGoodsId));
|
||||||
|
|
||||||
LambdaQueryWrapper<Cart> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<Cart> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.in(Cart::getGoodsId, goodsIds).eq(Cart::getSelected,1);
|
wrapper.in(Cart::getGoodsId, goodsIds).eq(Cart::getSelected, 1);
|
||||||
if(ObjectUtil.isNotEmpty(getLoginUser())){
|
if (ObjectUtil.isNotEmpty(getLoginUser())) {
|
||||||
wrapper.eq(Cart::getUserId,getLoginUser().getUserId());
|
wrapper.eq(Cart::getUserId, getLoginUser().getUserId());
|
||||||
}
|
}
|
||||||
final List<Cart> carts = cartService.list();
|
final List<Cart> carts = cartService.list();
|
||||||
final Map<Integer, List<Cart>> collectCart = carts.stream().collect(Collectors.groupingBy(Cart::getGoodsId));
|
final Map<Integer, List<Cart>> collectCart = carts.stream().collect(Collectors.groupingBy(Cart::getGoodsId));
|
||||||
@@ -154,7 +152,7 @@ public class GoodsCategoryController extends BaseController {
|
|||||||
d.setGoods(goodsList);
|
d.setGoods(goodsList);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return success("请求成功",list);
|
return success("请求成功", list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("查询门店菜单分类及菜品数据(联动)")
|
@ApiOperation("查询门店菜单分类及菜品数据(联动)")
|
||||||
@@ -171,21 +169,28 @@ public class GoodsCategoryController extends BaseController {
|
|||||||
|
|
||||||
final Set<Integer> goodsIds = goods.stream().map(Goods::getGoodsId).collect(Collectors.toSet());
|
final Set<Integer> goodsIds = goods.stream().map(Goods::getGoodsId).collect(Collectors.toSet());
|
||||||
|
|
||||||
final List<GoodsSpec> specs = goodsSpecService.list(new LambdaQueryWrapper<GoodsSpec>().in(GoodsSpec::getGoodsId, goodsIds));
|
List<GoodsSpec> specs = new ArrayList<>();
|
||||||
|
Map<Integer, List<GoodsSpec>> collectGoodsSpec;
|
||||||
final Map<Integer, List<GoodsSpec>> collectGoodsSpec = specs.stream().collect(Collectors.groupingBy(GoodsSpec::getGoodsId));
|
if (!goodsIds.isEmpty()) {
|
||||||
|
specs = goodsSpecService.list(new LambdaQueryWrapper<GoodsSpec>().in(GoodsSpec::getGoodsId, goodsIds));
|
||||||
|
collectGoodsSpec = specs.stream().collect(Collectors.groupingBy(GoodsSpec::getGoodsId));
|
||||||
|
} else {
|
||||||
|
collectGoodsSpec = null;
|
||||||
|
}
|
||||||
|
|
||||||
list.forEach(d -> {
|
list.forEach(d -> {
|
||||||
d.setName(d.getTitle());
|
d.setName(d.getTitle());
|
||||||
final List<Goods> goodsList = collectGoods.get(d.getCategoryId());
|
final List<Goods> goodsList = collectGoods.get(d.getCategoryId());
|
||||||
if (!CollectionUtils.isEmpty(goodsList)) {
|
if (!CollectionUtils.isEmpty(goodsList)) {
|
||||||
goodsList.forEach(v -> {
|
goodsList.forEach(v -> {
|
||||||
|
if (collectGoodsSpec != null) {
|
||||||
final List<GoodsSpec> goodsSpecs = collectGoodsSpec.get(v.getGoodsId());
|
final List<GoodsSpec> goodsSpecs = collectGoodsSpec.get(v.getGoodsId());
|
||||||
if (!CollectionUtils.isEmpty(goodsSpecs)) {
|
if (!CollectionUtils.isEmpty(goodsSpecs)) {
|
||||||
final GoodsSpec spec = goodsSpecs.get(0);
|
final GoodsSpec spec = goodsSpecs.get(0);
|
||||||
v.setSpecValue(spec.getSpecValue());
|
v.setSpecValue(spec.getSpecValue());
|
||||||
v.setGoodsSpecValue(JSONUtil.parseObject(spec.getSpecValue(), Object.class));
|
v.setGoodsSpecValue(JSONUtil.parseObject(spec.getSpecValue(), Object.class));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
d.setGoods(collectGoods.get(d.getCategoryId()));
|
d.setGoods(collectGoods.get(d.getCategoryId()));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,16 @@ public class GoodsController extends BaseController {
|
|||||||
public ApiResult<Goods> get(@PathVariable("id") Integer id) {
|
public ApiResult<Goods> get(@PathVariable("id") Integer id) {
|
||||||
// 使用关联查询
|
// 使用关联查询
|
||||||
final Goods goods = goodsService.getByIdRel(id);
|
final Goods goods = goodsService.getByIdRel(id);
|
||||||
|
if (getLoginUser() != null) {
|
||||||
|
// 经销商
|
||||||
|
if (getLoginUser().getGradeId().equals(33)) {
|
||||||
|
if (goods.getDealerGift()) goods.setShowGift(true);
|
||||||
|
}
|
||||||
|
// 会员店
|
||||||
|
if (getLoginUser().getGradeId().equals(31)) {
|
||||||
|
if (goods.getPriceGift()) goods.setShowGift(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 提取specValue
|
// 提取specValue
|
||||||
final GoodsSpec spec = goodsSpecService.getOne(new LambdaQueryWrapper<GoodsSpec>().eq(GoodsSpec::getGoodsId, id).last("limit 1"));
|
final GoodsSpec spec = goodsSpecService.getOne(new LambdaQueryWrapper<GoodsSpec>().eq(GoodsSpec::getGoodsId, id).last("limit 1"));
|
||||||
@@ -82,6 +92,8 @@ public class GoodsController extends BaseController {
|
|||||||
if(loginUser.getGradeId().equals(0)){
|
if(loginUser.getGradeId().equals(0)){
|
||||||
goods.setPrice(goods.getSalePrice());
|
goods.setPrice(goods.getSalePrice());
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
goods.setPrice(goods.getSalePrice());
|
||||||
}
|
}
|
||||||
// 店铺信息
|
// 店铺信息
|
||||||
goods.setMerchant(merchantService.getOne(new LambdaUpdateWrapper<Merchant>().eq(Merchant::getMerchantId, goods.getMerchantId())));
|
goods.setMerchant(merchantService.getOne(new LambdaUpdateWrapper<Merchant>().eq(Merchant::getMerchantId, goods.getMerchantId())));
|
||||||
|
|||||||
@@ -0,0 +1,119 @@
|
|||||||
|
package com.gxwebsoft.shop.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.shop.service.GoodsIncomeConfigService;
|
||||||
|
import com.gxwebsoft.shop.entity.GoodsIncomeConfig;
|
||||||
|
import com.gxwebsoft.shop.param.GoodsIncomeConfigParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分润配置控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-06 17:55:50
|
||||||
|
*/
|
||||||
|
@Api(tags = "分润配置管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/shop/goods-income-config")
|
||||||
|
public class GoodsIncomeConfigController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private GoodsIncomeConfigService goodsIncomeConfigService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询分润配置")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<GoodsIncomeConfig>> page(GoodsIncomeConfigParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(goodsIncomeConfigService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部分润配置")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<GoodsIncomeConfig>> list(GoodsIncomeConfigParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(goodsIncomeConfigService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('shop:goodsIncomeConfig:list')")
|
||||||
|
@ApiOperation("根据id查询分润配置")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<GoodsIncomeConfig> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(goodsIncomeConfigService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加分润配置")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody GoodsIncomeConfig goodsIncomeConfig) {
|
||||||
|
GoodsIncomeConfig check = goodsIncomeConfigService.check(goodsIncomeConfig.getGoodsId(), goodsIncomeConfig.getSkuId(), goodsIncomeConfig.getMerchantShopType());
|
||||||
|
if (check != null) return fail("该配置已存在");
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
goodsIncomeConfig.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (goodsIncomeConfigService.save(goodsIncomeConfig)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改分润配置")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody GoodsIncomeConfig goodsIncomeConfig) {
|
||||||
|
GoodsIncomeConfig check = goodsIncomeConfigService.check(goodsIncomeConfig.getGoodsId(), goodsIncomeConfig.getSkuId(), goodsIncomeConfig.getMerchantShopType());
|
||||||
|
if (check != null && !check.getId().equals(goodsIncomeConfig.getId())) return fail("该配置已存在");
|
||||||
|
if (goodsIncomeConfigService.updateById(goodsIncomeConfig)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除分润配置")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (goodsIncomeConfigService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加分润配置")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<GoodsIncomeConfig> list) {
|
||||||
|
if (goodsIncomeConfigService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改分润配置")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<GoodsIncomeConfig> batchParam) {
|
||||||
|
if (batchParam.update(goodsIncomeConfigService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除分润配置")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (goodsIncomeConfigService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
package com.gxwebsoft.shop.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.shop.service.GoodsStockInMerchantService;
|
||||||
|
import com.gxwebsoft.shop.entity.GoodsStockInMerchant;
|
||||||
|
import com.gxwebsoft.shop.param.GoodsStockInMerchantParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户商品库存控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-05 02:33:23
|
||||||
|
*/
|
||||||
|
@Api(tags = "商户商品库存管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/shop/goods-stock-in-merchant")
|
||||||
|
public class GoodsStockInMerchantController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private GoodsStockInMerchantService goodsStockInMerchantService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询商户商品库存")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<GoodsStockInMerchant>> page(GoodsStockInMerchantParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(goodsStockInMerchantService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部商户商品库存")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<GoodsStockInMerchant>> list(GoodsStockInMerchantParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(goodsStockInMerchantService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('shop:goodsStockInMerchant:list')")
|
||||||
|
@ApiOperation("根据id查询商户商品库存")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<GoodsStockInMerchant> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(goodsStockInMerchantService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加商户商品库存")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody GoodsStockInMerchant goodsStockInMerchant) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
goodsStockInMerchant.setUserId(loginUser.getUserId());
|
||||||
|
goodsStockInMerchant.setMerchantId(loginUser.getMerchantId());
|
||||||
|
GoodsStockInMerchant check = goodsStockInMerchantService.check(loginUser.getMerchantId(), goodsStockInMerchant.getGoodsId(), goodsStockInMerchant.getSkuId());
|
||||||
|
if (check != null) {
|
||||||
|
check.setStock(goodsStockInMerchant.getStock());
|
||||||
|
goodsStockInMerchantService.updateById(goodsStockInMerchant);
|
||||||
|
return success("操作成功");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (goodsStockInMerchantService.save(goodsStockInMerchant)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改商户商品库存")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody GoodsStockInMerchant goodsStockInMerchant) {
|
||||||
|
if (goodsStockInMerchantService.updateById(goodsStockInMerchant)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除商户商品库存")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (goodsStockInMerchantService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加商户商品库存")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<GoodsStockInMerchant> list) {
|
||||||
|
if (goodsStockInMerchantService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改商户商品库存")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<GoodsStockInMerchant> batchParam) {
|
||||||
|
if (batchParam.update(goodsStockInMerchantService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除商户商品库存")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (goodsStockInMerchantService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package com.gxwebsoft.shop.controller;
|
|||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||||
import com.gxwebsoft.common.core.utils.RequestUtil;
|
import com.gxwebsoft.common.core.utils.RequestUtil;
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
import com.gxwebsoft.shop.entity.Merchant;
|
import com.gxwebsoft.shop.entity.Merchant;
|
||||||
@@ -27,6 +28,7 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -89,32 +91,53 @@ public class MerchantApplyController extends BaseController {
|
|||||||
|
|
||||||
@ApiOperation("修改商户入驻申请")
|
@ApiOperation("修改商户入驻申请")
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
public ApiResult<?> update(@RequestBody MerchantApply merchantApply) {
|
public ApiResult<?> update(@RequestBody MerchantApply merchantApply, HttpServletRequest request) {
|
||||||
if (merchantApply.getStatus().equals(1)) {
|
if (merchantApply.getStatus().equals(1)) {
|
||||||
// TODO 审核通过则创建商户
|
// TODO 审核通过则创建商户
|
||||||
final Merchant one = merchantService.getOne(new LambdaQueryWrapper<Merchant>().eq(Merchant::getPhone, merchantApply.getPhone()).last("limit 1"));
|
final Merchant one = merchantService.getOne(new LambdaQueryWrapper<Merchant>().eq(Merchant::getPhone, merchantApply.getPhone()).last("limit 1"));
|
||||||
final MerchantAccount merchantAccount = new MerchantAccount();
|
final MerchantAccount merchantAccount = new MerchantAccount();
|
||||||
BeanUtils.copyProperties(merchantApply, merchantAccount);
|
BeanUtils.copyProperties(merchantApply, merchantAccount);
|
||||||
|
|
||||||
final User user = new User();
|
final User user = new User();
|
||||||
|
final User loingUser = new User();
|
||||||
|
loingUser.setUserId(merchantAccount.getUserId());
|
||||||
|
|
||||||
if(ObjectUtil.isNotEmpty(one)){
|
Integer gradeId = 30;
|
||||||
|
if (ObjectUtil.isNotEmpty(one)) {
|
||||||
BeanUtils.copyProperties(merchantApply, one);
|
BeanUtils.copyProperties(merchantApply, one);
|
||||||
one.setStatus(0);
|
one.setStatus(0);
|
||||||
merchantService.updateById(one);
|
merchantService.updateById(one);
|
||||||
user.setMerchantId(one.getMerchantId());
|
user.setMerchantId(one.getMerchantId());
|
||||||
user.setMerchantName(one.getMerchantName());
|
user.setMerchantName(one.getMerchantName());
|
||||||
}else {
|
gradeId = switch (one.getShopType()) {
|
||||||
|
case "会员店" -> 31;
|
||||||
|
case "实体连锁店" -> 32;
|
||||||
|
case "经销商" -> 33;
|
||||||
|
case "供应商" -> 34;
|
||||||
|
default -> gradeId;
|
||||||
|
};
|
||||||
|
} else {
|
||||||
final Merchant merchant = new Merchant();
|
final Merchant merchant = new Merchant();
|
||||||
BeanUtils.copyProperties(merchantApply, merchant);
|
BeanUtils.copyProperties(merchantApply, merchant);
|
||||||
merchant.setStatus(0);
|
merchant.setStatus(0);
|
||||||
merchantService.save(merchant);
|
merchantService.save(merchant);
|
||||||
user.setMerchantId(merchant.getMerchantId());
|
user.setMerchantId(merchant.getMerchantId());
|
||||||
user.setMerchantName(merchant.getMerchantName());
|
user.setMerchantName(merchant.getMerchantName());
|
||||||
|
gradeId = switch (merchant.getShopType()) {
|
||||||
|
case "会员店" -> 31;
|
||||||
|
case "实体连锁店" -> 32;
|
||||||
|
case "经销商" -> 33;
|
||||||
|
case "供应商" -> 34;
|
||||||
|
default -> gradeId;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
loingUser.setGradeId(gradeId);
|
||||||
|
|
||||||
// TODO 创建商户账号
|
// TODO 创建商户账号
|
||||||
|
requestUtil.setAccessToken(JwtUtil.getAccessToken(request));
|
||||||
|
requestUtil.setTenantId(getTenantId().toString());
|
||||||
merchantAccount.setRealName(merchantApply.getRealName());
|
merchantAccount.setRealName(merchantApply.getRealName());
|
||||||
requestUtil.saveUserByPhone(merchantAccount);
|
requestUtil.saveUserByPhone(merchantAccount);
|
||||||
|
requestUtil.updateUser(loingUser);
|
||||||
// TODO 更新用户表的商户ID
|
// TODO 更新用户表的商户ID
|
||||||
requestUtil.updateUserMerchantId(user);
|
requestUtil.updateUserMerchantId(user);
|
||||||
|
|
||||||
|
|||||||
@@ -2,25 +2,22 @@ package com.gxwebsoft.shop.controller;
|
|||||||
|
|
||||||
import cn.hutool.core.date.DateField;
|
import cn.hutool.core.date.DateField;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.io.FileUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
|
import cn.hutool.core.util.RandomUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.gxwebsoft.cms.entity.Ad;
|
||||||
import com.gxwebsoft.common.core.exception.BusinessException;
|
import com.gxwebsoft.common.core.exception.BusinessException;
|
||||||
import com.gxwebsoft.common.core.security.JwtUtil;
|
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||||
import com.gxwebsoft.common.core.utils.CommonUtil;
|
import com.gxwebsoft.common.core.utils.CommonUtil;
|
||||||
import com.gxwebsoft.common.core.utils.RequestUtil;
|
import com.gxwebsoft.common.core.utils.RequestUtil;
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
import com.gxwebsoft.common.system.entity.Role;
|
import com.gxwebsoft.common.system.entity.Role;
|
||||||
import com.gxwebsoft.shop.entity.Cart;
|
import com.gxwebsoft.shop.entity.*;
|
||||||
import com.gxwebsoft.shop.entity.OrderGoods;
|
import com.gxwebsoft.shop.service.*;
|
||||||
import com.gxwebsoft.shop.entity.OrderInfo;
|
|
||||||
import com.gxwebsoft.shop.service.CartService;
|
|
||||||
import com.gxwebsoft.shop.service.OrderGoodsService;
|
|
||||||
import com.gxwebsoft.shop.service.OrderInfoService;
|
|
||||||
import com.gxwebsoft.shop.service.OrderService;
|
|
||||||
import com.gxwebsoft.shop.entity.Order;
|
|
||||||
import com.gxwebsoft.shop.param.OrderParam;
|
import com.gxwebsoft.shop.param.OrderParam;
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
@@ -28,15 +25,21 @@ import com.gxwebsoft.common.core.web.BatchParam;
|
|||||||
import com.gxwebsoft.common.system.entity.User;
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import me.chanjar.weixin.common.error.WxErrorException;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.IOException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static com.gxwebsoft.shop.consts.OrderPayType.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单控制器
|
* 订单控制器
|
||||||
*
|
*
|
||||||
@@ -57,11 +60,25 @@ public class OrderController extends BaseController {
|
|||||||
private CartService cartService;
|
private CartService cartService;
|
||||||
@Resource
|
@Resource
|
||||||
private RequestUtil requestUtil;
|
private RequestUtil requestUtil;
|
||||||
|
@Resource
|
||||||
|
private ExpressService expressService;
|
||||||
|
@Resource
|
||||||
|
private OrderDeliveryService orderDeliveryService;
|
||||||
|
@Autowired
|
||||||
|
private WeChatController weChatController;
|
||||||
|
@Autowired
|
||||||
|
private MerchantService merchantService;
|
||||||
|
|
||||||
|
@Value("${config.upload-path}")
|
||||||
|
private String uploadPath;
|
||||||
|
|
||||||
@ApiOperation("分页查询订单")
|
@ApiOperation("分页查询订单")
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
public ApiResult<PageResult<Order>> page(OrderParam param) {
|
public ApiResult<PageResult<Order>> page(OrderParam param) {
|
||||||
// 使用关联查询
|
// 使用关联查询
|
||||||
|
if (getLoginUser() != null) {
|
||||||
|
param.setLoginUser(getLoginUser());
|
||||||
|
}
|
||||||
return success(orderService.pageRel(param));
|
return success(orderService.pageRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,20 +93,47 @@ public class OrderController extends BaseController {
|
|||||||
@ApiOperation("根据id查询订单")
|
@ApiOperation("根据id查询订单")
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public ApiResult<Order> get(@PathVariable("id") Integer id) {
|
public ApiResult<Order> get(@PathVariable("id") Integer id) {
|
||||||
// 使用关联查询
|
Order order = orderService.getByIdRel(id);
|
||||||
return success(orderService.getByIdRel(id));
|
if (getLoginUser() != null) {
|
||||||
|
for (OrderGoods orderGoods : order.getGoodsList()) {
|
||||||
|
Goods goods = orderGoods.getGoods();
|
||||||
|
if (getLoginUser().getGradeId().equals(33)) {
|
||||||
|
if (goods.getDealerGift()) goods.setShowGift(true);
|
||||||
|
}
|
||||||
|
// 会员店
|
||||||
|
if (getLoginUser().getGradeId().equals(31)) {
|
||||||
|
if (goods.getPriceGift()) goods.setShowGift(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (order.getType().equals(0)) {
|
||||||
|
if (order.getDeliveryType().equals(0)) {
|
||||||
|
OrderDelivery orderDelivery = orderDeliveryService.getByOrderId(order.getOrderId());
|
||||||
|
if (orderDelivery != null) {
|
||||||
|
orderDelivery.setExpress(expressService.getById(orderDelivery.getExpressId()));
|
||||||
|
order.setOrderDelivery(orderDelivery);
|
||||||
|
}
|
||||||
|
} else if (order.getDeliveryType().equals(1) && order.getSelfTakeMerchantId() != null) {
|
||||||
|
Merchant merchant = merchantService.getById(order.getSelfTakeMerchantId());
|
||||||
|
order.setMerchant(merchant);
|
||||||
|
}
|
||||||
|
}else if (order.getType().equals(1)) {
|
||||||
|
Merchant merchant = merchantService.getById(order.getMerchantId());
|
||||||
|
order.setMerchant(merchant);
|
||||||
|
}
|
||||||
|
return success(order);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("根据orderNo查询订单")
|
@ApiOperation("根据orderNo查询订单")
|
||||||
@GetMapping("/getByOrderNo/{orderNo}")
|
@GetMapping("/getByOrderNo/{orderNo}")
|
||||||
public ApiResult<Order> getByOrderNo(@PathVariable("orderNo") String orderNo){
|
public ApiResult<Order> getByOrderNo(@PathVariable("orderNo") String orderNo) {
|
||||||
final User loginUser = getLoginUser();
|
final User loginUser = getLoginUser();
|
||||||
if(loginUser == null){
|
if (loginUser == null) {
|
||||||
return fail("请先登录",null);
|
return fail("请先登录", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
final Order order = orderService.getByOutTradeNo(orderNo);
|
final Order order = orderService.getByOutTradeNo(orderNo);
|
||||||
if(order != null){
|
if (order != null) {
|
||||||
final List<OrderInfo> orderInfoList = orderInfoService.list(new LambdaQueryWrapper<OrderInfo>().eq(OrderInfo::getOrderId, order.getOrderId()));
|
final List<OrderInfo> orderInfoList = orderInfoService.list(new LambdaQueryWrapper<OrderInfo>().eq(OrderInfo::getOrderId, order.getOrderId()));
|
||||||
order.setOrderInfo(orderInfoList);
|
order.setOrderInfo(orderInfoList);
|
||||||
}
|
}
|
||||||
@@ -100,32 +144,64 @@ public class OrderController extends BaseController {
|
|||||||
@PreAuthorize("hasAuthority('shop:order:verification')")
|
@PreAuthorize("hasAuthority('shop:order:verification')")
|
||||||
@ApiOperation("根据orderNo核销订单")
|
@ApiOperation("根据orderNo核销订单")
|
||||||
@GetMapping("/verification/{orderNo}")
|
@GetMapping("/verification/{orderNo}")
|
||||||
public ApiResult<Order> verification(@PathVariable("orderNo") String orderNo){
|
public ApiResult<Order> verification(@PathVariable("orderNo") String orderNo, HttpServletRequest request) {
|
||||||
final User loginUser = getLoginUser();
|
final User loginUser = getLoginUser();
|
||||||
if(loginUser == null){
|
if (loginUser == null) {
|
||||||
return fail("请先登录",null);
|
return fail("请先登录", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
final Set<String> collect = loginUser.getRoles().stream().map(Role::getRoleCode).collect(Collectors.toSet());
|
final Set<String> collect = loginUser.getRoles().stream().map(Role::getRoleCode).collect(Collectors.toSet());
|
||||||
final boolean merchant = Arrays.asList(collect).contains("merchant");
|
final boolean merchant = Arrays.asList(collect).contains("merchant");
|
||||||
final boolean merchantClerk = Arrays.asList(collect).contains("merchantClerk");
|
final boolean merchantClerk = Arrays.asList(collect).contains("merchantClerk");
|
||||||
|
|
||||||
if(merchant || merchantClerk){
|
if (merchant || merchantClerk) {
|
||||||
System.out.println("merchant = " + merchant);
|
System.out.println("merchant = " + merchant);
|
||||||
System.out.println("merchantClerk = " + merchantClerk);
|
System.out.println("merchantClerk = " + merchantClerk);
|
||||||
final Order order = orderService.getByOutTradeNo(orderNo);
|
final Order order = orderService.getByOutTradeNo(orderNo);
|
||||||
if(order != null){
|
if (order != null) {
|
||||||
final List<OrderInfo> orderInfoList = orderInfoService.list(new LambdaQueryWrapper<OrderInfo>().eq(OrderInfo::getOrderId, order.getOrderId()));
|
final List<OrderInfo> orderInfoList = orderInfoService.list(new LambdaQueryWrapper<OrderInfo>().eq(OrderInfo::getOrderId, order.getOrderId()));
|
||||||
order.setOrderInfo(orderInfoList);
|
order.setOrderInfo(orderInfoList);
|
||||||
}
|
}
|
||||||
return success(order);
|
return success(order);
|
||||||
}
|
}
|
||||||
return fail("核销失败",null);
|
return fail("核销失败", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("代付")
|
||||||
|
@PostMapping("/friend-pay")
|
||||||
|
public ApiResult<?> friendPay(@RequestBody Order orderTmp, HttpServletRequest request) throws IOException, WxErrorException {
|
||||||
|
Order order = orderService.getById(orderTmp.getOrderId());
|
||||||
|
String access_token = JwtUtil.getAccessToken(request);
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser == null) {
|
||||||
|
return fail("请先登录");
|
||||||
|
}
|
||||||
|
// 微信openid(必填)
|
||||||
|
if (StrUtil.isBlank(loginUser.getOpenid())) {
|
||||||
|
return fail("微信openid(必填)");
|
||||||
|
}
|
||||||
|
// 微信支付(商品金额不能为0)
|
||||||
|
if (order.getPayType().equals(PAY_TYPE_WECHAT)) {
|
||||||
|
if (order.getTotalPrice().compareTo(BigDecimal.ZERO) == 0) {
|
||||||
|
return fail("商品金额不能为0");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
order.setFriendPayType(orderTmp.getFriendPayType());
|
||||||
|
order.setOpenid(loginUser.getOpenid());
|
||||||
|
order.setOrderNo(Long.toString(IdUtil.getSnowflakeNextId()));
|
||||||
|
order.setAccessToken(access_token);
|
||||||
|
order.setPayUserId(loginUser.getUserId());
|
||||||
|
orderService.updateById(order);
|
||||||
|
order.setLoginUser(loginUser);
|
||||||
|
// 调起支付
|
||||||
|
order.setNotClearData(true);
|
||||||
|
return onPay(request, order);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation("下单")
|
@ApiOperation("下单")
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
public ApiResult<?> save(@RequestBody Order order, HttpServletRequest request) {
|
public ApiResult<?> save(@RequestBody Order order, HttpServletRequest request) throws IOException, WxErrorException {
|
||||||
String access_token = JwtUtil.getAccessToken(request);
|
String access_token = JwtUtil.getAccessToken(request);
|
||||||
// 记录当前登录用户id
|
// 记录当前登录用户id
|
||||||
User loginUser = getLoginUser();
|
User loginUser = getLoginUser();
|
||||||
@@ -140,50 +216,50 @@ public class OrderController extends BaseController {
|
|||||||
if (StrUtil.isBlank(order.getComments())) {
|
if (StrUtil.isBlank(order.getComments())) {
|
||||||
return fail("商品描述(必填)");
|
return fail("商品描述(必填)");
|
||||||
}
|
}
|
||||||
// 判断场地是否被抢占
|
|
||||||
if (order.getType().equals(1)) {
|
|
||||||
if (ObjectUtil.isNotEmpty(order.getOrderInfo())) {
|
|
||||||
order.getOrderInfo().forEach(d -> {
|
|
||||||
if (orderInfoService.count(new LambdaUpdateWrapper<OrderInfo>()
|
|
||||||
.eq(OrderInfo::getPayStatus,1)
|
|
||||||
.eq(OrderInfo::getOrderCode,d.getOrderCode())) > 0) {
|
|
||||||
order.setScene(1234);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if(order.getScene() != null && order.getScene().equals(1234)){
|
|
||||||
return fail("场地不存在");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 微信支付(商品金额不能为0)
|
// 微信支付(商品金额不能为0)
|
||||||
if (order.getPayType().equals(1)) {
|
if (order.getPayType().equals(PAY_TYPE_WECHAT)) {
|
||||||
if (order.getTotalPrice().compareTo(BigDecimal.ZERO) == 0) {
|
if (order.getTotalPrice().compareTo(BigDecimal.ZERO) == 0) {
|
||||||
return fail("商品金额不能为0");
|
return fail("商品金额不能为0");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 已下过订单
|
// 已下过订单
|
||||||
if(order.getOrderId() != null){
|
if (order.getOrderId() != null) {
|
||||||
Order order1 = orderService.getByIdRel(order.getOrderId());
|
Order order1 = orderService.getByIdRel(order.getOrderId());
|
||||||
order1.setPayType(order.getPayType());
|
order1.setPayType(order.getPayType());
|
||||||
order1.setOpenid(loginUser.getOpenid());
|
order1.setOpenid(loginUser.getOpenid());
|
||||||
order1.setOrderNo(Long.toString(IdUtil.getSnowflakeNextId()));
|
order1.setOrderNo(Long.toString(IdUtil.getSnowflakeNextId()));
|
||||||
order1.setAccessToken(access_token);
|
order1.setAccessToken(access_token);
|
||||||
order1.setLoginUser(loginUser);
|
order1.setLoginUser(loginUser);
|
||||||
|
order1.setPayUserId(loginUser.getUserId());
|
||||||
// 调起支付
|
// 调起支付
|
||||||
return onPay(order1);
|
return onPay(request, order1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建订单
|
// 创建订单
|
||||||
long timeMillis = System.currentTimeMillis();
|
long timeMillis = System.currentTimeMillis();
|
||||||
long orderNo = IdUtil.getSnowflakeNextId();
|
long orderNo = IdUtil.getSnowflakeNextId();
|
||||||
|
String name = loginUser.getRealName();
|
||||||
|
String phone = loginUser.getPhone();
|
||||||
|
String address = "";
|
||||||
|
if (order.getRealName() != null) {
|
||||||
|
name = order.getRealName();
|
||||||
|
}
|
||||||
|
if (order.getPhone() != null) {
|
||||||
|
phone = order.getPhone();
|
||||||
|
}
|
||||||
|
if (order.getAddress() != null) {
|
||||||
|
address = order.getAddress();
|
||||||
|
}
|
||||||
order.setOrderNo(Long.toString(orderNo));
|
order.setOrderNo(Long.toString(orderNo));
|
||||||
order.setUserId(loginUser.getUserId());
|
order.setUserId(loginUser.getUserId());
|
||||||
order.setOpenid(loginUser.getOpenid());
|
order.setOpenid(loginUser.getOpenid());
|
||||||
order.setRealName(loginUser.getRealName());
|
order.setRealName(name);
|
||||||
order.setPhone(loginUser.getPhone());
|
order.setPhone(phone);
|
||||||
|
order.setAddress(address);
|
||||||
order.setUserId(loginUser.getUserId());
|
order.setUserId(loginUser.getUserId());
|
||||||
order.setLoginUser(loginUser);
|
order.setLoginUser(loginUser);
|
||||||
|
order.setPayUserId(loginUser.getUserId());
|
||||||
order.setAccessToken(access_token);
|
order.setAccessToken(access_token);
|
||||||
order.setExpirationTime(DateUtil.offset(DateUtil.date(), DateField.MINUTE, 1));
|
order.setExpirationTime(DateUtil.offset(DateUtil.date(), DateField.MINUTE, 1));
|
||||||
if (order.getOrderInfo() != null) {
|
if (order.getOrderInfo() != null) {
|
||||||
@@ -192,6 +268,9 @@ public class OrderController extends BaseController {
|
|||||||
if (order.getGoodsList() != null) {
|
if (order.getGoodsList() != null) {
|
||||||
order.setTotalNum(order.getGoodsList().size());
|
order.setTotalNum(order.getGoodsList().size());
|
||||||
}
|
}
|
||||||
|
if (order.getDeliveryType().equals(1)) {
|
||||||
|
order.setSelfTakeCode(RandomUtil.randomString(4));
|
||||||
|
}
|
||||||
|
|
||||||
if (orderService.save(order)) {
|
if (orderService.save(order)) {
|
||||||
// 商城订单
|
// 商城订单
|
||||||
@@ -220,97 +299,103 @@ public class OrderController extends BaseController {
|
|||||||
});
|
});
|
||||||
orderInfoService.saveBatch(order.getOrderInfo());
|
orderInfoService.saveBatch(order.getOrderInfo());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// 会员卡订单
|
|
||||||
// if (order.getType().equals(2)) {
|
|
||||||
// // 会员卡信息
|
|
||||||
// final Card card = cardService.getByIdRel(Integer.valueOf(order.getCardId()));
|
|
||||||
// final UserCard userCard = new UserCard();
|
|
||||||
// userCard.setPhone(loginUser.getPhone());
|
|
||||||
// userCard.setSid(card.getMerchantIds());
|
|
||||||
// userCard.setCardNum(CommonUtil.createCardNo());
|
|
||||||
// userCard.setName(card.getCardName());
|
|
||||||
// userCard.setUsername(loginUser.getRealName());
|
|
||||||
// userCard.setPhone(loginUser.getPhone());
|
|
||||||
// userCard.setPrice(card.getPrice());
|
|
||||||
// userCard.setComments(card.getCardDesc());
|
|
||||||
// userCard.setInfo(card.getComments());
|
|
||||||
// userCard.setUid(loginUser.getUserId());
|
|
||||||
// userCard.setRemainingMoney(card.getPrice());
|
|
||||||
// userCard.setVid(0);
|
|
||||||
// userCard.setAid(0);
|
|
||||||
// userCard.setCode(CommonUtil.randomUUID8());
|
|
||||||
// userCard.setDiscount(card.getDiscount());
|
|
||||||
// userCard.setNumber(1);
|
|
||||||
// userCard.setNum(card.getNumber());
|
|
||||||
// userCard.setMonth(card.getMonth());
|
|
||||||
// userCard.setPayType(1);
|
|
||||||
// userCard.setType(card.getType());
|
|
||||||
// userCard.setTenantId(card.getTenantId());
|
|
||||||
// final long epochMilli = DateUtil.toInstant(DateUtil.offset(DateUtil.date(), DateField.MONTH, card.getMonth())).toEpochMilli();
|
|
||||||
// userCard.setExpireTime(epochMilli/1000);
|
|
||||||
// userCardService.save(userCard);
|
|
||||||
// order.setCardId(userCard.getId());
|
|
||||||
// }
|
|
||||||
// 调起支付
|
// 调起支付
|
||||||
return onPay(order);
|
return onPay(request, order);
|
||||||
}
|
}
|
||||||
return fail("下单失败");
|
return fail("下单失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
private ApiResult<?> onPay(Order order) {
|
private ApiResult<?> onPay(HttpServletRequest request, Order order) throws IOException, WxErrorException {
|
||||||
// TODO 余额支付
|
// 余额支付
|
||||||
if (order.getPayType().equals(0)) {
|
if (order.getPayType().equals(PAY_TYPE_BALANCE)) {
|
||||||
order.setAccessToken(order.getAccessToken());
|
order.setAccessToken(order.getAccessToken());
|
||||||
final User loginUser = order.getLoginUser();
|
final User loginUser = order.getLoginUser();
|
||||||
if (loginUser.getBalance().compareTo(order.getTotalPrice()) < 0) {
|
if (loginUser.getBalance().compareTo(order.getTotalPrice()) < 0) {
|
||||||
throw new BusinessException("余额不足");
|
throw new BusinessException("余额不足");
|
||||||
}
|
}
|
||||||
|
if (order.getNotClearData() == null) {
|
||||||
// 清空购物车
|
// 清空购物车
|
||||||
final Set<Integer> cartIds = order.getGoodsList().stream().map(OrderGoods::getGoodsId).collect(Collectors.toSet());
|
final Set<Integer> cartIds = order.getGoodsList().stream().map(OrderGoods::getGoodsId).collect(Collectors.toSet());
|
||||||
cartService.remove(new LambdaQueryWrapper<Cart>().eq(Cart::getUserId,order.getUserId()).in(Cart::getGoodsId,cartIds));
|
cartService.remove(new LambdaQueryWrapper<Cart>().eq(Cart::getUserId, order.getUserId()).in(Cart::getGoodsId, cartIds));
|
||||||
// 外卖订单
|
// 外卖订单
|
||||||
if(!order.getMerchantId().equals(0)){
|
if (!order.getMerchantId().equals(0)) {
|
||||||
cartService.remove(new LambdaQueryWrapper<Cart>().eq(Cart::getUserId,order.getUserId()).eq(Cart::getType,1));
|
cartService.remove(new LambdaQueryWrapper<Cart>().eq(Cart::getUserId, order.getUserId()).eq(Cart::getType, 1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return success("下单成功", requestUtil.balancePay(order));
|
return success("下单成功", requestUtil.balancePay(order));
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO 微信统一下单接口
|
// 微信统一下单接口
|
||||||
if (order.getPayType().equals(1)) {
|
if (order.getPayType().equals(PAY_TYPE_WECHAT)) {
|
||||||
// 清空购物车
|
// 清空购物车
|
||||||
|
if (order.getNotClearData() == null) {
|
||||||
final Set<Integer> cartIds = order.getGoodsList().stream().map(OrderGoods::getGoodsId).collect(Collectors.toSet());
|
final Set<Integer> cartIds = order.getGoodsList().stream().map(OrderGoods::getGoodsId).collect(Collectors.toSet());
|
||||||
cartService.remove(new LambdaQueryWrapper<Cart>().eq(Cart::getUserId,order.getUserId()).in(Cart::getGoodsId,cartIds));
|
cartService.remove(new LambdaQueryWrapper<Cart>().eq(Cart::getUserId, order.getUserId()).in(Cart::getGoodsId, cartIds));
|
||||||
// 外卖订单
|
// 外卖订单
|
||||||
if(!order.getMerchantId().equals(0)){
|
if (!order.getMerchantId().equals(0)) {
|
||||||
cartService.remove(new LambdaQueryWrapper<Cart>().eq(Cart::getUserId,order.getUserId()).eq(Cart::getType,1));
|
cartService.remove(new LambdaQueryWrapper<Cart>().eq(Cart::getUserId, order.getUserId()).eq(Cart::getType, 1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return success("下单成功", orderService.createWxOrder(order));
|
return success("下单成功", orderService.createWxOrder(order));
|
||||||
}
|
}
|
||||||
|
|
||||||
// // TODO 微信Native支付
|
// 代付
|
||||||
// if(order.getPayType().equals(102)){
|
if (order.getPayType().equals(PAY_TYPE_FRIEND)) {
|
||||||
// order.setAccessToken(access_token);
|
if (order.getFriendPayType() != null) {
|
||||||
// order.setLoginUser(loginUser);
|
if (order.getFriendPayType().equals(PAY_TYPE_BALANCE)) {
|
||||||
// return success("下单成功", orderService.payByWxNative(order));
|
order.setAccessToken(order.getAccessToken());
|
||||||
// }
|
final User loginUser = order.getLoginUser();
|
||||||
|
if (loginUser.getBalance().compareTo(order.getTotalPrice()) < 0) {
|
||||||
// TODO 会员卡支付
|
throw new BusinessException("余额不足");
|
||||||
// if(order.getPayType().equals(2)){
|
}
|
||||||
// order.setAccessToken(order.getAccessToken());
|
return success("下单成功", requestUtil.balancePay(order));
|
||||||
// System.out.println("getAccessToken = " + order.getAccessToken());
|
}
|
||||||
// return success("下单成功", orderService.payByUserCard(order));
|
if (order.getFriendPayType().equals(PAY_TYPE_WECHAT)) {
|
||||||
// }
|
return success("下单成功", orderService.createWxOrder(order));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String filepath = uploadPath + "qrcode/" + getTenantId();
|
||||||
|
if (!FileUtil.exist(filepath)) FileUtil.mkdir(filepath);
|
||||||
|
String filename = "/friendPay_" + order.getOrderId() + ".png";
|
||||||
|
weChatController.makeQr(request, filepath + filename, "orderId=" + order.getOrderId(), "package/order/friendPay");
|
||||||
|
return success("下单成功", "file/qrcode/" + getTenantId() + filename);
|
||||||
|
}
|
||||||
return fail("支付失败");
|
return fail("支付失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("自提")
|
||||||
|
@PostMapping("/self-take")
|
||||||
|
public ApiResult<?> selfTake(@RequestBody Order order, HttpServletRequest request) {
|
||||||
|
String access_token = JwtUtil.getAccessToken(request);
|
||||||
|
Order order1 = orderService.getById(order.getOrderId());
|
||||||
|
// if (!order1.getSelfTakeCode().equals(order.getSelfTakeCode())) return fail("自提码不正确");
|
||||||
|
if (order1.getOrderStatus().equals(1)) return fail("订单已完成");
|
||||||
|
order1.setOrderStatus(1);
|
||||||
|
orderService.updateById(order1);
|
||||||
|
orderService.settle(access_token, getTenantId().toString(), order1);
|
||||||
|
return success("提货成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("外卖确认收货")
|
||||||
|
@PostMapping("/out-take-confirm")
|
||||||
|
public ApiResult<?> outTakeConfirm(@RequestBody Order order, HttpServletRequest request) {
|
||||||
|
String access_token = JwtUtil.getAccessToken(request);
|
||||||
|
Order order1 = orderService.getById(order.getOrderId());
|
||||||
|
if (order1.getOrderStatus().equals(1)) return fail("订单已完成");
|
||||||
|
order1.setOrderStatus(1);
|
||||||
|
order1.setHasTakeGift(order.getHasTakeGift());
|
||||||
|
orderService.updateById(order1);
|
||||||
|
orderService.settle(access_token, getTenantId().toString(), order1);
|
||||||
|
return success("外卖确认收货");
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("修改订单")
|
@ApiOperation("修改订单")
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
public ApiResult<?> update(@RequestBody Order order) {
|
public ApiResult<?> update(@RequestBody Order order) {
|
||||||
if(order.getOrderStatus().equals(2)){
|
if (order.getOrderStatus().equals(2)) {
|
||||||
order.setExpirationTime(DateUtil.date());
|
order.setExpirationTime(DateUtil.date());
|
||||||
orderInfoService.update(new LambdaUpdateWrapper<OrderInfo>().eq(OrderInfo::getOrderId,order.getOrderId()).set(OrderInfo::getExpirationTime,DateUtil.date()));
|
orderInfoService.update(new LambdaUpdateWrapper<OrderInfo>().eq(OrderInfo::getOrderId, order.getOrderId()).set(OrderInfo::getExpirationTime, DateUtil.date()));
|
||||||
}
|
}
|
||||||
if (orderService.updateById(order)) {
|
if (orderService.updateById(order)) {
|
||||||
return success("操作成功");
|
return success("操作成功");
|
||||||
|
|||||||
@@ -1,10 +1,14 @@
|
|||||||
package com.gxwebsoft.shop.controller;
|
package com.gxwebsoft.shop.controller;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.http.HttpUtil;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.JSONUtil;
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
import com.gxwebsoft.shop.entity.Order;
|
import com.gxwebsoft.shop.entity.*;
|
||||||
import com.gxwebsoft.shop.service.OrderDeliveryService;
|
import com.gxwebsoft.shop.param.GoodsStockInMerchantParam;
|
||||||
import com.gxwebsoft.shop.entity.OrderDelivery;
|
import com.gxwebsoft.shop.service.*;
|
||||||
import com.gxwebsoft.shop.param.OrderDeliveryParam;
|
import com.gxwebsoft.shop.param.OrderDeliveryParam;
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
@@ -12,7 +16,10 @@ import com.gxwebsoft.common.core.web.PageParam;
|
|||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
import com.gxwebsoft.shop.service.OrderService;
|
import com.kuaidi100.sdk.pojo.HttpResult;
|
||||||
|
import com.kuaidi100.sdk.request.BOrderReq;
|
||||||
|
import com.kuaidi100.sdk.response.BOrderResp;
|
||||||
|
import com.kuaidi100.sdk.response.SubscribeResp;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
@@ -20,7 +27,11 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发货单控制器
|
* 发货单控制器
|
||||||
@@ -36,6 +47,16 @@ public class OrderDeliveryController extends BaseController {
|
|||||||
private OrderDeliveryService orderDeliveryService;
|
private OrderDeliveryService orderDeliveryService;
|
||||||
@Resource
|
@Resource
|
||||||
private OrderService orderService;
|
private OrderService orderService;
|
||||||
|
@Resource
|
||||||
|
private KuaiDi100 kuaiDi100;
|
||||||
|
@Resource
|
||||||
|
private ExpressService expressService;
|
||||||
|
@Resource
|
||||||
|
private OrderGoodsService orderGoodsService;
|
||||||
|
@Resource
|
||||||
|
private GoodsStockInMerchantService goodsStockInMerchantService;
|
||||||
|
@Resource
|
||||||
|
private MerchantService merchantService;
|
||||||
|
|
||||||
@ApiOperation("分页查询发货单")
|
@ApiOperation("分页查询发货单")
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@@ -44,6 +65,18 @@ public class OrderDeliveryController extends BaseController {
|
|||||||
return success(orderDeliveryService.pageRel(param));
|
return success(orderDeliveryService.pageRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("发货回调")
|
||||||
|
@PostMapping("/notify")
|
||||||
|
@GetMapping("/notify")
|
||||||
|
public SubscribeResp notify(@RequestBody Map<String, Object> data) {
|
||||||
|
System.out.println("快递100回调:" + data);
|
||||||
|
SubscribeResp subscribeResp = new SubscribeResp();
|
||||||
|
subscribeResp.setResult(Boolean.TRUE);
|
||||||
|
subscribeResp.setReturnCode("200");
|
||||||
|
subscribeResp.setMessage("成功");
|
||||||
|
return subscribeResp;
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("查询全部发货单")
|
@ApiOperation("查询全部发货单")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public ApiResult<List<OrderDelivery>> list(OrderDeliveryParam param) {
|
public ApiResult<List<OrderDelivery>> list(OrderDeliveryParam param) {
|
||||||
@@ -63,14 +96,57 @@ public class OrderDeliveryController extends BaseController {
|
|||||||
@PreAuthorize("hasAuthority('shop:orderDelivery:list')")
|
@PreAuthorize("hasAuthority('shop:orderDelivery:list')")
|
||||||
@ApiOperation("添加发货单")
|
@ApiOperation("添加发货单")
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
public ApiResult<?> save(@RequestBody OrderDelivery orderDelivery) {
|
public ApiResult<?> save(@RequestBody OrderDelivery orderDelivery, HttpServletRequest request) throws Exception {
|
||||||
|
String access_token = JwtUtil.getAccessToken(request);
|
||||||
|
String tenantId = getTenantId().toString();
|
||||||
|
Order order = orderService.getById(orderDelivery.getOrderId());
|
||||||
|
Merchant merchant = null;
|
||||||
|
// 根据最近的库存分配发货
|
||||||
|
List<OrderGoods> orderGoodsList = orderGoodsService.listByOrderId(orderDelivery.getOrderId());
|
||||||
|
List<GoodsStockInMerchant> goodsStockInMerchantList =
|
||||||
|
goodsStockInMerchantService.canExpressList(orderGoodsList.get(0).getGoodsId(), orderGoodsList.get(0).getTotalNum(), order.getAddressLat(), order.getAddressLng());
|
||||||
|
if (goodsStockInMerchantList.isEmpty()) return fail("暂无可发货店铺");
|
||||||
|
for (OrderGoods orderGoods : orderGoodsList) {
|
||||||
|
if (!goodsStockInMerchantList.isEmpty()) {
|
||||||
|
GoodsStockInMerchant usable = goodsStockInMerchantList.get(0);
|
||||||
|
GoodsStockInMerchant goodsStockInMerchant = goodsStockInMerchantService.check(usable.getMerchantId(), orderGoods.getGoodsId(), orderGoods.getSkuId());
|
||||||
|
if (goodsStockInMerchant == null || goodsStockInMerchant.getStock() < orderGoods.getTotalNum())
|
||||||
|
return fail("库存不足");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
merchant = merchantService.getById(goodsStockInMerchantList.get(0).getMerchantId());
|
||||||
|
if (merchant != null) {
|
||||||
|
// 商家发货
|
||||||
|
Express express = expressService.getByIdRel(orderDelivery.getExpressId());
|
||||||
|
BOrderReq bOrderReq = new BOrderReq();
|
||||||
|
bOrderReq.setKuaidicom(express.getKuaidi100Code());
|
||||||
|
bOrderReq.setSendManName(merchant.getMerchantName());
|
||||||
|
bOrderReq.setSendManMobile(merchant.getPhone());
|
||||||
|
bOrderReq.setSendManPrintAddr(merchant.getProvince() + merchant.getCity() + merchant.getRegion() + merchant.getAddress());
|
||||||
|
bOrderReq.setRecManName(order.getRealName());
|
||||||
|
bOrderReq.setRecManMobile(order.getPhone());
|
||||||
|
bOrderReq.setRecManPrintAddr(order.getAddress());
|
||||||
|
bOrderReq.setCallBackUrl("https://modules.gxwebsoft.com/api/shop/order-delivery/notify");
|
||||||
|
HttpResult res = kuaiDi100.border(bOrderReq);
|
||||||
|
// System.out.println("res.getBody():" + res.getBody());
|
||||||
|
if (res.getStatus() != 200) return fail("快递100接口异常");
|
||||||
|
KuaiDi100Resp kuaiDi100Resp = JSONUtil.parseObject(res.getBody(), KuaiDi100Resp.class);
|
||||||
|
if (kuaiDi100Resp == null) return fail("快递100接口异常");
|
||||||
|
if (!kuaiDi100Resp.getResult()) return fail(kuaiDi100Resp.getMessage());
|
||||||
|
Map<String, Object> bOrderData = (Map<String, Object>) kuaiDi100Resp.getData();
|
||||||
|
// System.out.println("kuaidinum:" + bOrderData.get("kuaidinum"));
|
||||||
|
orderDelivery.setExpressNo((String) bOrderData.get("kuaidinum"));
|
||||||
if (orderDeliveryService.save(orderDelivery)) {
|
if (orderDeliveryService.save(orderDelivery)) {
|
||||||
final Order order = orderService.getById(orderDelivery.getOrderId());
|
order.setExpressMerchantId(merchant.getMerchantId());
|
||||||
|
order.setExpressMerchantName(merchant.getMerchantName());
|
||||||
order.setDeliveryStatus(20);
|
order.setDeliveryStatus(20);
|
||||||
order.setDeliveryTime(DateUtil.date());
|
order.setDeliveryTime(DateUtil.date());
|
||||||
orderService.updateById(order);
|
orderService.updateById(order);
|
||||||
|
// 结算
|
||||||
|
orderService.settle(access_token, tenantId, order);
|
||||||
return success("操作成功");
|
return success("操作成功");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return fail("操作失败");
|
return fail("操作失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,6 +159,7 @@ public class OrderDeliveryController extends BaseController {
|
|||||||
}
|
}
|
||||||
return fail("修改失败");
|
return fail("修改失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:orderDelivery:list')")
|
@PreAuthorize("hasAuthority('shop:orderDelivery:list')")
|
||||||
@ApiOperation("删除发货单")
|
@ApiOperation("删除发货单")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
@@ -112,6 +189,7 @@ public class OrderDeliveryController extends BaseController {
|
|||||||
}
|
}
|
||||||
return fail("修改失败");
|
return fail("修改失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:orderDelivery:list')")
|
@PreAuthorize("hasAuthority('shop:orderDelivery:list')")
|
||||||
@ApiOperation("批量删除发货单")
|
@ApiOperation("批量删除发货单")
|
||||||
@DeleteMapping("/batch")
|
@DeleteMapping("/batch")
|
||||||
|
|||||||
@@ -0,0 +1,115 @@
|
|||||||
|
package com.gxwebsoft.shop.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.shop.service.SplashService;
|
||||||
|
import com.gxwebsoft.shop.entity.Splash;
|
||||||
|
import com.gxwebsoft.shop.param.SplashParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开屏广告控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-30 22:07:41
|
||||||
|
*/
|
||||||
|
@Api(tags = "开屏广告管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/shop/splash")
|
||||||
|
public class SplashController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private SplashService splashService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询开屏广告")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<Splash>> page(SplashParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(splashService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部开屏广告")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<Splash>> list(SplashParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(splashService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('shop:splash:list')")
|
||||||
|
@ApiOperation("根据id查询开屏广告")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<Splash> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(splashService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加开屏广告")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody Splash splash) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
splash.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (splashService.save(splash)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改开屏广告")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody Splash splash) {
|
||||||
|
if (splashService.updateById(splash)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除开屏广告")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (splashService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加开屏广告")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<Splash> list) {
|
||||||
|
if (splashService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改开屏广告")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Splash> batchParam) {
|
||||||
|
if (batchParam.update(splashService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除开屏广告")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (splashService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
package com.gxwebsoft.shop.controller;
|
||||||
|
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.shop.service.SwiperService;
|
||||||
|
import com.gxwebsoft.shop.entity.Swiper;
|
||||||
|
import com.gxwebsoft.shop.param.SwiperParam;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.BatchParam;
|
||||||
|
import com.gxwebsoft.common.core.annotation.OperationLog;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 轮播图控制器
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-30 22:07:41
|
||||||
|
*/
|
||||||
|
@Api(tags = "轮播图管理")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/shop/swiper")
|
||||||
|
public class SwiperController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private SwiperService swiperService;
|
||||||
|
|
||||||
|
@ApiOperation("分页查询轮播图")
|
||||||
|
@GetMapping("/page")
|
||||||
|
public ApiResult<PageResult<Swiper>> page(SwiperParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(swiperService.pageRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("查询全部轮播图")
|
||||||
|
@GetMapping()
|
||||||
|
public ApiResult<List<Swiper>> list(SwiperParam param) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(swiperService.listRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PreAuthorize("hasAuthority('shop:swiper:list')")
|
||||||
|
@ApiOperation("根据id查询轮播图")
|
||||||
|
@GetMapping("/{id}")
|
||||||
|
public ApiResult<Swiper> get(@PathVariable("id") Integer id) {
|
||||||
|
// 使用关联查询
|
||||||
|
return success(swiperService.getByIdRel(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("添加轮播图")
|
||||||
|
@PostMapping()
|
||||||
|
public ApiResult<?> save(@RequestBody Swiper swiper) {
|
||||||
|
// 记录当前登录用户id
|
||||||
|
User loginUser = getLoginUser();
|
||||||
|
if (loginUser != null) {
|
||||||
|
swiper.setUserId(loginUser.getUserId());
|
||||||
|
}
|
||||||
|
if (swiperService.save(swiper)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("修改轮播图")
|
||||||
|
@PutMapping()
|
||||||
|
public ApiResult<?> update(@RequestBody Swiper swiper) {
|
||||||
|
if (swiperService.updateById(swiper)) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("删除轮播图")
|
||||||
|
@DeleteMapping("/{id}")
|
||||||
|
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
||||||
|
if (swiperService.removeById(id)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量添加轮播图")
|
||||||
|
@PostMapping("/batch")
|
||||||
|
public ApiResult<?> saveBatch(@RequestBody List<Swiper> list) {
|
||||||
|
if (swiperService.saveBatch(list)) {
|
||||||
|
return success("添加成功");
|
||||||
|
}
|
||||||
|
return fail("添加失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量修改轮播图")
|
||||||
|
@PutMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody BatchParam<Swiper> batchParam) {
|
||||||
|
if (batchParam.update(swiperService, "id")) {
|
||||||
|
return success("修改成功");
|
||||||
|
}
|
||||||
|
return fail("修改失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation("批量删除轮播图")
|
||||||
|
@DeleteMapping("/batch")
|
||||||
|
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
||||||
|
if (swiperService.removeByIds(ids)) {
|
||||||
|
return success("删除成功");
|
||||||
|
}
|
||||||
|
return fail("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -62,6 +62,9 @@ public class UserAddressController extends BaseController {
|
|||||||
if (loginUser != null) {
|
if (loginUser != null) {
|
||||||
userAddress.setUserId(loginUser.getUserId());
|
userAddress.setUserId(loginUser.getUserId());
|
||||||
}
|
}
|
||||||
|
if (userAddress.getIsDefault() != null && userAddress.getIsDefault()) {
|
||||||
|
userAddressService.clearDefault(userAddress.getUserId());
|
||||||
|
}
|
||||||
if (userAddressService.save(userAddress)) {
|
if (userAddressService.save(userAddress)) {
|
||||||
return success("添加成功");
|
return success("添加成功");
|
||||||
}
|
}
|
||||||
@@ -72,7 +75,7 @@ public class UserAddressController extends BaseController {
|
|||||||
@PutMapping()
|
@PutMapping()
|
||||||
public ApiResult<?> update(@RequestBody UserAddress userAddress) {
|
public ApiResult<?> update(@RequestBody UserAddress userAddress) {
|
||||||
if (userAddress.getIsDefault() != null && userAddress.getIsDefault().equals(true)) {
|
if (userAddress.getIsDefault() != null && userAddress.getIsDefault().equals(true)) {
|
||||||
final boolean update = userAddressService.update(new LambdaUpdateWrapper<UserAddress>().eq(UserAddress::getUserId, getLoginUserId()).set(UserAddress::getIsDefault, 0));
|
userAddressService.clearDefault(userAddress.getUserId());
|
||||||
}
|
}
|
||||||
if (userAddressService.updateById(userAddress)) {
|
if (userAddressService.updateById(userAddress)) {
|
||||||
return success("修改成功");
|
return success("修改成功");
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import java.util.List;
|
|||||||
* 我的收藏控制器
|
* 我的收藏控制器
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-04-28 18:17:37
|
* @since 2024-10-03 01:51:46
|
||||||
*/
|
*/
|
||||||
@Api(tags = "我的收藏管理")
|
@Api(tags = "我的收藏管理")
|
||||||
@RestController
|
@RestController
|
||||||
@@ -31,6 +31,13 @@ public class UserCollectionController extends BaseController {
|
|||||||
@Resource
|
@Resource
|
||||||
private UserCollectionService userCollectionService;
|
private UserCollectionService userCollectionService;
|
||||||
|
|
||||||
|
@ApiOperation("检查收藏")
|
||||||
|
@PostMapping("/has-collect")
|
||||||
|
public ApiResult<?> check(@RequestBody UserCollection userCollection) {
|
||||||
|
UserCollection check = userCollectionService.check(getLoginUserId(), userCollection.getType(), userCollection.getTid());
|
||||||
|
return success(check != null);
|
||||||
|
}
|
||||||
|
|
||||||
@ApiOperation("分页查询我的收藏")
|
@ApiOperation("分页查询我的收藏")
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
public ApiResult<PageResult<UserCollection>> page(UserCollectionParam param) {
|
public ApiResult<PageResult<UserCollection>> page(UserCollectionParam param) {
|
||||||
@@ -40,8 +47,10 @@ public class UserCollectionController extends BaseController {
|
|||||||
|
|
||||||
@ApiOperation("查询全部我的收藏")
|
@ApiOperation("查询全部我的收藏")
|
||||||
@GetMapping()
|
@GetMapping()
|
||||||
public ApiResult<List<UserCollection>> list(UserCollectionParam param) {
|
public ApiResult<?> list(UserCollectionParam param) {
|
||||||
|
if (getLoginUser() == null) return fail("请先登录");
|
||||||
// 使用关联查询
|
// 使用关联查询
|
||||||
|
param.setUserId(getLoginUserId());
|
||||||
return success(userCollectionService.listRel(param));
|
return success(userCollectionService.listRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,10 +66,15 @@ public class UserCollectionController extends BaseController {
|
|||||||
@PostMapping()
|
@PostMapping()
|
||||||
public ApiResult<?> save(@RequestBody UserCollection userCollection) {
|
public ApiResult<?> save(@RequestBody UserCollection userCollection) {
|
||||||
// 记录当前登录用户id
|
// 记录当前登录用户id
|
||||||
// User loginUser = getLoginUser();
|
User loginUser = getLoginUser();
|
||||||
// if (loginUser != null) {
|
if (loginUser != null) {
|
||||||
// userCollection.setUserId(loginUser.getUserId());
|
userCollection.setUserId(loginUser.getUserId());
|
||||||
// }
|
}
|
||||||
|
UserCollection check = userCollectionService.check(getLoginUserId(), userCollection.getType(), userCollection.getTid());
|
||||||
|
if (check != null) {
|
||||||
|
userCollectionService.removeById(check.getId());
|
||||||
|
return success("取消成功");
|
||||||
|
}
|
||||||
if (userCollectionService.save(userCollection)) {
|
if (userCollectionService.save(userCollection)) {
|
||||||
return success("添加成功");
|
return success("添加成功");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,97 @@
|
|||||||
|
package com.gxwebsoft.shop.controller;
|
||||||
|
|
||||||
|
import cn.binarywang.wx.miniapp.api.WxMaQrcodeService;
|
||||||
|
import cn.binarywang.wx.miniapp.api.WxMaService;
|
||||||
|
import cn.binarywang.wx.miniapp.api.impl.WxMaQrcodeServiceImpl;
|
||||||
|
import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl;
|
||||||
|
import cn.binarywang.wx.miniapp.bean.WxMaCodeLineColor;
|
||||||
|
import cn.binarywang.wx.miniapp.config.impl.WxMaDefaultConfigImpl;
|
||||||
|
import cn.hutool.core.io.FileUtil;
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
|
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||||
|
import com.gxwebsoft.common.core.utils.RequestUtil;
|
||||||
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseController;
|
||||||
|
import com.gxwebsoft.shop.config.WxMaProperties;
|
||||||
|
import com.gxwebsoft.shop.entity.Order;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import me.chanjar.weixin.common.error.WxErrorException;
|
||||||
|
import me.chanjar.weixin.common.error.WxRuntimeException;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
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.RestController;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Api(tags = "微信相关")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/api/wechat")
|
||||||
|
public class WeChatController extends BaseController {
|
||||||
|
@Resource
|
||||||
|
private WxMaProperties wxMaProperties;
|
||||||
|
|
||||||
|
@Value("${config.upload-path}")
|
||||||
|
private String uploadPath;
|
||||||
|
|
||||||
|
@ApiOperation("好友代付二维码")
|
||||||
|
@PostMapping("/friend-pay-qr")
|
||||||
|
public ApiResult<String> makeFriendPayQr(@RequestBody Order order, HttpServletRequest request){
|
||||||
|
String filepath = uploadPath + "qrcode/" + getTenantId();
|
||||||
|
if (!FileUtil.exist(filepath)) FileUtil.mkdir(filepath);
|
||||||
|
String filename = "/friendPay_" + order.getOrderId() + ".png";
|
||||||
|
if (FileUtil.exist(filepath + "/" + filename)) return success("生成成功", "file/qrcode/" + getTenantId() + filename);
|
||||||
|
try {
|
||||||
|
makeQr(request, filename, order.getOrderId().toString(), "pages/index/index");
|
||||||
|
} catch (IOException | WxErrorException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return success("生成成功", "file/qrcode/" + getTenantId() + filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void makeQr(HttpServletRequest request, String filename, String scene, String page) throws IOException, WxErrorException {
|
||||||
|
// final RequestUtil requestUtil = new RequestUtil();
|
||||||
|
// String access_token = JwtUtil.getAccessToken(request);
|
||||||
|
// requestUtil.setAccessToken(access_token);
|
||||||
|
// requestUtil.setTenantId(getTenantId().toString());
|
||||||
|
// ApiResult<?> res = requestUtil.getWxConfig();
|
||||||
|
// System.out.println(res);
|
||||||
|
WxMaService wxMaService = wxMaService();
|
||||||
|
WxMaQrcodeService wxMaQrcodeService = new WxMaQrcodeServiceImpl(wxMaService);
|
||||||
|
WxMaCodeLineColor lineColor = new WxMaCodeLineColor();
|
||||||
|
lineColor.setR("0");
|
||||||
|
lineColor.setG("0");
|
||||||
|
lineColor.setB("0");
|
||||||
|
File file = wxMaQrcodeService.createWxaCodeUnlimit(scene, page, false, "develop", 200, false,
|
||||||
|
lineColor, false);
|
||||||
|
file.renameTo(new File(filename));
|
||||||
|
}
|
||||||
|
|
||||||
|
public WxMaService wxMaService() {
|
||||||
|
List<WxMaProperties.Config> configs = wxMaProperties.getConfigs();
|
||||||
|
if (configs == null) {
|
||||||
|
throw new WxRuntimeException("大哥,拜托先看下项目首页的说明(readme文件),添加下相关配置,注意别配错了!");
|
||||||
|
}
|
||||||
|
WxMaService maService = new WxMaServiceImpl();
|
||||||
|
maService.setMultiConfigs(
|
||||||
|
configs.stream()
|
||||||
|
.map(a -> {
|
||||||
|
WxMaDefaultConfigImpl config = new WxMaDefaultConfigImpl();
|
||||||
|
config.setAppid(a.getAppid());
|
||||||
|
config.setSecret(a.getSecret());
|
||||||
|
config.setToken(a.getToken());
|
||||||
|
config.setAesKey(a.getAesKey());
|
||||||
|
config.setMsgDataFormat(a.getMsgDataFormat());
|
||||||
|
return config;
|
||||||
|
}).collect(Collectors.toMap(WxMaDefaultConfigImpl::getAppid, a -> a, (o, n) -> o)));
|
||||||
|
return maService;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -82,7 +82,6 @@ public class WxPayNotifyNbgController extends BaseController {
|
|||||||
if (g.getStock().compareTo(0) >= 0) {
|
if (g.getStock().compareTo(0) >= 0) {
|
||||||
g.setStock(g.getStock() - goods2.getTotalNum());
|
g.setStock(g.getStock() - goods2.getTotalNum());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
final boolean batchById = goodsService.updateBatchById(goods);
|
final boolean batchById = goodsService.updateBatchById(goods);
|
||||||
System.out.println("batchById = " + batchById);
|
System.out.println("batchById = " + batchById);
|
||||||
|
|||||||
@@ -108,4 +108,7 @@ public class Cart implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<Cart> children;
|
private List<Cart> children;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Goods goods;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,12 @@ public class Goods implements Serializable {
|
|||||||
@ApiModelProperty(value = "商品分类ID")
|
@ApiModelProperty(value = "商品分类ID")
|
||||||
private Integer categoryId;
|
private Integer categoryId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "供应商")
|
||||||
|
private Integer supplierMerchantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "供应商")
|
||||||
|
private String supplierName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "商品规格 0单规格 1多规格")
|
@ApiModelProperty(value = "商品规格 0单规格 1多规格")
|
||||||
private Integer specs;
|
private Integer specs;
|
||||||
|
|
||||||
@@ -83,12 +89,36 @@ public class Goods implements Serializable {
|
|||||||
@ApiModelProperty(value = "经销商价格")
|
@ApiModelProperty(value = "经销商价格")
|
||||||
private BigDecimal dealerPrice;
|
private BigDecimal dealerPrice;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "连锁店价格")
|
||||||
|
private BigDecimal chainStorePrice;
|
||||||
|
private BigDecimal chainStoreRate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "会员店价格")
|
||||||
|
private BigDecimal memberStorePrice;
|
||||||
|
private BigDecimal memberStoreRate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "会员超市价格")
|
||||||
|
private BigDecimal memberMarketPrice;
|
||||||
|
private BigDecimal memberMarketRate;
|
||||||
|
|
||||||
@ApiModelProperty(value = "有赠品(经销商)")
|
@ApiModelProperty(value = "有赠品(经销商)")
|
||||||
private Boolean buyingGift;
|
private Boolean buyingGift;
|
||||||
|
|
||||||
@ApiModelProperty(value = "有赠品(会员店)")
|
@ApiModelProperty(value = "有赠品(会员店)")
|
||||||
private Boolean priceGift;
|
private Boolean priceGift;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "有赠品(经销商)")
|
||||||
|
private Boolean dealerGift;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "赠品数(经销商)")
|
||||||
|
private Integer buyingGiftNum;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "赠品数(会员店)")
|
||||||
|
private Integer priceGiftNum;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "赠品数(经销商)")
|
||||||
|
private Integer dealerGiftNum;
|
||||||
|
|
||||||
@ApiModelProperty(value = "库存计算方式(10下单减库存 20付款减库存)")
|
@ApiModelProperty(value = "库存计算方式(10下单减库存 20付款减库存)")
|
||||||
private Integer deductStockType;
|
private Integer deductStockType;
|
||||||
|
|
||||||
@@ -132,6 +162,9 @@ public class Goods implements Serializable {
|
|||||||
@ApiModelProperty(value = "用户ID")
|
@ApiModelProperty(value = "用户ID")
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否新品")
|
||||||
|
private Integer isNew;
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
@TableLogic
|
@TableLogic
|
||||||
private Integer deleted;
|
private Integer deleted;
|
||||||
@@ -188,6 +221,10 @@ public class Goods implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String parentPath;
|
private String parentPath;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否显示赠品")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Boolean showGift;
|
||||||
|
|
||||||
@ApiModelProperty(value = "当前栏目名称")
|
@ApiModelProperty(value = "当前栏目名称")
|
||||||
private String categoryName;
|
private String categoryName;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package com.gxwebsoft.shop.entity;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分润配置
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-06 17:55:50
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "GoodsIncomeConfig对象", description = "分润配置")
|
||||||
|
@TableName("shop_goods_income_config")
|
||||||
|
public class GoodsIncomeConfig implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private Integer goodsId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店铺类型")
|
||||||
|
private String merchantShopType;
|
||||||
|
|
||||||
|
private Integer skuId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "比例")
|
||||||
|
private BigDecimal rate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户id")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Goods goods;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private GoodsSku goodsSku;
|
||||||
|
}
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package com.gxwebsoft.shop.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户商品库存
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-05 02:33:23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "GoodsStockInMerchant对象", description = "商户商品库存")
|
||||||
|
@TableName("shop_goods_stock_in_merchant")
|
||||||
|
public class GoodsStockInMerchant implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
private Integer goodsId;
|
||||||
|
|
||||||
|
private Integer skuId;
|
||||||
|
|
||||||
|
private Integer num;
|
||||||
|
|
||||||
|
private Integer merchantId;
|
||||||
|
|
||||||
|
private Integer stock;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0上架 1待上架 2待审核 3审核不通过")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Goods goods;
|
||||||
|
|
||||||
|
}
|
||||||
11
src/main/java/com/gxwebsoft/shop/entity/KuaiDi100Resp.java
Normal file
11
src/main/java/com/gxwebsoft/shop/entity/KuaiDi100Resp.java
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
package com.gxwebsoft.shop.entity;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class KuaiDi100Resp {
|
||||||
|
private String message;
|
||||||
|
private Integer returnCode;
|
||||||
|
private Boolean result;
|
||||||
|
private Object data;
|
||||||
|
}
|
||||||
@@ -57,6 +57,8 @@ public class Merchant implements Serializable {
|
|||||||
|
|
||||||
private Integer merchantCategoryId;
|
private Integer merchantCategoryId;
|
||||||
|
|
||||||
|
private Integer canExpress;
|
||||||
|
|
||||||
private String merchantCategoryTitle;
|
private String merchantCategoryTitle;
|
||||||
|
|
||||||
@ApiModelProperty(value = "经纬度")
|
@ApiModelProperty(value = "经纬度")
|
||||||
@@ -66,6 +68,12 @@ public class Merchant implements Serializable {
|
|||||||
|
|
||||||
private String lat;
|
private String lat;
|
||||||
|
|
||||||
|
private String startTime;
|
||||||
|
|
||||||
|
private String endTime;
|
||||||
|
|
||||||
|
private Integer isOn;
|
||||||
|
|
||||||
@ApiModelProperty(value = "所在省份")
|
@ApiModelProperty(value = "所在省份")
|
||||||
private String province;
|
private String province;
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,9 @@ public class Order implements Serializable {
|
|||||||
@ApiModelProperty(value = "订单类型,0商城订单 1预定订单 2会员卡")
|
@ApiModelProperty(value = "订单类型,0商城订单 1预定订单 2会员卡")
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "类型,0快递 1自提")
|
||||||
|
private Integer deliveryType;
|
||||||
|
|
||||||
@ApiModelProperty(value = "下单渠道,0普通预定 1俱乐部训练场 3活动订场")
|
@ApiModelProperty(value = "下单渠道,0普通预定 1俱乐部训练场 3活动订场")
|
||||||
private Integer channel;
|
private Integer channel;
|
||||||
|
|
||||||
@@ -82,6 +85,16 @@ public class Order implements Serializable {
|
|||||||
@ApiModelProperty(value = "手机号码")
|
@ApiModelProperty(value = "手机号码")
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "收货地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
private String addressLat;
|
||||||
|
|
||||||
|
private String addressLng;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "自提码")
|
||||||
|
private String selfTakeCode;
|
||||||
|
|
||||||
@ApiModelProperty(value = "订单总额")
|
@ApiModelProperty(value = "订单总额")
|
||||||
private BigDecimal totalPrice;
|
private BigDecimal totalPrice;
|
||||||
|
|
||||||
@@ -113,6 +126,8 @@ public class Order implements Serializable {
|
|||||||
@ApiModelProperty(value = "0余额支付, 1微信支付,2积分,3支付宝,4现金,5POS机,6VIP月卡,7VIP年卡,8VIP次卡,9IC月卡,10IC年卡,11IC次卡,12免费,13VIP充值卡,14IC充值卡,15积分支付,16VIP季卡,17IC季卡")
|
@ApiModelProperty(value = "0余额支付, 1微信支付,2积分,3支付宝,4现金,5POS机,6VIP月卡,7VIP年卡,8VIP次卡,9IC月卡,10IC年卡,11IC次卡,12免费,13VIP充值卡,14IC充值卡,15积分支付,16VIP季卡,17IC季卡")
|
||||||
private Integer payType;
|
private Integer payType;
|
||||||
|
|
||||||
|
private Integer friendPayType;
|
||||||
|
|
||||||
@ApiModelProperty(value = "0未付款,1已付款")
|
@ApiModelProperty(value = "0未付款,1已付款")
|
||||||
private Integer payStatus;
|
private Integer payStatus;
|
||||||
|
|
||||||
@@ -149,6 +164,12 @@ public class Order implements Serializable {
|
|||||||
@ApiModelProperty(value = "发票流水号")
|
@ApiModelProperty(value = "发票流水号")
|
||||||
private String invoiceNo;
|
private String invoiceNo;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "外卖开始时间")
|
||||||
|
private String sendStartTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "外卖结束时间")
|
||||||
|
private String sendEndTime;
|
||||||
|
|
||||||
@ApiModelProperty(value = "支付时间")
|
@ApiModelProperty(value = "支付时间")
|
||||||
private Date payTime;
|
private Date payTime;
|
||||||
|
|
||||||
@@ -177,6 +198,21 @@ public class Order implements Serializable {
|
|||||||
@ApiModelProperty(value = "用户id")
|
@ApiModelProperty(value = "用户id")
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
|
|
||||||
|
private Integer payUserId;
|
||||||
|
|
||||||
|
private Integer selfTakeMerchantId;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Merchant selfTakeMerchant;
|
||||||
|
|
||||||
|
private String selfTakeMerchantName;
|
||||||
|
|
||||||
|
private Integer expressMerchantId;
|
||||||
|
|
||||||
|
private String expressMerchantName;
|
||||||
|
|
||||||
|
private Integer hasTakeGift;
|
||||||
|
|
||||||
@ApiModelProperty(value = "备注")
|
@ApiModelProperty(value = "备注")
|
||||||
private String comments;
|
private String comments;
|
||||||
|
|
||||||
@@ -220,4 +256,13 @@ public class Order implements Serializable {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private List<OrderGoods> goodsList;
|
private List<OrderGoods> goodsList;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "不清数据")
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Boolean notClearData;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private OrderDelivery orderDelivery;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Merchant merchant;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
package com.gxwebsoft.shop.entity;
|
package com.gxwebsoft.shop.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@@ -64,4 +62,8 @@ public class OrderDelivery implements Serializable {
|
|||||||
@ApiModelProperty(value = "修改时间")
|
@ApiModelProperty(value = "修改时间")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Express express;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ public class OrderGoods implements Serializable {
|
|||||||
@ApiModelProperty(value = "关联商品id")
|
@ApiModelProperty(value = "关联商品id")
|
||||||
private Integer goodsId;
|
private Integer goodsId;
|
||||||
|
|
||||||
|
private Integer skuId;
|
||||||
|
|
||||||
@ApiModelProperty(value = "商品名称")
|
@ApiModelProperty(value = "商品名称")
|
||||||
private String goodsName;
|
private String goodsName;
|
||||||
|
|
||||||
@@ -108,4 +110,7 @@ public class OrderGoods implements Serializable {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "创建时间")
|
@ApiModelProperty(value = "创建时间")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Goods goods;
|
||||||
}
|
}
|
||||||
|
|||||||
64
src/main/java/com/gxwebsoft/shop/entity/Splash.java
Normal file
64
src/main/java/com/gxwebsoft/shop/entity/Splash.java
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
package com.gxwebsoft.shop.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开屏广告
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-30 22:07:41
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "Splash对象", description = "开屏广告")
|
||||||
|
@TableName("shop_splash")
|
||||||
|
public class Splash implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图片")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "跳转类型")
|
||||||
|
private String jumpType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "跳转主键")
|
||||||
|
private Integer jumpPk;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
68
src/main/java/com/gxwebsoft/shop/entity/Swiper.java
Normal file
68
src/main/java/com/gxwebsoft/shop/entity/Swiper.java
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
package com.gxwebsoft.shop.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 轮播图
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-30 22:07:41
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@ApiModel(value = "Swiper对象", description = "轮播图")
|
||||||
|
@TableName("shop_swiper")
|
||||||
|
public class Swiper implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所属页面")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图片")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "跳转类型")
|
||||||
|
private String jumpType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "跳转主键")
|
||||||
|
private Integer jumpPk;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
private String color;
|
||||||
|
|
||||||
|
private String color1;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@TableLogic
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "租户id")
|
||||||
|
private Integer tenantId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "修改时间")
|
||||||
|
private LocalDateTime updateTime;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -50,6 +50,12 @@ public class UserAddress implements Serializable {
|
|||||||
@ApiModelProperty(value = "收货地址")
|
@ApiModelProperty(value = "收货地址")
|
||||||
private String address;
|
private String address;
|
||||||
|
|
||||||
|
private String fullAddress;
|
||||||
|
|
||||||
|
private String lat;
|
||||||
|
|
||||||
|
private String lng;
|
||||||
|
|
||||||
@ApiModelProperty(value = "1先生 2女士")
|
@ApiModelProperty(value = "1先生 2女士")
|
||||||
private Integer gender;
|
private Integer gender;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.gxwebsoft.shop.entity;
|
package com.gxwebsoft.shop.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
@@ -14,7 +15,7 @@ import lombok.EqualsAndHashCode;
|
|||||||
* 我的收藏
|
* 我的收藏
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-04-28 18:17:37
|
* @since 2024-10-03 01:51:46
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@@ -27,6 +28,9 @@ public class UserCollection implements Serializable {
|
|||||||
@TableId(value = "id", type = IdType.AUTO)
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "0店铺,1商品")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
@ApiModelProperty(value = "租户ID")
|
@ApiModelProperty(value = "租户ID")
|
||||||
private Integer tid;
|
private Integer tid;
|
||||||
|
|
||||||
@@ -39,4 +43,6 @@ public class UserCollection implements Serializable {
|
|||||||
@ApiModelProperty(value = "注册时间")
|
@ApiModelProperty(value = "注册时间")
|
||||||
private LocalDateTime createTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Merchant merchant;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.shop.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.shop.entity.GoodsIncomeConfig;
|
||||||
|
import com.gxwebsoft.shop.param.GoodsIncomeConfigParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分润配置Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-06 17:55:50
|
||||||
|
*/
|
||||||
|
public interface GoodsIncomeConfigMapper extends BaseMapper<GoodsIncomeConfig> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<GoodsIncomeConfig>
|
||||||
|
*/
|
||||||
|
List<GoodsIncomeConfig> selectPageRel(@Param("page") IPage<GoodsIncomeConfig> page,
|
||||||
|
@Param("param") GoodsIncomeConfigParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<GoodsIncomeConfig> selectListRel(@Param("param") GoodsIncomeConfigParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package com.gxwebsoft.shop.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
|
import com.gxwebsoft.shop.entity.GoodsStockInMerchant;
|
||||||
|
import com.gxwebsoft.shop.param.GoodsStockInMerchantParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户商品库存Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-05 02:33:23
|
||||||
|
*/
|
||||||
|
public interface GoodsStockInMerchantMapper extends MPJBaseMapper<GoodsStockInMerchant> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<GoodsStockInMerchant>
|
||||||
|
*/
|
||||||
|
List<GoodsStockInMerchant> selectPageRel(@Param("page") IPage<GoodsStockInMerchant> page,
|
||||||
|
@Param("param") GoodsStockInMerchantParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<GoodsStockInMerchant> selectListRel(@Param("param") GoodsStockInMerchantParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,6 +2,7 @@ package com.gxwebsoft.shop.mapper;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.github.yulichang.base.MPJBaseMapper;
|
||||||
import com.gxwebsoft.shop.entity.Merchant;
|
import com.gxwebsoft.shop.entity.Merchant;
|
||||||
import com.gxwebsoft.shop.param.MerchantParam;
|
import com.gxwebsoft.shop.param.MerchantParam;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
@@ -14,7 +15,7 @@ import java.util.List;
|
|||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-04-05 00:03:54
|
* @since 2024-04-05 00:03:54
|
||||||
*/
|
*/
|
||||||
public interface MerchantMapper extends BaseMapper<Merchant> {
|
public interface MerchantMapper extends MPJBaseMapper<Merchant> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
|
|||||||
37
src/main/java/com/gxwebsoft/shop/mapper/SplashMapper.java
Normal file
37
src/main/java/com/gxwebsoft/shop/mapper/SplashMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.shop.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.shop.entity.Splash;
|
||||||
|
import com.gxwebsoft.shop.param.SplashParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开屏广告Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-30 22:07:41
|
||||||
|
*/
|
||||||
|
public interface SplashMapper extends BaseMapper<Splash> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Splash>
|
||||||
|
*/
|
||||||
|
List<Splash> selectPageRel(@Param("page") IPage<Splash> page,
|
||||||
|
@Param("param") SplashParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<Splash> selectListRel(@Param("param") SplashParam param);
|
||||||
|
|
||||||
|
}
|
||||||
37
src/main/java/com/gxwebsoft/shop/mapper/SwiperMapper.java
Normal file
37
src/main/java/com/gxwebsoft/shop/mapper/SwiperMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
package com.gxwebsoft.shop.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.gxwebsoft.shop.entity.Swiper;
|
||||||
|
import com.gxwebsoft.shop.param.SwiperParam;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 轮播图Mapper
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-30 22:07:41
|
||||||
|
*/
|
||||||
|
public interface SwiperMapper extends BaseMapper<Swiper> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param page 分页对象
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Swiper>
|
||||||
|
*/
|
||||||
|
List<Swiper> selectPageRel(@Param("page") IPage<Swiper> page,
|
||||||
|
@Param("param") SwiperParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<User>
|
||||||
|
*/
|
||||||
|
List<Swiper> selectListRel(@Param("param") SwiperParam param);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -12,7 +12,7 @@ import java.util.List;
|
|||||||
* 我的收藏Mapper
|
* 我的收藏Mapper
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-04-28 18:17:37
|
* @since 2024-10-03 01:51:46
|
||||||
*/
|
*/
|
||||||
public interface UserCollectionMapper extends BaseMapper<UserCollection> {
|
public interface UserCollectionMapper extends BaseMapper<UserCollection> {
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,9 @@
|
|||||||
<if test="param.isNew != null">
|
<if test="param.isNew != null">
|
||||||
AND a.is_new = #{param.isNew}
|
AND a.is_new = #{param.isNew}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="param.isShow != null">
|
||||||
|
AND a.is_show = #{param.isShow}
|
||||||
|
</if>
|
||||||
<if test="param.combinationId != null">
|
<if test="param.combinationId != null">
|
||||||
AND a.combination_id = #{param.combinationId}
|
AND a.combination_id = #{param.combinationId}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
<?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.gxwebsoft.shop.mapper.GoodsIncomeConfigMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM shop_goods_income_config a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.goodsId != null">
|
||||||
|
AND a.goods_id = #{param.goodsId}
|
||||||
|
</if>
|
||||||
|
<if test="param.merchantShopType != null">
|
||||||
|
AND a.merchant_shop_type LIKE CONCAT('%', #{param.merchantShopType}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.spec != null">
|
||||||
|
AND a.spec LIKE CONCAT('%', #{param.spec}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.rate != null">
|
||||||
|
AND a.rate = #{param.rate}
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.GoodsIncomeConfig">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.GoodsIncomeConfig">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -71,9 +71,9 @@
|
|||||||
<if test="param.parentId != null">
|
<if test="param.parentId != null">
|
||||||
AND a.category_id IN (SELECT category_id FROM shop_goods_category WHERE parent_id=#{param.parentId})
|
AND a.category_id IN (SELECT category_id FROM shop_goods_category WHERE parent_id=#{param.parentId})
|
||||||
</if>
|
</if>
|
||||||
<!-- <if test="param.merchantIds != null">-->
|
<!-- <if test="param.merchantIds != null">-->
|
||||||
<!-- AND a.category_id IN (SELECT category_id FROM shop_goods_category WHERE parent_id=#{param.parentId})-->
|
<!-- AND a.category_id IN (SELECT category_id FROM shop_goods_category WHERE parent_id=#{param.parentId})-->
|
||||||
<!-- </if>-->
|
<!-- </if>-->
|
||||||
<if test="param.shopIdsByIndustry != null">
|
<if test="param.shopIdsByIndustry != null">
|
||||||
AND a.merchant_id IN
|
AND a.merchant_id IN
|
||||||
<foreach collection="param.shopIdsByIndustry" item="item" separator="," open="(" close=")">
|
<foreach collection="param.shopIdsByIndustry" item="item" separator="," open="(" close=")">
|
||||||
@@ -123,6 +123,12 @@
|
|||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
<if test="param.orderBy != null">
|
||||||
|
ORDER BY ${param.orderBy}
|
||||||
|
</if>
|
||||||
|
<if test="param.orderBy == null">
|
||||||
|
ORDER BY a.sort_number ASC, a.create_time DESC
|
||||||
|
</if>
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 分页查询 -->
|
<!-- 分页查询 -->
|
||||||
|
|||||||
@@ -0,0 +1,69 @@
|
|||||||
|
<?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.gxwebsoft.shop.mapper.GoodsStockInMerchantMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM shop_goods_stock_in_merchant a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.goodsId != null">
|
||||||
|
AND a.goods_id = #{param.goodsId}
|
||||||
|
</if>
|
||||||
|
<if test="param.skuId != null">
|
||||||
|
AND a.sku_id = #{param.skuId}
|
||||||
|
</if>
|
||||||
|
<if test="param.num != null">
|
||||||
|
AND a.num = #{param.num}
|
||||||
|
</if>
|
||||||
|
<if test="param.merchantId != null">
|
||||||
|
AND a.merchant_id = #{param.merchantId}
|
||||||
|
</if>
|
||||||
|
<if test="param.stock != null">
|
||||||
|
AND a.stock = #{param.stock}
|
||||||
|
</if>
|
||||||
|
<if test="param.status != null">
|
||||||
|
AND a.status = #{param.status}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.GoodsStockInMerchant">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.GoodsStockInMerchant">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -165,6 +165,7 @@
|
|||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
ORDER BY a.order_id DESC
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<!-- 分页查询 -->
|
<!-- 分页查询 -->
|
||||||
|
|||||||
63
src/main/java/com/gxwebsoft/shop/mapper/xml/SplashMapper.xml
Normal file
63
src/main/java/com/gxwebsoft/shop/mapper/xml/SplashMapper.xml
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
<?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.gxwebsoft.shop.mapper.SplashMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM shop_splash a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.title != null">
|
||||||
|
AND a.title LIKE CONCAT('%', #{param.title}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.image != null">
|
||||||
|
AND a.image LIKE CONCAT('%', #{param.image}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.jumpType != null">
|
||||||
|
AND a.jump_type LIKE CONCAT('%', #{param.jumpType}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.jumpPk != null">
|
||||||
|
AND a.jump_pk = #{param.jumpPk}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.Splash">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.Splash">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
63
src/main/java/com/gxwebsoft/shop/mapper/xml/SwiperMapper.xml
Normal file
63
src/main/java/com/gxwebsoft/shop/mapper/xml/SwiperMapper.xml
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
<?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.gxwebsoft.shop.mapper.SwiperMapper">
|
||||||
|
|
||||||
|
<!-- 关联查询sql -->
|
||||||
|
<sql id="selectSql">
|
||||||
|
SELECT a.*
|
||||||
|
FROM shop_swiper a
|
||||||
|
<where>
|
||||||
|
<if test="param.id != null">
|
||||||
|
AND a.id = #{param.id}
|
||||||
|
</if>
|
||||||
|
<if test="param.type != null">
|
||||||
|
AND a.type LIKE CONCAT('%', #{param.type}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.image != null">
|
||||||
|
AND a.image LIKE CONCAT('%', #{param.image}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.jumpType != null">
|
||||||
|
AND a.jump_type LIKE CONCAT('%', #{param.jumpType}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.jumpPk != null">
|
||||||
|
AND a.jump_pk = #{param.jumpPk}
|
||||||
|
</if>
|
||||||
|
<if test="param.comments != null">
|
||||||
|
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="param.sortNumber != null">
|
||||||
|
AND a.sort_number = #{param.sortNumber}
|
||||||
|
</if>
|
||||||
|
<if test="param.userId != null">
|
||||||
|
AND a.user_id = #{param.userId}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted != null">
|
||||||
|
AND a.deleted = #{param.deleted}
|
||||||
|
</if>
|
||||||
|
<if test="param.deleted == null">
|
||||||
|
AND a.deleted = 0
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeStart != null">
|
||||||
|
AND a.create_time >= #{param.createTimeStart}
|
||||||
|
</if>
|
||||||
|
<if test="param.createTimeEnd != null">
|
||||||
|
AND a.create_time <= #{param.createTimeEnd}
|
||||||
|
</if>
|
||||||
|
<if test="param.keywords != null">
|
||||||
|
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<!-- 分页查询 -->
|
||||||
|
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.Swiper">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 查询全部 -->
|
||||||
|
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.Swiper">
|
||||||
|
<include refid="selectSql"></include>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -10,6 +10,9 @@
|
|||||||
<if test="param.id != null">
|
<if test="param.id != null">
|
||||||
AND a.id = #{param.id}
|
AND a.id = #{param.id}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="param.type != null">
|
||||||
|
AND a.type = #{param.type}
|
||||||
|
</if>
|
||||||
<if test="param.tid != null">
|
<if test="param.tid != null">
|
||||||
AND a.tid = #{param.tid}
|
AND a.tid = #{param.tid}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
@@ -1,10 +1,13 @@
|
|||||||
package com.gxwebsoft.shop.param;
|
package com.gxwebsoft.shop.param;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
import com.gxwebsoft.common.core.web.BaseParam;
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import io.swagger.models.auth.In;
|
import io.swagger.models.auth.In;
|
||||||
@@ -55,6 +58,8 @@ public class CartParam extends BaseParam {
|
|||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Boolean isNew;
|
private Boolean isNew;
|
||||||
|
|
||||||
|
private Boolean isShow;
|
||||||
|
|
||||||
@ApiModelProperty(value = "拼团id")
|
@ApiModelProperty(value = "拼团id")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer combinationId;
|
private Integer combinationId;
|
||||||
@@ -70,6 +75,9 @@ public class CartParam extends BaseParam {
|
|||||||
@ApiModelProperty(value = "用户ID")
|
@ApiModelProperty(value = "用户ID")
|
||||||
private Integer userId;
|
private Integer userId;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private User loginUser;
|
||||||
|
|
||||||
@ApiModelProperty(value = "是否选中")
|
@ApiModelProperty(value = "是否选中")
|
||||||
private Boolean selected;
|
private Boolean selected;
|
||||||
|
|
||||||
@@ -84,4 +92,6 @@ public class CartParam extends BaseParam {
|
|||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer shopId;
|
private Integer shopId;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Boolean withMerchantInfo;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.gxwebsoft.shop.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分润配置查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-06 17:55:50
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "GoodsIncomeConfigParam对象", description = "分润配置查询参数")
|
||||||
|
public class GoodsIncomeConfigParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer goodsId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "店铺类型")
|
||||||
|
private String merchantShopType;
|
||||||
|
|
||||||
|
private String spec;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "比例")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private BigDecimal rate;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户id")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -145,4 +145,10 @@ public class GoodsParam extends BaseParam {
|
|||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private User loginUser;
|
private User loginUser;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String orderBy;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String orderDir;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.gxwebsoft.shop.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户商品库存查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-05 02:33:23
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "GoodsStockInMerchantParam对象", description = "商户商品库存查询参数")
|
||||||
|
public class GoodsStockInMerchantParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer goodsId;
|
||||||
|
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer skuId;
|
||||||
|
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer num;
|
||||||
|
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer merchantId;
|
||||||
|
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer stock;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "状态, 0上架 1待上架 2待审核 3审核不通过")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,10 +3,12 @@ package com.gxwebsoft.shop.param;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
import com.gxwebsoft.common.core.web.BaseParam;
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -210,4 +212,6 @@ public class OrderParam extends BaseParam {
|
|||||||
@QueryField(type = QueryType.GT)
|
@QueryField(type = QueryType.GT)
|
||||||
private Date expirationTime;
|
private Date expirationTime;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private User loginUser;
|
||||||
}
|
}
|
||||||
|
|||||||
57
src/main/java/com/gxwebsoft/shop/param/SplashParam.java
Normal file
57
src/main/java/com/gxwebsoft/shop/param/SplashParam.java
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
package com.gxwebsoft.shop.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开屏广告查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-30 22:07:41
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "SplashParam对象", description = "开屏广告查询参数")
|
||||||
|
public class SplashParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "标题")
|
||||||
|
private String title;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图片")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "跳转类型")
|
||||||
|
private String jumpType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "跳转主键")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer jumpPk;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
}
|
||||||
57
src/main/java/com/gxwebsoft/shop/param/SwiperParam.java
Normal file
57
src/main/java/com/gxwebsoft/shop/param/SwiperParam.java
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
package com.gxwebsoft.shop.param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryField;
|
||||||
|
import com.gxwebsoft.common.core.annotation.QueryType;
|
||||||
|
import com.gxwebsoft.common.core.web.BaseParam;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 轮播图查询参数
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-30 22:07:41
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
|
@ApiModel(value = "SwiperParam对象", description = "轮播图查询参数")
|
||||||
|
public class SwiperParam extends BaseParam {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "所属页面")
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "图片")
|
||||||
|
private String image;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "跳转类型")
|
||||||
|
private String jumpType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "跳转主键")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer jumpPk;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "备注")
|
||||||
|
private String comments;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "排序号")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer sortNumber;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户ID")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer userId;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "是否删除, 0否, 1是")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer deleted;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -14,7 +14,7 @@ import lombok.EqualsAndHashCode;
|
|||||||
* 我的收藏查询参数
|
* 我的收藏查询参数
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-04-28 18:17:37
|
* @since 2024-10-03 01:51:46
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@@ -27,6 +27,10 @@ public class UserCollectionParam extends BaseParam {
|
|||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer id;
|
private Integer id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "0店铺,1商品")
|
||||||
|
@QueryField(type = QueryType.EQ)
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
@ApiModelProperty(value = "租户ID")
|
@ApiModelProperty(value = "租户ID")
|
||||||
@QueryField(type = QueryType.EQ)
|
@QueryField(type = QueryType.EQ)
|
||||||
private Integer tid;
|
private Integer tid;
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.gxwebsoft.shop.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.shop.entity.GoodsIncomeConfig;
|
||||||
|
import com.gxwebsoft.shop.param.GoodsIncomeConfigParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分润配置Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-06 17:55:50
|
||||||
|
*/
|
||||||
|
public interface GoodsIncomeConfigService extends IService<GoodsIncomeConfig> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<GoodsIncomeConfig>
|
||||||
|
*/
|
||||||
|
PageResult<GoodsIncomeConfig> pageRel(GoodsIncomeConfigParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<GoodsIncomeConfig>
|
||||||
|
*/
|
||||||
|
List<GoodsIncomeConfig> listRel(GoodsIncomeConfigParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return GoodsIncomeConfig
|
||||||
|
*/
|
||||||
|
GoodsIncomeConfig getByIdRel(Integer id);
|
||||||
|
|
||||||
|
GoodsIncomeConfig check(Integer goodsId, Integer skuId, String merchantShopType);
|
||||||
|
}
|
||||||
@@ -45,7 +45,7 @@ public interface GoodsService extends IService<Goods> {
|
|||||||
List<Goods> getGoodsSpec();
|
List<Goods> getGoodsSpec();
|
||||||
|
|
||||||
// 商城商品
|
// 商城商品
|
||||||
List<Goods> getGoodsSpecType0();
|
List<Goods> getGoodsSpecType0(GoodsParam param);
|
||||||
// 外卖商品
|
// 外卖商品
|
||||||
List<Goods> getGoodsSpecType1();
|
List<Goods> getGoodsSpecType1();
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ public interface GoodsSkuService extends IService<GoodsSku> {
|
|||||||
*/
|
*/
|
||||||
List<GoodsSku> listRel(GoodsSkuParam param);
|
List<GoodsSku> listRel(GoodsSkuParam param);
|
||||||
|
|
||||||
|
List<GoodsSku> listByGoods(Integer goodsId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询
|
* 根据id查询
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.gxwebsoft.shop.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.shop.entity.GoodsStockInMerchant;
|
||||||
|
import com.gxwebsoft.shop.param.GoodsStockInMerchantParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户商品库存Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-05 02:33:23
|
||||||
|
*/
|
||||||
|
public interface GoodsStockInMerchantService extends IService<GoodsStockInMerchant> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<GoodsStockInMerchant>
|
||||||
|
*/
|
||||||
|
PageResult<GoodsStockInMerchant> pageRel(GoodsStockInMerchantParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<GoodsStockInMerchant>
|
||||||
|
*/
|
||||||
|
List<GoodsStockInMerchant> listRel(GoodsStockInMerchantParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return GoodsStockInMerchant
|
||||||
|
*/
|
||||||
|
GoodsStockInMerchant getByIdRel(Integer id);
|
||||||
|
|
||||||
|
GoodsStockInMerchant check(Integer merchantId, Integer goodsId, Integer skuId);
|
||||||
|
|
||||||
|
List<GoodsStockInMerchant> canExpressList(Integer goodsId, Integer stock, String lat, String lng);
|
||||||
|
}
|
||||||
17
src/main/java/com/gxwebsoft/shop/service/KuaiDi100.java
Normal file
17
src/main/java/com/gxwebsoft/shop/service/KuaiDi100.java
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
package com.gxwebsoft.shop.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.kuaidi100.sdk.pojo.HttpResult;
|
||||||
|
import com.kuaidi100.sdk.request.BOrderReq;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface KuaiDi100 {
|
||||||
|
/**
|
||||||
|
* 商家寄件
|
||||||
|
* @param bOrderReq
|
||||||
|
* @return
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
HttpResult border(BOrderReq bOrderReq) throws Exception;
|
||||||
|
}
|
||||||
@@ -39,4 +39,5 @@ public interface MerchantService extends IService<Merchant> {
|
|||||||
*/
|
*/
|
||||||
Merchant getByIdRel(Integer merchantId);
|
Merchant getByIdRel(Integer merchantId);
|
||||||
|
|
||||||
|
Merchant getByUserId(Integer userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,4 +39,5 @@ public interface OrderDeliveryService extends IService<OrderDelivery> {
|
|||||||
*/
|
*/
|
||||||
OrderDelivery getByIdRel(Integer deliveryId);
|
OrderDelivery getByIdRel(Integer deliveryId);
|
||||||
|
|
||||||
|
OrderDelivery getByOrderId(Integer orderId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ public interface OrderGoodsService extends IService<OrderGoods> {
|
|||||||
*/
|
*/
|
||||||
List<OrderGoods> listRel(OrderGoodsParam param);
|
List<OrderGoods> listRel(OrderGoodsParam param);
|
||||||
|
|
||||||
|
List<OrderGoods> listByOrderId(Integer orderId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询
|
* 根据id查询
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -49,5 +49,7 @@ public interface OrderService extends IService<Order> {
|
|||||||
|
|
||||||
Boolean payByBalance(Order order);
|
Boolean payByBalance(Order order);
|
||||||
|
|
||||||
|
void settle(String token, String tenantId, Order order);
|
||||||
|
|
||||||
// String payByWxNative(Order order);
|
// String payByWxNative(Order order);
|
||||||
}
|
}
|
||||||
|
|||||||
42
src/main/java/com/gxwebsoft/shop/service/SplashService.java
Normal file
42
src/main/java/com/gxwebsoft/shop/service/SplashService.java
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.shop.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.shop.entity.Splash;
|
||||||
|
import com.gxwebsoft.shop.param.SplashParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开屏广告Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-30 22:07:41
|
||||||
|
*/
|
||||||
|
public interface SplashService extends IService<Splash> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<Splash>
|
||||||
|
*/
|
||||||
|
PageResult<Splash> pageRel(SplashParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Splash>
|
||||||
|
*/
|
||||||
|
List<Splash> listRel(SplashParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return Splash
|
||||||
|
*/
|
||||||
|
Splash getByIdRel(Integer id);
|
||||||
|
|
||||||
|
}
|
||||||
42
src/main/java/com/gxwebsoft/shop/service/SwiperService.java
Normal file
42
src/main/java/com/gxwebsoft/shop/service/SwiperService.java
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
package com.gxwebsoft.shop.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.shop.entity.Swiper;
|
||||||
|
import com.gxwebsoft.shop.param.SwiperParam;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 轮播图Service
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-30 22:07:41
|
||||||
|
*/
|
||||||
|
public interface SwiperService extends IService<Swiper> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页关联查询
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return PageResult<Swiper>
|
||||||
|
*/
|
||||||
|
PageResult<Swiper> pageRel(SwiperParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联查询全部
|
||||||
|
*
|
||||||
|
* @param param 查询参数
|
||||||
|
* @return List<Swiper>
|
||||||
|
*/
|
||||||
|
List<Swiper> listRel(SwiperParam param);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return Swiper
|
||||||
|
*/
|
||||||
|
Swiper getByIdRel(Integer id);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -39,4 +39,5 @@ public interface UserAddressService extends IService<UserAddress> {
|
|||||||
*/
|
*/
|
||||||
UserAddress getByIdRel(Integer id);
|
UserAddress getByIdRel(Integer id);
|
||||||
|
|
||||||
|
void clearDefault(Integer userId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import java.util.List;
|
|||||||
* 我的收藏Service
|
* 我的收藏Service
|
||||||
*
|
*
|
||||||
* @author 科技小王子
|
* @author 科技小王子
|
||||||
* @since 2024-04-28 18:17:37
|
* @since 2024-10-03 01:51:46
|
||||||
*/
|
*/
|
||||||
public interface UserCollectionService extends IService<UserCollection> {
|
public interface UserCollectionService extends IService<UserCollection> {
|
||||||
|
|
||||||
@@ -39,4 +39,5 @@ public interface UserCollectionService extends IService<UserCollection> {
|
|||||||
*/
|
*/
|
||||||
UserCollection getByIdRel(Integer id);
|
UserCollection getByIdRel(Integer id);
|
||||||
|
|
||||||
|
UserCollection check(Integer userId, Integer type, Integer tid);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,17 +9,22 @@ import com.gxwebsoft.common.system.entity.Dict;
|
|||||||
import com.gxwebsoft.common.system.entity.DictData;
|
import com.gxwebsoft.common.system.entity.DictData;
|
||||||
import com.gxwebsoft.shop.entity.Goods;
|
import com.gxwebsoft.shop.entity.Goods;
|
||||||
import com.gxwebsoft.shop.entity.GoodsSpec;
|
import com.gxwebsoft.shop.entity.GoodsSpec;
|
||||||
|
import com.gxwebsoft.shop.entity.Merchant;
|
||||||
import com.gxwebsoft.shop.mapper.CartMapper;
|
import com.gxwebsoft.shop.mapper.CartMapper;
|
||||||
import com.gxwebsoft.shop.service.CartService;
|
import com.gxwebsoft.shop.service.CartService;
|
||||||
import com.gxwebsoft.shop.entity.Cart;
|
import com.gxwebsoft.shop.entity.Cart;
|
||||||
import com.gxwebsoft.shop.param.CartParam;
|
import com.gxwebsoft.shop.param.CartParam;
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.shop.service.GoodsService;
|
||||||
|
import com.gxwebsoft.shop.service.MerchantService;
|
||||||
import com.gxwebsoft.shop.vo.CartShopVo;
|
import com.gxwebsoft.shop.vo.CartShopVo;
|
||||||
import com.gxwebsoft.shop.vo.CartVo;
|
import com.gxwebsoft.shop.vo.CartVo;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -33,6 +38,10 @@ import java.util.stream.Stream;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class CartServiceImpl extends ServiceImpl<CartMapper, Cart> implements CartService {
|
public class CartServiceImpl extends ServiceImpl<CartMapper, Cart> implements CartService {
|
||||||
|
@Resource
|
||||||
|
private GoodsService goodsService;
|
||||||
|
@Resource
|
||||||
|
private MerchantService merchantService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<Cart> pageRel(CartParam param) {
|
public PageResult<Cart> pageRel(CartParam param) {
|
||||||
@@ -56,6 +65,18 @@ public class CartServiceImpl extends ServiceImpl<CartMapper, Cart> implements Ca
|
|||||||
// 计算单品总价
|
// 计算单品总价
|
||||||
for (Cart cart : carts) {
|
for (Cart cart : carts) {
|
||||||
cart.setTotalPrice(cart.getPrice().multiply(BigDecimal.valueOf(cart.getCartNum())));
|
cart.setTotalPrice(cart.getPrice().multiply(BigDecimal.valueOf(cart.getCartNum())));
|
||||||
|
Goods goods = goodsService.getById(cart.getGoodsId());
|
||||||
|
if (param.getLoginUser() != null) {
|
||||||
|
// 经销商
|
||||||
|
if (param.getLoginUser().getGradeId().equals(33)) {
|
||||||
|
if (goods.getDealerGift()) goods.setShowGift(true);
|
||||||
|
}
|
||||||
|
// 会员店
|
||||||
|
if (param.getLoginUser().getGradeId().equals(31)) {
|
||||||
|
if (goods.getPriceGift()) goods.setShowGift(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cart.setGoods(goods);
|
||||||
}
|
}
|
||||||
// 计算购物车金额
|
// 计算购物车金额
|
||||||
final Integer cartNum = carts.stream().map(Cart::getCartNum).reduce(Integer::sum).orElse(0);
|
final Integer cartNum = carts.stream().map(Cart::getCartNum).reduce(Integer::sum).orElse(0);
|
||||||
@@ -74,6 +95,10 @@ public class CartServiceImpl extends ServiceImpl<CartMapper, Cart> implements Ca
|
|||||||
shopVo.setShopName(cart.getMerchantName());
|
shopVo.setShopName(cart.getMerchantName());
|
||||||
shopVo.setShopLogo(cart.getImage());
|
shopVo.setShopLogo(cart.getImage());
|
||||||
}
|
}
|
||||||
|
if (param.getWithMerchantInfo() != null) {
|
||||||
|
Merchant merchant = merchantService.getById(shopId);
|
||||||
|
shopVo.setMerchant(merchant);
|
||||||
|
}
|
||||||
shops.add(shopVo);
|
shops.add(shopVo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,23 +127,23 @@ public class CartServiceImpl extends ServiceImpl<CartMapper, Cart> implements Ca
|
|||||||
mpjLambdaWrapper.selectAll(Cart.class)
|
mpjLambdaWrapper.selectAll(Cart.class)
|
||||||
.select(Goods::getGoodsName)
|
.select(Goods::getGoodsName)
|
||||||
.select(Goods::getImage)
|
.select(Goods::getImage)
|
||||||
.leftJoin(Goods.class,Goods::getGoodsId,Cart::getGoodsId).eq(Cart::getUserId,param.getUserId());
|
.leftJoin(Goods.class, Goods::getGoodsId, Cart::getGoodsId).eq(Cart::getUserId, param.getUserId());
|
||||||
|
|
||||||
// 查询选中状态
|
// 查询选中状态
|
||||||
if(param.getSelected() != null){
|
if (param.getSelected() != null) {
|
||||||
mpjLambdaWrapper.eq(Cart::getSelected, param.getSelected());
|
mpjLambdaWrapper.eq(Cart::getSelected, param.getSelected());
|
||||||
}
|
}
|
||||||
// 商品类型 0商城 1预定
|
// 商品类型 0商城 1预定
|
||||||
if(param.getType() != null){
|
if (param.getType() != null) {
|
||||||
mpjLambdaWrapper.eq(Cart::getType,param.getType());
|
mpjLambdaWrapper.eq(Cart::getType, param.getType());
|
||||||
}
|
}
|
||||||
// 是否为立即购买
|
// 是否为立即购买
|
||||||
if(param.getIsNew() != null){
|
if (param.getIsNew() != null) {
|
||||||
mpjLambdaWrapper.eq(Cart::getIsNew,param.getIsNew());
|
mpjLambdaWrapper.eq(Cart::getIsNew, param.getIsNew());
|
||||||
}
|
}
|
||||||
// 指定cartId
|
// 指定cartId
|
||||||
if(param.getId() != null){
|
if (param.getId() != null) {
|
||||||
mpjLambdaWrapper.eq(Cart::getId,param.getId());
|
mpjLambdaWrapper.eq(Cart::getId, param.getId());
|
||||||
}
|
}
|
||||||
System.out.println("mpjLambdaWrapper = " + mpjLambdaWrapper);
|
System.out.println("mpjLambdaWrapper = " + mpjLambdaWrapper);
|
||||||
return baseMapper.selectJoinList(Cart.class, mpjLambdaWrapper);
|
return baseMapper.selectJoinList(Cart.class, mpjLambdaWrapper);
|
||||||
|
|||||||
@@ -0,0 +1,71 @@
|
|||||||
|
package com.gxwebsoft.shop.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.shop.mapper.GoodsIncomeConfigMapper;
|
||||||
|
import com.gxwebsoft.shop.service.GoodsIncomeConfigService;
|
||||||
|
import com.gxwebsoft.shop.entity.GoodsIncomeConfig;
|
||||||
|
import com.gxwebsoft.shop.param.GoodsIncomeConfigParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import com.gxwebsoft.shop.service.GoodsService;
|
||||||
|
import com.gxwebsoft.shop.service.GoodsSkuService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分润配置Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-06 17:55:50
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class GoodsIncomeConfigServiceImpl extends ServiceImpl<GoodsIncomeConfigMapper, GoodsIncomeConfig> implements GoodsIncomeConfigService {
|
||||||
|
@Resource
|
||||||
|
private GoodsSkuService goodsSkuService;
|
||||||
|
@Resource
|
||||||
|
private GoodsService goodsService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<GoodsIncomeConfig> pageRel(GoodsIncomeConfigParam param) {
|
||||||
|
PageParam<GoodsIncomeConfig, GoodsIncomeConfigParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
List<GoodsIncomeConfig> list = baseMapper.selectPageRel(page, param);
|
||||||
|
for (GoodsIncomeConfig goodsIncomeConfig : list) {
|
||||||
|
goodsIncomeConfig.setGoods(goodsService.getById(goodsIncomeConfig.getGoodsId()));
|
||||||
|
if (goodsIncomeConfig.getSkuId() != null) {
|
||||||
|
goodsIncomeConfig.setGoodsSku(goodsSkuService.getById(goodsIncomeConfig.getSkuId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<GoodsIncomeConfig> listRel(GoodsIncomeConfigParam param) {
|
||||||
|
List<GoodsIncomeConfig> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<GoodsIncomeConfig, GoodsIncomeConfigParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GoodsIncomeConfig getByIdRel(Integer id) {
|
||||||
|
GoodsIncomeConfigParam param = new GoodsIncomeConfigParam();
|
||||||
|
param.setId(id);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GoodsIncomeConfig check(Integer goodsId, Integer skuId, String merchantShopType) {
|
||||||
|
LambdaQueryWrapper<GoodsIncomeConfig> wrapper = new LambdaQueryWrapper<>();
|
||||||
|
wrapper.eq(GoodsIncomeConfig::getGoodsId, goodsId);
|
||||||
|
wrapper.eq(GoodsIncomeConfig::getMerchantShopType, merchantShopType);
|
||||||
|
if (skuId != null) wrapper.eq(GoodsIncomeConfig::getSkuId, skuId);
|
||||||
|
wrapper.last("limit 1");
|
||||||
|
return getOne(wrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -68,16 +68,29 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
if (!CollectionUtils.isEmpty(goodsSpecs)) {
|
if (!CollectionUtils.isEmpty(goodsSpecs)) {
|
||||||
final GoodsSpec spec = goodsSpecs.get(0);
|
final GoodsSpec spec = goodsSpecs.get(0);
|
||||||
final String value = spec.getSpecValue();
|
final String value = spec.getSpecValue();
|
||||||
final Object object = JSONUtil.parseObject(value,Object.class);
|
final Object object = JSONUtil.parseObject(value, Object.class);
|
||||||
d.setGoodsSpecValue(object);
|
d.setGoodsSpecValue(object);
|
||||||
// 整理商品价格
|
// 整理商品价格
|
||||||
if (loginUser != null) {
|
if (loginUser != null) {
|
||||||
if(loginUser.getGradeId().equals(33)){
|
// 经销商
|
||||||
|
if (loginUser.getGradeId().equals(33)) {
|
||||||
d.setPrice(d.getDealerPrice());
|
d.setPrice(d.getDealerPrice());
|
||||||
}
|
}
|
||||||
if(loginUser.getGradeId().equals(0)){
|
if (loginUser.getGradeId().equals(0)) {
|
||||||
d.setPrice(d.getSalePrice());
|
d.setPrice(d.getSalePrice());
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
d.setPrice(d.getSalePrice());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (loginUser != null) {
|
||||||
|
// 经销商
|
||||||
|
if (loginUser.getGradeId().equals(33)) {
|
||||||
|
if (d.getDealerGift()) d.setShowGift(true);
|
||||||
|
}
|
||||||
|
// 会员店
|
||||||
|
if (loginUser.getGradeId().equals(31)) {
|
||||||
|
if (d.getPriceGift()) d.setShowGift(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// d.setGoodsSkus(collectSkus.get(d.getGoodsId()));
|
// d.setGoodsSkus(collectSkus.get(d.getGoodsId()));
|
||||||
@@ -90,6 +103,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
@Override
|
@Override
|
||||||
public List<Goods> listRel(GoodsParam param) {
|
public List<Goods> listRel(GoodsParam param) {
|
||||||
List<Goods> list = baseMapper.selectListRel(param);
|
List<Goods> list = baseMapper.selectListRel(param);
|
||||||
|
for (Goods goods : list) {
|
||||||
|
goods.setGoodsSkus(goodsSkuService.listByGoods(goods.getGoodsId()));
|
||||||
|
}
|
||||||
// 排序
|
// 排序
|
||||||
PageParam<Goods, GoodsParam> page = new PageParam<>();
|
PageParam<Goods, GoodsParam> page = new PageParam<>();
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
@@ -110,7 +126,7 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
final GoodsSpec spec = goods.getGoodsSpec();
|
final GoodsSpec spec = goods.getGoodsSpec();
|
||||||
if (spec != null) {
|
if (spec != null) {
|
||||||
spec.setGoodsId(goods.getGoodsId());
|
spec.setGoodsId(goods.getGoodsId());
|
||||||
if(spec.getSpecValue() == null){
|
if (spec.getSpecValue() == null) {
|
||||||
spec.setSpecValue(JSON.toJSONString(new ArrayList<>()));
|
spec.setSpecValue(JSON.toJSONString(new ArrayList<>()));
|
||||||
}
|
}
|
||||||
goodsSpecService.save(spec);
|
goodsSpecService.save(spec);
|
||||||
@@ -134,20 +150,23 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
mpjLambdaWrapper.selectAll(Goods.class)
|
mpjLambdaWrapper.selectAll(Goods.class)
|
||||||
.select(GoodsSpec::getSpecValue)
|
.select(GoodsSpec::getSpecValue)
|
||||||
.select(GoodsSpec::getSpecName)
|
.select(GoodsSpec::getSpecName)
|
||||||
.leftJoin(GoodsSpec.class,GoodsSpec::getGoodsId,GoodsSpec::getGoodsId);
|
.leftJoin(GoodsSpec.class, GoodsSpec::getGoodsId, GoodsSpec::getGoodsId);
|
||||||
return baseMapper.selectJoinList(Goods.class, mpjLambdaWrapper);
|
return baseMapper.selectJoinList(Goods.class, mpjLambdaWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Goods> getGoodsSpecType0() {
|
public List<Goods> getGoodsSpecType0(GoodsParam param) {
|
||||||
// 多表查询
|
// 多表查询
|
||||||
MPJLambdaWrapper<Goods> mpjLambdaWrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<Goods> mpjLambdaWrapper = new MPJLambdaWrapper<>();
|
||||||
mpjLambdaWrapper.selectAll(Goods.class)
|
mpjLambdaWrapper.selectAll(Goods.class)
|
||||||
.select(GoodsSpec::getSpecValue)
|
.select(GoodsSpec::getSpecValue)
|
||||||
.select(GoodsSpec::getSpecName)
|
.select(GoodsSpec::getSpecName)
|
||||||
.leftJoin(GoodsSpec.class,GoodsSpec::getGoodsId,GoodsSpec::getGoodsId)
|
.leftJoin(GoodsSpec.class, GoodsSpec::getGoodsId, GoodsSpec::getGoodsId)
|
||||||
.gt(Goods::getStock,0)
|
.gt(Goods::getStock, 0)
|
||||||
.eq(Goods::getType,0);
|
.eq(Goods::getType, 0);
|
||||||
|
if (param.getOrderBy() != null && param.getOrderDir() != null) {
|
||||||
|
mpjLambdaWrapper.orderBy(true, param.getOrderDir().equals("asc"), param.getOrderBy());
|
||||||
|
}
|
||||||
return baseMapper.selectJoinList(Goods.class, mpjLambdaWrapper);
|
return baseMapper.selectJoinList(Goods.class, mpjLambdaWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,9 +177,9 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
|
|||||||
mpjLambdaWrapper.selectAll(Goods.class)
|
mpjLambdaWrapper.selectAll(Goods.class)
|
||||||
.select(GoodsSpec::getSpecValue)
|
.select(GoodsSpec::getSpecValue)
|
||||||
.select(GoodsSpec::getSpecName)
|
.select(GoodsSpec::getSpecName)
|
||||||
.leftJoin(GoodsSpec.class,GoodsSpec::getGoodsId,GoodsSpec::getGoodsId)
|
.leftJoin(GoodsSpec.class, GoodsSpec::getGoodsId, GoodsSpec::getGoodsId)
|
||||||
.gt(Goods::getStock,0)
|
.gt(Goods::getStock, 0)
|
||||||
.eq(Goods::getType,1);
|
.eq(Goods::getType, 1);
|
||||||
return baseMapper.selectJoinList(Goods.class, mpjLambdaWrapper);
|
return baseMapper.selectJoinList(Goods.class, mpjLambdaWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.gxwebsoft.shop.service.impl;
|
package com.gxwebsoft.shop.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.gxwebsoft.shop.mapper.GoodsSkuMapper;
|
import com.gxwebsoft.shop.mapper.GoodsSkuMapper;
|
||||||
import com.gxwebsoft.shop.service.GoodsSkuService;
|
import com.gxwebsoft.shop.service.GoodsSkuService;
|
||||||
@@ -37,6 +38,14 @@ public class GoodsSkuServiceImpl extends ServiceImpl<GoodsSkuMapper, GoodsSku> i
|
|||||||
return page.sortRecords(list);
|
return page.sortRecords(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<GoodsSku> listByGoods(Integer goodsId) {
|
||||||
|
return list(
|
||||||
|
new LambdaQueryWrapper<GoodsSku>()
|
||||||
|
.eq(GoodsSku::getGoodsId, goodsId)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GoodsSku getByIdRel(Integer id) {
|
public GoodsSku getByIdRel(Integer id) {
|
||||||
GoodsSkuParam param = new GoodsSkuParam();
|
GoodsSkuParam param = new GoodsSkuParam();
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
package com.gxwebsoft.shop.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.github.yulichang.query.MPJQueryWrapper;
|
||||||
|
import com.gxwebsoft.shop.entity.Goods;
|
||||||
|
import com.gxwebsoft.shop.entity.Merchant;
|
||||||
|
import com.gxwebsoft.shop.mapper.GoodsStockInMerchantMapper;
|
||||||
|
import com.gxwebsoft.shop.service.GoodsService;
|
||||||
|
import com.gxwebsoft.shop.service.GoodsStockInMerchantService;
|
||||||
|
import com.gxwebsoft.shop.entity.GoodsStockInMerchant;
|
||||||
|
import com.gxwebsoft.shop.param.GoodsStockInMerchantParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商户商品库存Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-10-05 02:33:23
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class GoodsStockInMerchantServiceImpl extends ServiceImpl<GoodsStockInMerchantMapper, GoodsStockInMerchant> implements GoodsStockInMerchantService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private GoodsService goodsService;
|
||||||
|
@Override
|
||||||
|
public PageResult<GoodsStockInMerchant> pageRel(GoodsStockInMerchantParam param) {
|
||||||
|
PageParam<GoodsStockInMerchant, GoodsStockInMerchantParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
List<GoodsStockInMerchant> list = baseMapper.selectPageRel(page, param);
|
||||||
|
for (GoodsStockInMerchant goodsStockInMerchant : list) {
|
||||||
|
Goods goods = goodsService.getById(goodsStockInMerchant.getGoodsId());
|
||||||
|
goodsStockInMerchant.setGoods(goods);
|
||||||
|
}
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<GoodsStockInMerchant> listRel(GoodsStockInMerchantParam param) {
|
||||||
|
List<GoodsStockInMerchant> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<GoodsStockInMerchant, GoodsStockInMerchantParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GoodsStockInMerchant getByIdRel(Integer id) {
|
||||||
|
GoodsStockInMerchantParam param = new GoodsStockInMerchantParam();
|
||||||
|
param.setId(id);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public GoodsStockInMerchant check(Integer merchantId, Integer goodsId, Integer skuId) {
|
||||||
|
GoodsStockInMerchantParam param = new GoodsStockInMerchantParam();
|
||||||
|
param.setMerchantId(merchantId);
|
||||||
|
param.setGoodsId(goodsId);
|
||||||
|
param.setSkuId(skuId);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<GoodsStockInMerchant> canExpressList(Integer goodsId, Integer stock, String lat, String lng) {
|
||||||
|
String distanceSql = "ACOS(SIN(( " + lat + " * 3.1415) / 180 ) * SIN((lat * 3.1415) / 180 ) + " +
|
||||||
|
"COS(( " + lat + " * 3.1415) / 180) * COS((b.lat * 3.1415) / 180 ) * COS(( " + lng + " * 3.1415) / 180 - " +
|
||||||
|
"(b.lng * 3.1415) / 180 ) ) * 6380" +
|
||||||
|
" as distance";
|
||||||
|
return list(
|
||||||
|
new MPJQueryWrapper<GoodsStockInMerchant>()
|
||||||
|
.leftJoin("shop_merchant AS b ON b.merchant_id = t.merchant_id")
|
||||||
|
.select("t.*", distanceSql)
|
||||||
|
.eq("goods_id", goodsId)
|
||||||
|
.eq("can_express", 1)
|
||||||
|
.ge("stock", stock)
|
||||||
|
.orderByDesc("distance")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.gxwebsoft.shop.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.crypto.SecureUtil;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.gxwebsoft.shop.service.KuaiDi100;
|
||||||
|
import com.kuaidi100.sdk.api.BOrderOfficial;
|
||||||
|
import com.kuaidi100.sdk.contant.ApiInfoConstant;
|
||||||
|
import com.kuaidi100.sdk.core.BaseClient;
|
||||||
|
import com.kuaidi100.sdk.core.IBaseClient;
|
||||||
|
import com.kuaidi100.sdk.pojo.HttpResult;
|
||||||
|
import com.kuaidi100.sdk.request.BOrderReq;
|
||||||
|
import com.kuaidi100.sdk.request.BaseRequest;
|
||||||
|
import com.kuaidi100.sdk.request.PrintReq;
|
||||||
|
import com.kuaidi100.sdk.utils.SignUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class KuaiDi100Impl implements KuaiDi100 {
|
||||||
|
private String key = "QIfOPROg5054";
|
||||||
|
private String secret = "09401b3c56f54175bcacc74d0519e4ef";
|
||||||
|
@Override
|
||||||
|
public HttpResult border(BOrderReq bOrderReq) throws Exception {
|
||||||
|
PrintReq printReq = new PrintReq();
|
||||||
|
|
||||||
|
String t = String.valueOf(System.currentTimeMillis());
|
||||||
|
String param = new Gson().toJson(bOrderReq);
|
||||||
|
|
||||||
|
printReq.setKey(key);
|
||||||
|
printReq.setSign(SignUtils.printSign(param,t,key,secret));
|
||||||
|
printReq.setT(t);
|
||||||
|
printReq.setParam(param);
|
||||||
|
printReq.setMethod(ApiInfoConstant.B_ORDER_OFFICIAL_ORDER_METHOD);
|
||||||
|
System.out.println(printReq);
|
||||||
|
// IBaseClient bOrder = new BOrderOfficial();
|
||||||
|
IBaseClient bOrder = new BaseClient() {
|
||||||
|
@Override
|
||||||
|
public String getApiUrl(BaseRequest baseRequest) {
|
||||||
|
return "https://api.kuaidi100.com/apiMock/border";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return bOrder.execute(printReq);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,6 +32,11 @@ public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> i
|
|||||||
PageParam<Merchant, MerchantParam> page = new PageParam<>(param);
|
PageParam<Merchant, MerchantParam> page = new PageParam<>(param);
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
List<Merchant> list = baseMapper.selectPageRel(page, param);
|
List<Merchant> list = baseMapper.selectPageRel(page, param);
|
||||||
|
for (Merchant merchant : list) {
|
||||||
|
if (param.getWithOrderNum() != null && param.getWithOrderNum()) {
|
||||||
|
merchant.setOrderNum(orderGoodsService.countByMerchant(merchant.getMerchantId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
return new PageResult<>(list, page.getTotal());
|
return new PageResult<>(list, page.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,4 +69,11 @@ public class MerchantServiceImpl extends ServiceImpl<MerchantMapper, Merchant> i
|
|||||||
return param.getOne(baseMapper.selectListRel(param));
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Merchant getByUserId(Integer userId) {
|
||||||
|
MerchantParam param = new MerchantParam();
|
||||||
|
param.setUserId(userId);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.gxwebsoft.shop.service.impl;
|
package com.gxwebsoft.shop.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.gxwebsoft.shop.mapper.OrderDeliveryMapper;
|
import com.gxwebsoft.shop.mapper.OrderDeliveryMapper;
|
||||||
import com.gxwebsoft.shop.service.OrderDeliveryService;
|
import com.gxwebsoft.shop.service.OrderDeliveryService;
|
||||||
@@ -44,4 +45,14 @@ public class OrderDeliveryServiceImpl extends ServiceImpl<OrderDeliveryMapper, O
|
|||||||
return param.getOne(baseMapper.selectListRel(param));
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public OrderDelivery getByOrderId(Integer orderId) {
|
||||||
|
return getOne(
|
||||||
|
new LambdaQueryWrapper<OrderDelivery>()
|
||||||
|
.eq(OrderDelivery::getOrderId, orderId)
|
||||||
|
.orderByDesc(OrderDelivery::getCreateTime)
|
||||||
|
.last("limit 1")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
package com.gxwebsoft.shop.service.impl;
|
package com.gxwebsoft.shop.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.shop.entity.Goods;
|
||||||
import com.gxwebsoft.shop.mapper.OrderGoodsMapper;
|
import com.gxwebsoft.shop.mapper.OrderGoodsMapper;
|
||||||
|
import com.gxwebsoft.shop.service.GoodsService;
|
||||||
import com.gxwebsoft.shop.service.OrderGoodsService;
|
import com.gxwebsoft.shop.service.OrderGoodsService;
|
||||||
import com.gxwebsoft.shop.entity.OrderGoods;
|
import com.gxwebsoft.shop.entity.OrderGoods;
|
||||||
import com.gxwebsoft.shop.param.OrderGoodsParam;
|
import com.gxwebsoft.shop.param.OrderGoodsParam;
|
||||||
@@ -10,6 +13,7 @@ import com.gxwebsoft.common.core.web.PageParam;
|
|||||||
import com.gxwebsoft.common.core.web.PageResult;
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -20,6 +24,8 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGoods> implements OrderGoodsService {
|
public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGoods> implements OrderGoodsService {
|
||||||
|
@Resource
|
||||||
|
private GoodsService goodsService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<OrderGoods> pageRel(OrderGoodsParam param) {
|
public PageResult<OrderGoods> pageRel(OrderGoodsParam param) {
|
||||||
@@ -38,6 +44,21 @@ public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGo
|
|||||||
return page.sortRecords(list);
|
return page.sortRecords(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OrderGoods> listByOrderId(Integer orderId) {
|
||||||
|
List<OrderGoods> list = list(
|
||||||
|
new LambdaQueryWrapper<OrderGoods>()
|
||||||
|
.eq(OrderGoods::getOrderId, orderId)
|
||||||
|
);
|
||||||
|
List<Goods> goodsList = goodsService.listByIds(list.stream().map(OrderGoods::getGoodsId).toList());
|
||||||
|
for (OrderGoods orderGoods : list) {
|
||||||
|
for (Goods goods : goodsList) {
|
||||||
|
if (orderGoods.getGoodsId().equals(goods.getGoodsId())) orderGoods.setGoods(goods);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OrderGoods getByIdRel(Integer id) {
|
public OrderGoods getByIdRel(Integer id) {
|
||||||
OrderGoodsParam param = new OrderGoodsParam();
|
OrderGoodsParam param = new OrderGoodsParam();
|
||||||
|
|||||||
@@ -12,12 +12,14 @@ import com.gxwebsoft.cms.entity.Website;
|
|||||||
import com.gxwebsoft.cms.entity.WebsiteField;
|
import com.gxwebsoft.cms.entity.WebsiteField;
|
||||||
import com.gxwebsoft.common.core.config.ConfigProperties;
|
import com.gxwebsoft.common.core.config.ConfigProperties;
|
||||||
import com.gxwebsoft.common.core.exception.BusinessException;
|
import com.gxwebsoft.common.core.exception.BusinessException;
|
||||||
|
import com.gxwebsoft.common.core.security.JwtUtil;
|
||||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
import com.gxwebsoft.common.core.utils.RedisUtil;
|
||||||
import com.gxwebsoft.common.core.utils.RequestUtil;
|
import com.gxwebsoft.common.core.utils.RequestUtil;
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
import com.gxwebsoft.common.core.web.ApiResult;
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
import com.gxwebsoft.common.system.entity.User;
|
||||||
|
import com.gxwebsoft.shop.consts.BalanceScene;
|
||||||
import com.gxwebsoft.shop.entity.*;
|
import com.gxwebsoft.shop.entity.*;
|
||||||
import com.gxwebsoft.shop.mapper.OrderMapper;
|
import com.gxwebsoft.shop.mapper.OrderMapper;
|
||||||
import com.gxwebsoft.shop.param.OrderParam;
|
import com.gxwebsoft.shop.param.OrderParam;
|
||||||
@@ -37,12 +39,16 @@ import org.springframework.util.CollectionUtils;
|
|||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static com.gxwebsoft.shop.consts.OrderPayType.PAY_TYPE_FRIEND;
|
||||||
|
import static com.gxwebsoft.shop.consts.OrderPayType.PAY_TYPE_WECHAT;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 订单Service实现
|
* 订单Service实现
|
||||||
*
|
*
|
||||||
@@ -67,6 +73,20 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
private UsersService usersService;
|
private UsersService usersService;
|
||||||
@Resource
|
@Resource
|
||||||
private RedisUtil redisUtil;
|
private RedisUtil redisUtil;
|
||||||
|
@Resource
|
||||||
|
private GoodsService goodsService;
|
||||||
|
@Resource
|
||||||
|
private ExpressService expressService;
|
||||||
|
@Resource
|
||||||
|
private OrderDeliveryService orderDeliveryService;
|
||||||
|
@Resource
|
||||||
|
private MerchantService merchantService;
|
||||||
|
@Resource
|
||||||
|
private GoodsIncomeConfigService goodsIncomeConfigService;
|
||||||
|
@Resource
|
||||||
|
private UserBalanceLogService userBalanceLogService;
|
||||||
|
|
||||||
|
|
||||||
// public static String privateKeyPath = "/Users/gxwebsoft/JAVA/com.gxwebsoft.modules/src/main/resources/cert/apiclient_key.pem";
|
// public static String privateKeyPath = "/Users/gxwebsoft/JAVA/com.gxwebsoft.modules/src/main/resources/cert/apiclient_key.pem";
|
||||||
// public static String privateCertPath = "/Users/gxwebsoft/JAVA/com.gxwebsoft.core/src/main/resources/cert/apiclient_cert.pem";
|
// public static String privateCertPath = "/Users/gxwebsoft/JAVA/com.gxwebsoft.core/src/main/resources/cert/apiclient_cert.pem";
|
||||||
// public static String wechatpayCertPath = "/Users/gxwebsoft/JAVA/com.gxwebsoft.modules/src/main/resources/cert/wechatpay_2DD5A0669263BAE55E52BF3F35BF4A4006A2DAA6.pem"; // 平台证书
|
// public static String wechatpayCertPath = "/Users/gxwebsoft/JAVA/com.gxwebsoft.modules/src/main/resources/cert/wechatpay_2DD5A0669263BAE55E52BF3F35BF4A4006A2DAA6.pem"; // 平台证书
|
||||||
@@ -79,7 +99,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
@Override
|
@Override
|
||||||
public PageResult<Order> pageRel(OrderParam param) {
|
public PageResult<Order> pageRel(OrderParam param) {
|
||||||
PageParam<Order, OrderParam> page = new PageParam<>(param);
|
PageParam<Order, OrderParam> page = new PageParam<>(param);
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
// page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
List<Order> list = baseMapper.selectPageRel(page, param);
|
List<Order> list = baseMapper.selectPageRel(page, param);
|
||||||
|
|
||||||
if (param.getSceneType() != null) {
|
if (param.getSceneType() != null) {
|
||||||
@@ -110,14 +130,47 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
final DateTime now = DateUtil.date();
|
final DateTime now = DateUtil.date();
|
||||||
d.setTimestamp(date.getTime() - now.getTime());
|
d.setTimestamp(date.getTime() - now.getTime());
|
||||||
if (!collect.isEmpty()) {
|
if (!collect.isEmpty()) {
|
||||||
final List<OrderGoods> goods = collect.get(d.getOrderId());
|
final List<OrderGoods> orderGoodsList = collect.get(d.getOrderId());
|
||||||
if (!CollectionUtils.isEmpty(goods)) {
|
if (!CollectionUtils.isEmpty(orderGoodsList)) {
|
||||||
d.setGoodsList(goods);
|
for (OrderGoods orderGoods : orderGoodsList) {
|
||||||
|
Goods goods = goodsService.getById(orderGoods.getGoodsId());
|
||||||
|
if (param.getLoginUser() != null) {
|
||||||
|
// 经销商
|
||||||
|
if (param.getLoginUser().getGradeId().equals(33)) {
|
||||||
|
if (goods.getDealerGift()) goods.setShowGift(true);
|
||||||
|
}
|
||||||
|
// 会员店
|
||||||
|
if (param.getLoginUser().getGradeId().equals(31)) {
|
||||||
|
if (goods.getPriceGift()) goods.setShowGift(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
orderGoods.setGoods(goods);
|
||||||
|
}
|
||||||
|
d.setGoodsList(orderGoodsList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
for (Order order : list) {
|
||||||
|
if (order.getType().equals(0)) {
|
||||||
|
if (order.getDeliveryType() != null && order.getDeliveryType().equals(0)) {
|
||||||
|
OrderDelivery orderDelivery = orderDeliveryService.getByOrderId(order.getOrderId());
|
||||||
|
if (orderDelivery != null) {
|
||||||
|
orderDelivery.setExpress(expressService.getById(orderDelivery.getExpressId()));
|
||||||
|
order.setOrderDelivery(orderDelivery);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (order.getDeliveryType() != null && order.getDeliveryType().equals(1)) {
|
||||||
|
Merchant merchant = merchantService.getById(order.getSelfTakeMerchantId());
|
||||||
|
order.setSelfTakeMerchant(merchant);
|
||||||
|
}
|
||||||
|
} else if (order.getType().equals(1)) {
|
||||||
|
Merchant merchant = merchantService.getById(order.getMerchantId());
|
||||||
|
order.setMerchant(merchant);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
return new PageResult<>(list, page.getTotal());
|
||||||
@@ -147,8 +200,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
final int i = orderInfo.getDateTime().compareTo(DateUtil.today());
|
final int i = orderInfo.getDateTime().compareTo(DateUtil.today());
|
||||||
}
|
}
|
||||||
// 订单商品
|
// 订单商品
|
||||||
final List<OrderGoods> orderGoods = orderGoodsService.list(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderId, orderId));
|
final List<OrderGoods> orderGoodsList = orderGoodsService.list(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrderId, orderId));
|
||||||
order.setGoodsList(orderGoods);
|
for (OrderGoods orderGoods : orderGoodsList) {
|
||||||
|
orderGoods.setGoods(goodsService.getById(orderGoods.getGoodsId()));
|
||||||
|
}
|
||||||
|
order.setGoodsList(orderGoodsList);
|
||||||
// 生成订单核销码
|
// 生成订单核销码
|
||||||
// requestUtil.setTenantId(order.getTenantId().toString());
|
// requestUtil.setTenantId(order.getTenantId().toString());
|
||||||
// order.setQrcode(requestUtil.getOrderQRCodeUnlimited(order.getOrderNo()));
|
// order.setQrcode(requestUtil.getOrderQRCodeUnlimited(order.getOrderNo()));
|
||||||
@@ -165,6 +221,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public HashMap<String, String> createWxOrder(Order order) {
|
public HashMap<String, String> createWxOrder(Order order) {
|
||||||
|
Integer payType = order.getPayType();
|
||||||
|
if (order.getPayType().equals(PAY_TYPE_FRIEND) && order.getFriendPayType().equals(PAY_TYPE_WECHAT))
|
||||||
|
payType = PAY_TYPE_WECHAT;
|
||||||
final String uploadPath = config.getUploadPath(); // 服务器本地路径
|
final String uploadPath = config.getUploadPath(); // 服务器本地路径
|
||||||
final HashMap<String, String> orderInfo = new HashMap<>();
|
final HashMap<String, String> orderInfo = new HashMap<>();
|
||||||
// 微信小程序(微信支付)
|
// 微信小程序(微信支付)
|
||||||
@@ -173,7 +232,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
// System.out.println("string = " + string);
|
// System.out.println("string = " + string);
|
||||||
final JSONObject mpWx = JSONObject.parseObject(string);
|
final JSONObject mpWx = JSONObject.parseObject(string);
|
||||||
// System.out.println("mpWx = " + mpWx);
|
// System.out.println("mpWx = " + mpWx);
|
||||||
String key2 = "Payment:".concat(order.getPayType().toString()).concat(":").concat(order.getTenantId().toString());
|
String key2 = "Payment:".concat(payType.toString()).concat(":").concat(order.getTenantId().toString());
|
||||||
final Payment payment = redisUtil.get(key2, Payment.class);
|
final Payment payment = redisUtil.get(key2, Payment.class);
|
||||||
// System.out.println("payment = " + payment);
|
// System.out.println("payment = " + payment);
|
||||||
|
|
||||||
@@ -301,4 +360,147 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* 结算
|
||||||
|
* @param order
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void settle(String token, String tenantId, Order order) {
|
||||||
|
List<OrderGoods> orderGoodsList = orderGoodsService.listByOrderId(order.getOrderId());
|
||||||
|
RequestUtil requestUtil = new RequestUtil();
|
||||||
|
requestUtil.setAccessToken(token);
|
||||||
|
requestUtil.setTenantId(tenantId);
|
||||||
|
String balanceApi = "/system/user/updateUserBalance";
|
||||||
|
if (order.getType().equals(0)) {
|
||||||
|
User parentUser = requestUtil.getParent(order.getUserId());
|
||||||
|
// System.out.println(parentRes);
|
||||||
|
// 上级收入
|
||||||
|
if (parentUser != null) {
|
||||||
|
// User parentUser = requestUtil.getUserByPhone(parentRes);
|
||||||
|
Merchant parentMerchant = merchantService.getByUserId(parentUser.getUserId());
|
||||||
|
if (parentMerchant != null) {
|
||||||
|
for (OrderGoods orderGoods : orderGoodsList) {
|
||||||
|
Goods goods = orderGoods.getGoods();
|
||||||
|
GoodsIncomeConfig goodsIncomeConfig = goodsIncomeConfigService.check(goods.getGoodsId(), orderGoods.getSkuId(), parentMerchant.getShopType());
|
||||||
|
if (goodsIncomeConfig != null) {
|
||||||
|
BigDecimal rate = goodsIncomeConfig.getRate().divide(BigDecimal.valueOf(100), 4, RoundingMode.HALF_UP);
|
||||||
|
BigDecimal amountTotal = orderGoods.getPrice().multiply(BigDecimal.valueOf(orderGoods.getTotalNum()));
|
||||||
|
BigDecimal incomeTotal = amountTotal.multiply(rate);
|
||||||
|
BigDecimal newBalance = parentUser.getBalance().add(incomeTotal);
|
||||||
|
parentUser.setBalance(newBalance);
|
||||||
|
requestUtil.updateUserBalance(balanceApi, parentUser);
|
||||||
|
userBalanceLogService.save(new UserBalanceLog() {{
|
||||||
|
setUserId(parentUser.getUserId());
|
||||||
|
setScene(BalanceScene.BALANCE_SCENE_DIRECT_INCOME);
|
||||||
|
setMoney(incomeTotal);
|
||||||
|
setBalance(newBalance);
|
||||||
|
setMerchantId(parentMerchant.getMerchantId());
|
||||||
|
setMerchantCode(parentMerchant.getMerchantCode());
|
||||||
|
setOrderNo(order.getOrderNo());
|
||||||
|
setTenantId(getTenantId());
|
||||||
|
}});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 供应商收入
|
||||||
|
for (OrderGoods orderGoods : orderGoodsList) {
|
||||||
|
Goods goods = orderGoods.getGoods();
|
||||||
|
Merchant supplier = merchantService.getById(goods.getSupplierMerchantId());
|
||||||
|
if (supplier != null) {
|
||||||
|
User supplierUser = requestUtil.getByUserId(supplier.getUserId());
|
||||||
|
BigDecimal incomeTotal = goods.getBuyingPrice().multiply(BigDecimal.valueOf(orderGoods.getTotalNum()));
|
||||||
|
BigDecimal newBalance = supplierUser.getBalance().add(incomeTotal);
|
||||||
|
supplierUser.setBalance(newBalance);
|
||||||
|
requestUtil.updateUserBalance(balanceApi, supplierUser);
|
||||||
|
userBalanceLogService.save(new UserBalanceLog() {{
|
||||||
|
setUserId(supplier.getUserId());
|
||||||
|
setScene(BalanceScene.BALANCE_SCENE_SUPPLIER);
|
||||||
|
setMoney(incomeTotal);
|
||||||
|
setBalance(newBalance);
|
||||||
|
setOrderNo(order.getOrderNo());
|
||||||
|
setMerchantId(supplier.getMerchantId());
|
||||||
|
setMerchantCode(supplier.getMerchantCode());
|
||||||
|
setTenantId(getTenantId());
|
||||||
|
}});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 发货门店/提货门店收入
|
||||||
|
Merchant merchant = null;
|
||||||
|
if (order.getDeliveryType().equals(0)) merchant = merchantService.getById(order.getExpressMerchantId());
|
||||||
|
else merchant = merchantService.getById(order.getSelfTakeMerchantId());
|
||||||
|
if (merchant != null) {
|
||||||
|
BigDecimal diffAmountTotal = BigDecimal.ZERO;
|
||||||
|
BigDecimal buyAmountTotal = BigDecimal.ZERO;
|
||||||
|
User merchantUser = requestUtil.getByUserId(merchant.getUserId());
|
||||||
|
for (OrderGoods orderGoods : orderGoodsList) {
|
||||||
|
Goods goods = orderGoods.getGoods();
|
||||||
|
BigDecimal merchantAmount = BigDecimal.ZERO;
|
||||||
|
BigDecimal rate = BigDecimal.ZERO;
|
||||||
|
switch (merchant.getShopType()) {
|
||||||
|
case "会员店": {
|
||||||
|
merchantAmount = goods.getMemberStorePrice();
|
||||||
|
rate = goods.getMemberStoreRate().divide(BigDecimal.valueOf(100), 4, RoundingMode.HALF_UP);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "实体连锁店": {
|
||||||
|
merchantAmount = goods.getChainStorePrice();
|
||||||
|
rate = goods.getChainStoreRate().divide(BigDecimal.valueOf(100), 4, RoundingMode.HALF_UP);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "会员超市": {
|
||||||
|
merchantAmount = goods.getMemberMarketPrice();
|
||||||
|
rate = goods.getMemberMarketRate().divide(BigDecimal.valueOf(100), 4, RoundingMode.HALF_UP);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
BigDecimal amountDiff = orderGoods.getPrice().subtract(merchantAmount);
|
||||||
|
buyAmountTotal = buyAmountTotal.add(merchantAmount.multiply(BigDecimal.valueOf(orderGoods.getTotalNum())));
|
||||||
|
if (amountDiff.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
|
diffAmountTotal = diffAmountTotal.add(amountDiff.multiply(BigDecimal.valueOf(orderGoods.getTotalNum())));
|
||||||
|
diffAmountTotal = diffAmountTotal.multiply(rate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
BigDecimal incomeTotal = diffAmountTotal.add(buyAmountTotal);
|
||||||
|
BigDecimal newBalance = merchantUser.getBalance().add(incomeTotal);
|
||||||
|
merchantUser.setBalance(newBalance);
|
||||||
|
requestUtil.updateUserBalance(balanceApi, merchantUser);
|
||||||
|
Merchant finalMerchant = merchant;
|
||||||
|
userBalanceLogService.save(new UserBalanceLog() {{
|
||||||
|
setUserId(merchantUser.getUserId());
|
||||||
|
setScene(BalanceScene.BALANCE_SCENE_DIFF);
|
||||||
|
setMoney(incomeTotal);
|
||||||
|
setBalance(newBalance);
|
||||||
|
setOrderNo(order.getOrderNo());
|
||||||
|
setMerchantId(finalMerchant.getMerchantId());
|
||||||
|
setMerchantCode(finalMerchant.getMerchantCode());
|
||||||
|
setTenantId(getTenantId());
|
||||||
|
}});
|
||||||
|
}
|
||||||
|
} else if (order.getPayType().equals(1)) {
|
||||||
|
// 外卖
|
||||||
|
Merchant merchant = merchantService.getById(order.getMerchantId());
|
||||||
|
User merchantUser = requestUtil.getByUserId(merchant.getUserId());
|
||||||
|
|
||||||
|
BigDecimal rate = BigDecimal.ONE.subtract(merchant.getCommission().divide(BigDecimal.valueOf(100), 4, RoundingMode.HALF_UP));
|
||||||
|
BigDecimal amountTotal = order.getTotalPrice();
|
||||||
|
BigDecimal incomeTotal = amountTotal.multiply(rate);
|
||||||
|
BigDecimal newBalance = merchantUser.getBalance().add(incomeTotal);
|
||||||
|
merchantUser.setBalance(newBalance);
|
||||||
|
requestUtil.updateUserBalance(balanceApi, merchantUser);
|
||||||
|
userBalanceLogService.save(new UserBalanceLog() {{
|
||||||
|
setUserId(merchantUser.getUserId());
|
||||||
|
setScene(BalanceScene.BALANCE_SCENE_OUT_TAKE);
|
||||||
|
setMoney(incomeTotal);
|
||||||
|
setBalance(newBalance);
|
||||||
|
setMerchantId(merchant.getMerchantId());
|
||||||
|
setMerchantCode(merchant.getMerchantCode());
|
||||||
|
setOrderNo(order.getOrderNo());
|
||||||
|
setTenantId(getTenantId());
|
||||||
|
}});
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package com.gxwebsoft.shop.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.gxwebsoft.shop.mapper.SplashMapper;
|
||||||
|
import com.gxwebsoft.shop.service.SplashService;
|
||||||
|
import com.gxwebsoft.shop.entity.Splash;
|
||||||
|
import com.gxwebsoft.shop.param.SplashParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageParam;
|
||||||
|
import com.gxwebsoft.common.core.web.PageResult;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开屏广告Service实现
|
||||||
|
*
|
||||||
|
* @author 科技小王子
|
||||||
|
* @since 2024-09-30 22:07:41
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class SplashServiceImpl extends ServiceImpl<SplashMapper, Splash> implements SplashService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<Splash> pageRel(SplashParam param) {
|
||||||
|
PageParam<Splash, SplashParam> page = new PageParam<>(param);
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
List<Splash> list = baseMapper.selectPageRel(page, param);
|
||||||
|
return new PageResult<>(list, page.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Splash> listRel(SplashParam param) {
|
||||||
|
List<Splash> list = baseMapper.selectListRel(param);
|
||||||
|
// 排序
|
||||||
|
PageParam<Splash, SplashParam> page = new PageParam<>();
|
||||||
|
page.setDefaultOrder("sort_number asc, create_time desc");
|
||||||
|
return page.sortRecords(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Splash getByIdRel(Integer id) {
|
||||||
|
SplashParam param = new SplashParam();
|
||||||
|
param.setId(id);
|
||||||
|
return param.getOne(baseMapper.selectListRel(param));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user