Browse Source

优化:订单模块、发货模块

main
科技小王子 2 weeks ago
parent
commit
0ba7c44d28
  1. 19
      src/main/java/com/gxwebsoft/shop/controller/ShopMerchantController.java
  2. 9
      src/main/java/com/gxwebsoft/shop/entity/ShopMerchant.java
  3. 3
      src/main/java/com/gxwebsoft/shop/entity/ShopOrder.java
  4. 2
      src/main/java/com/gxwebsoft/shop/mapper/ShopMerchantMapper.java
  5. 6
      src/main/java/com/gxwebsoft/shop/mapper/xml/ShopOrderMapper.xml
  6. 3
      src/main/java/com/gxwebsoft/shop/param/ShopMerchantParam.java
  7. 3
      src/main/java/com/gxwebsoft/shop/param/ShopOrderParam.java
  8. 2
      src/main/java/com/gxwebsoft/shop/service/ShopMerchantService.java
  9. 2
      src/main/java/com/gxwebsoft/shop/service/impl/ShopMerchantServiceImpl.java
  10. 6
      src/test/java/com/gxwebsoft/generator/ShopGenerator.java

19
src/main/java/com/gxwebsoft/shop/controller/ShopMerchantController.java

@ -6,12 +6,11 @@ import com.gxwebsoft.shop.entity.ShopMerchant;
import com.gxwebsoft.shop.param.ShopMerchantParam;
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.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@ -22,7 +21,7 @@ import java.util.List;
* 商户控制器
*
* @author 科技小王子
* @since 2025-01-11 10:45:12
* @since 2025-08-10 20:43:33
*/
@Tag(name = "商户管理")
@RestController
@ -31,6 +30,7 @@ public class ShopMerchantController extends BaseController {
@Resource
private ShopMerchantService shopMerchantService;
@PreAuthorize("hasAuthority('shop:shopMerchant:list')")
@Operation(summary = "分页查询商户")
@GetMapping("/page")
public ApiResult<PageResult<ShopMerchant>> page(ShopMerchantParam param) {
@ -38,6 +38,7 @@ public class ShopMerchantController extends BaseController {
return success(shopMerchantService.pageRel(param));
}
@PreAuthorize("hasAuthority('shop:shopMerchant:list')")
@Operation(summary = "查询全部商户")
@GetMapping()
public ApiResult<List<ShopMerchant>> list(ShopMerchantParam param) {
@ -53,6 +54,8 @@ public class ShopMerchantController extends BaseController {
return success(shopMerchantService.getByIdRel(id));
}
@PreAuthorize("hasAuthority('shop:shopMerchant:save')")
@OperationLog
@Operation(summary = "添加商户")
@PostMapping()
public ApiResult<?> save(@RequestBody ShopMerchant shopMerchant) {
@ -67,6 +70,8 @@ public class ShopMerchantController extends BaseController {
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:shopMerchant:update')")
@OperationLog
@Operation(summary = "修改商户")
@PutMapping()
public ApiResult<?> update(@RequestBody ShopMerchant shopMerchant) {
@ -76,6 +81,8 @@ public class ShopMerchantController extends BaseController {
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:shopMerchant:remove')")
@OperationLog
@Operation(summary = "删除商户")
@DeleteMapping("/{id}")
public ApiResult<?> remove(@PathVariable("id") Integer id) {
@ -85,6 +92,8 @@ public class ShopMerchantController extends BaseController {
return fail("删除失败");
}
@PreAuthorize("hasAuthority('shop:shopMerchant:save')")
@OperationLog
@Operation(summary = "批量添加商户")
@PostMapping("/batch")
public ApiResult<?> saveBatch(@RequestBody List<ShopMerchant> list) {
@ -94,6 +103,8 @@ public class ShopMerchantController extends BaseController {
return fail("添加失败");
}
@PreAuthorize("hasAuthority('shop:shopMerchant:update')")
@OperationLog
@Operation(summary = "批量修改商户")
@PutMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody BatchParam<ShopMerchant> batchParam) {
@ -103,6 +114,8 @@ public class ShopMerchantController extends BaseController {
return fail("修改失败");
}
@PreAuthorize("hasAuthority('shop:shopMerchant:remove')")
@OperationLog
@Operation(summary = "批量删除商户")
@DeleteMapping("/batch")
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {

9
src/main/java/com/gxwebsoft/shop/entity/ShopMerchant.java

@ -3,11 +3,10 @@ package com.gxwebsoft.shop.entity;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.util.Date;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -15,7 +14,7 @@ import lombok.EqualsAndHashCode;
* 商户
*
* @author 科技小王子
* @since 2025-01-11 10:45:12
* @since 2025-08-10 20:43:33
*/
@Data
@EqualsAndHashCode(callSuper = false)
@ -25,7 +24,7 @@ public class ShopMerchant implements Serializable {
@Schema(description = "ID")
@TableId(value = "merchant_id", type = IdType.AUTO)
private Long merchantId;
private Integer merchantId;
@Schema(description = "商户名称")
private String merchantName;
@ -139,6 +138,6 @@ public class ShopMerchant implements Serializable {
private Integer tenantId;
@Schema(description = "创建时间")
private Date createTime;
private LocalDateTime createTime;
}

3
src/main/java/com/gxwebsoft/shop/entity/ShopOrder.java

@ -159,6 +159,9 @@ public class ShopOrder implements Serializable {
@Schema(description = "发货状态(10未发货 20已发货 30部分发货)")
private Integer deliveryStatus;
@Schema(description = "发货备注")
private String deliveryNote;
@Schema(description = "发货时间")
private Date deliveryTime;

2
src/main/java/com/gxwebsoft/shop/mapper/ShopMerchantMapper.java

@ -12,7 +12,7 @@ import java.util.List;
* 商户Mapper
*
* @author 科技小王子
* @since 2025-01-11 10:45:12
* @since 2025-08-10 20:43:33
*/
public interface ShopMerchantMapper extends BaseMapper<ShopMerchant> {

6
src/main/java/com/gxwebsoft/shop/mapper/xml/ShopOrderMapper.xml

@ -224,7 +224,7 @@
</if>
<if test="param.statusFilter == 1">
<!-- 1待发货:已付款但未发货 -->
AND a.pay_status = 1 AND a.delivery_status = 10
AND a.pay_status = 1 AND a.delivery_status = 10 AND a.order_status = 0
</if>
<if test="param.statusFilter == 2">
<!-- 2待核销:已付款但订单状态为未使用 -->
@ -250,6 +250,10 @@
<!-- 7已删除:订单被删除 -->
AND a.deleted = 1
</if>
<if test="param.statusFilter == 8">
<!-- 8已取消:订单已取消 -->
AND a.order_status = 2
</if>
</if>
</where>
</sql>

3
src/main/java/com/gxwebsoft/shop/param/ShopMerchantParam.java

@ -6,7 +6,6 @@ import com.gxwebsoft.common.core.annotation.QueryType;
import com.gxwebsoft.common.core.web.BaseParam;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
@ -14,7 +13,7 @@ import lombok.EqualsAndHashCode;
* 商户查询参数
*
* @author 科技小王子
* @since 2025-01-11 10:45:12
* @since 2025-08-10 20:43:33
*/
@Data
@EqualsAndHashCode(callSuper = false)

3
src/main/java/com/gxwebsoft/shop/param/ShopOrderParam.java

@ -172,6 +172,9 @@ public class ShopOrderParam extends BaseParam {
@QueryField(type = QueryType.EQ)
private Integer deliveryStatus;
@Schema(description = "发货备注")
private String deliveryNote;
@Schema(description = "发货时间")
private String deliveryTime;

2
src/main/java/com/gxwebsoft/shop/service/ShopMerchantService.java

@ -11,7 +11,7 @@ import java.util.List;
* 商户Service
*
* @author 科技小王子
* @since 2025-01-11 10:45:12
* @since 2025-08-10 20:43:33
*/
public interface ShopMerchantService extends IService<ShopMerchant> {

2
src/main/java/com/gxwebsoft/shop/service/impl/ShopMerchantServiceImpl.java

@ -15,7 +15,7 @@ import java.util.List;
* 商户Service实现
*
* @author 科技小王子
* @since 2025-01-11 10:45:12
* @since 2025-08-10 20:43:33
*/
@Service
public class ShopMerchantServiceImpl extends ServiceImpl<ShopMerchantMapper, ShopMerchant> implements ShopMerchantService {

6
src/test/java/com/gxwebsoft/generator/ShopGenerator.java

@ -50,12 +50,12 @@ public class ShopGenerator {
// "shop_spec",
// "shop_spec_value",
// "shop_goods",
"shop_coupon",
// "shop_coupon",
// "shop_category",
// "shop_goods_spec",
// "shop_goods_sku",
// "shop_goods_category",
"shop_coupon",
// "shop_coupon",
// "shop_goods_description",
// "shop_goods_log",
// "shop_goods_relation",
@ -89,7 +89,7 @@ public class ShopGenerator {
// "shop_dealer_user",
// "shop_user_referee",
// "shop_dealer_withdraw",
"shop_user_coupon",
// "shop_user_coupon",
// "shop_cart",
// "shop_count",
// "shop_express",

Loading…
Cancel
Save