调整商城管理端代码

This commit is contained in:
DB 2023-10-29 01:17:07 +08:00
parent ab860e32ad
commit d27604f622
9 changed files with 64 additions and 28 deletions

View File

@ -43,13 +43,6 @@ public class PlaceOrderBo implements Serializable {
@ApiModelProperty(value = "总积分",required = true) @ApiModelProperty(value = "总积分",required = true)
private Long totalPoint; private Long totalPoint;
/**
* 品牌id
*/
@NotBlank(message = "品牌id不能为空")
@ApiModelProperty(value = "品牌id",required = true)
private String brandId;
/** /**
* 下单人真实姓名 * 下单人真实姓名
*/ */

View File

@ -70,6 +70,7 @@ public class BackstageOrderController {
public R<Void> changeOrderStatus(@RequestParam("id") @ApiParam(value = "订单id",required = true) String id, public R<Void> changeOrderStatus(@RequestParam("id") @ApiParam(value = "订单id",required = true) String id,
@RequestParam("orderStatus") @ApiParam(value = "订单状态") Integer orderStatus) { @RequestParam("orderStatus") @ApiParam(value = "订单状态") Integer orderStatus) {
orderService.updateChain() orderService.updateChain()
.setRaw(ORDER.PREVIOUS_STATUS, ORDER.ORDER_STATUS)
.set(ORDER.ORDER_STATUS, orderStatus + 1) .set(ORDER.ORDER_STATUS, orderStatus + 1)
.where(ORDER.ID.eq(id)).update(); .where(ORDER.ID.eq(id)).update();
return R.ok(); return R.ok();

View File

@ -2,16 +2,15 @@ package com.cpop.mall.business.controller.backstage;
import com.cpop.core.base.R; import com.cpop.core.base.R;
import com.cpop.core.utils.SpringUtils; import com.cpop.core.utils.SpringUtils;
import com.cpop.jambox.business.vo.CardTemplateListVo;
import com.cpop.mall.business.bo.ProductBo; import com.cpop.mall.business.bo.ProductBo;
import com.cpop.mall.business.bo.ProductPageBo; import com.cpop.mall.business.bo.ProductPageBo;
import com.cpop.mall.business.service.ProductRecordService; import com.cpop.mall.business.service.ProductRecordService;
import com.cpop.mall.business.service.ProductService; import com.cpop.mall.business.service.ProductService;
import com.cpop.mall.business.service.ProductSpecificationService; import com.cpop.mall.business.service.ProductSpecificationService;
import com.cpop.mall.business.vo.JamboxCardTemplateListVo;
import com.cpop.mall.business.vo.ProductPageVo; import com.cpop.mall.business.vo.ProductPageVo;
import com.cpop.mall.business.vo.StoreListVo; import com.cpop.mall.business.vo.StoreListVo;
import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.query.If;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
@ -76,8 +75,8 @@ public class BackstageProductController {
*/ */
@GetMapping("/getJamboxCardTemplate") @GetMapping("/getJamboxCardTemplate")
@ApiOperation("获取果酱课卡模板") @ApiOperation("获取果酱课卡模板")
public R<List<CardTemplateListVo>> getJamboxCardTemplate() { public R<List<JamboxCardTemplateListVo>> getJamboxCardTemplate() {
List<CardTemplateListVo> list = productService.getJamboxCardTemplate(); List<JamboxCardTemplateListVo> list = productService.getJamboxCardTemplate();
return R.ok(list); return R.ok(list);
} }
@ -144,7 +143,7 @@ public class BackstageProductController {
* @return {@code true} 删除成功{@code false} 删除失败 * @return {@code true} 删除成功{@code false} 删除失败
*/ */
@DeleteMapping("/removeById/{id}") @DeleteMapping("/removeById/{id}")
@ApiOperation("根据主键商城-商品") @ApiOperation("根据主键删除商城-商品")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public R<Void> removeById(@PathVariable("id") @ApiParam("商城-商品主键") Serializable id) { public R<Void> removeById(@PathVariable("id") @ApiParam("商城-商品主键") Serializable id) {
productService.removeById(id); productService.removeById(id);
@ -171,4 +170,6 @@ public class BackstageProductController {
return R.ok(); return R.ok();
} }
} }

View File

@ -38,6 +38,11 @@ public class Order extends BaseEntity implements Serializable {
*/ */
private Integer orderStatus; private Integer orderStatus;
/**
* 上一个状态(0:待付款;1:待发货;2:待确认;3:已完成;4:退款/售后中:5:订单取消)
*/
private Integer previousStatus;
/** /**
* 外部订单号 * 外部订单号
*/ */

View File

@ -1,13 +1,9 @@
package com.cpop.mall.business.service; package com.cpop.mall.business.service;
import com.cpop.jambox.business.vo.CardTemplateListVo;
import com.cpop.mall.business.bo.ProductBo; import com.cpop.mall.business.bo.ProductBo;
import com.cpop.mall.business.bo.ProductPageBo; import com.cpop.mall.business.bo.ProductPageBo;
import com.cpop.mall.business.entity.Product; import com.cpop.mall.business.entity.Product;
import com.cpop.mall.business.vo.MiniProductPageVo; import com.cpop.mall.business.vo.*;
import com.cpop.mall.business.vo.ProductEvaluateVo;
import com.cpop.mall.business.vo.ProductPageVo;
import com.cpop.mall.business.vo.StoreListVo;
import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService; import com.mybatisflex.core.service.IService;
@ -82,7 +78,7 @@ public interface ProductService extends IService<Product> {
* @param * @param
* @return: java.util.List<com.cpop.jambox.business.entity.CardTemplate> * @return: java.util.List<com.cpop.jambox.business.entity.CardTemplate>
*/ */
List<CardTemplateListVo> getJamboxCardTemplate(); List<JamboxCardTemplateListVo> getJamboxCardTemplate();
/** /**
* @descriptions 下单需要选择店铺/校区 * @descriptions 下单需要选择店铺/校区

View File

@ -143,6 +143,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
JSONObject loginStaffInfo = SecurityUtils.getInstance().getLoginUserInfo(); JSONObject loginStaffInfo = SecurityUtils.getInstance().getLoginUserInfo();
//设置待付款 //设置待付款
order.setOrderStatus(0) order.setOrderStatus(0)
.setPreviousStatus(0)
//获取当前用户所属品牌
.setBrandId(loginStaffInfo.getString("brandId"))
.setProductNames(productList.stream().map(Product::getProductName).collect(Collectors.joining(","))) .setProductNames(productList.stream().map(Product::getProductName).collect(Collectors.joining(",")))
.setPayUserId(loginStaffInfo.getString("userId")); .setPayUserId(loginStaffInfo.getString("userId"));
if (StringUtils.isBlank(bo.getPayUserName())) { if (StringUtils.isBlank(bo.getPayUserName())) {
@ -270,7 +273,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
orderRefund.setRefundStatus(0); orderRefund.setRefundStatus(0);
orderRefundService.save(orderRefund); orderRefundService.save(orderRefund);
//修改订单状态 //修改订单状态
this.updateChain().set(ORDER.ORDER_STATUS, 3).where(ORDER.ID.eq(bo.getOrderId())).update(); this.updateChain().setRaw(ORDER.PREVIOUS_STATUS, ORDER.ORDER_STATUS)
.set(ORDER.ORDER_STATUS, 4).where(ORDER.ID.eq(bo.getOrderId())).update();
} }
/** /**
@ -341,7 +345,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void cancelOrder(String orderId) { public void cancelOrder(String orderId) {
this.updateChain().set(ORDER.ORDER_STATUS, 5).where(ORDER.ID.eq(orderId)).update(); this.updateChain().setRaw(ORDER.PREVIOUS_STATUS, ORDER.ORDER_STATUS)
.set(ORDER.ORDER_STATUS, 4).where(ORDER.ID.eq(orderId)).update();
//获取订单详情 //获取订单详情
List<OrderDetail> orderDetails = SpringUtils.getBean(OrderDetailService.class).queryChain().where(ORDER_DETAIL.ORDER_ID.eq(orderId)).list(); List<OrderDetail> orderDetails = SpringUtils.getBean(OrderDetailService.class).queryChain().where(ORDER_DETAIL.ORDER_ID.eq(orderId)).list();
Map<String, Integer> orderReturnMap = orderDetails.stream().collect(Collectors.toMap(OrderDetail::getProductRecordId, OrderDetail::getNumber)); Map<String, Integer> orderReturnMap = orderDetails.stream().collect(Collectors.toMap(OrderDetail::getProductRecordId, OrderDetail::getNumber));
@ -360,7 +365,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
*/ */
@Override @Override
public void inputLogisticsOrder(LogisticsOrderBo bo) { public void inputLogisticsOrder(LogisticsOrderBo bo) {
this.updateChain().set(ORDER.ORDER_STATUS, 2) this.updateChain().setRaw(ORDER.PREVIOUS_STATUS, ORDER.ORDER_STATUS)
.set(ORDER.ORDER_STATUS, 2)
.set(ORDER.LOGISTICS_ORDER, bo.getLogisticsOrder()) .set(ORDER.LOGISTICS_ORDER, bo.getLogisticsOrder())
.where(ORDER.ID.eq(bo.getId())).update(); .where(ORDER.ID.eq(bo.getId())).update();
} }

View File

@ -22,10 +22,7 @@ import com.cpop.mall.business.service.OrderEvaluateService;
import com.cpop.mall.business.service.ProductRecordService; import com.cpop.mall.business.service.ProductRecordService;
import com.cpop.mall.business.service.ProductService; import com.cpop.mall.business.service.ProductService;
import com.cpop.mall.business.service.ProductSpecificationService; import com.cpop.mall.business.service.ProductSpecificationService;
import com.cpop.mall.business.vo.MiniProductPageVo; import com.cpop.mall.business.vo.*;
import com.cpop.mall.business.vo.ProductEvaluateVo;
import com.cpop.mall.business.vo.ProductPageVo;
import com.cpop.mall.business.vo.StoreListVo;
import com.cpop.system.business.service.StoreService; import com.cpop.system.business.service.StoreService;
import com.mybatisflex.core.datasource.DataSourceKey; import com.mybatisflex.core.datasource.DataSourceKey;
import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.paginate.Page;
@ -272,7 +269,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
* @return: java.util.List<com.cpop.jambox.business.entity.CardTemplate> * @return: java.util.List<com.cpop.jambox.business.entity.CardTemplate>
*/ */
@Override @Override
public List<CardTemplateListVo> getJamboxCardTemplate() { public List<JamboxCardTemplateListVo> getJamboxCardTemplate() {
JSONObject loginStaffInfo = SecurityUtils.getInstance().getLoginUserInfo(); JSONObject loginStaffInfo = SecurityUtils.getInstance().getLoginUserInfo();
//获取果酱品牌拓展信息 //获取果酱品牌拓展信息
BrandExtendService brandExtendService = SpringUtils.getBean(BrandExtendService.class); BrandExtendService brandExtendService = SpringUtils.getBean(BrandExtendService.class);
@ -281,7 +278,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
.where(BRAND.ID.eq(loginStaffInfo.getString("brandId"))).one(); .where(BRAND.ID.eq(loginStaffInfo.getString("brandId"))).one();
//多数据源 //多数据源
List<Row> rowList; List<Row> rowList;
List<CardTemplateListVo> cardTemplateListVos; List<JamboxCardTemplateListVo> cardTemplateListVos;
try { try {
DataSourceKey.use("jambox"); DataSourceKey.use("jambox");
rowList = Db.selectListByQuery("t_card_template", QueryWrapper.create() rowList = Db.selectListByQuery("t_card_template", QueryWrapper.create()
@ -289,7 +286,7 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
.from("t_card_template").as("tct") .from("t_card_template").as("tct")
.leftJoin("t_brand_info").as("tbi").on("tbi.id = tct.brand_id") .leftJoin("t_brand_info").as("tbi").on("tbi.id = tct.brand_id")
.where("tbi.brand_id = ?", brandExtend.getBrandCloudId())); .where("tbi.brand_id = ?", brandExtend.getBrandCloudId()));
cardTemplateListVos = RowUtil.toEntityList(rowList, CardTemplateListVo.class); cardTemplateListVos = RowUtil.toEntityList(rowList, JamboxCardTemplateListVo.class);
} finally { } finally {
DataSourceKey.clear(); DataSourceKey.clear();
} }

View File

@ -0,0 +1,31 @@
package com.cpop.mall.business.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* @author DB
* @Description: 果酱课卡返回
* @create 2023-10-28 22:21
*/
@Data
@Accessors(chain = true)
@ApiModel("果酱模板返回")
public class JamboxCardTemplateListVo implements Serializable {
/**
* 果酱模板id
*/
@ApiModelProperty("果酱模板id")
private String id;
/**
* 模板名
*/
@ApiModelProperty(value = "模板名")
private String name;
}

View File

@ -70,6 +70,12 @@ public class ProductPageVo implements Serializable {
@ApiModelProperty("商品图地址") @ApiModelProperty("商品图地址")
private String picUrl; private String picUrl;
/**
* 商品详情图片地址
*/
@ApiModelProperty("商品详情图片地址")
private String picDetailUrl;
/** /**
* 购买限制(0:会员限制;1:新客限定;2:用户限购) * 购买限制(0:会员限制;1:新客限定;2:用户限购)
*/ */