超市自定义商品
This commit is contained in:
@ -161,7 +161,7 @@ public class AppCardController {
|
||||
@Operation(summary = "管理充值")
|
||||
public CommonResult<Boolean> rechargeByAdmin(@RequestBody RechargeVO vo) {
|
||||
BillingRespMoneyVO haveWithoutMoney = billingService.getHaveWithoutMoney(SecurityFrameworkUtils.getLoginUserId());
|
||||
if (haveWithoutMoney.getWithoutMoney().compareTo(BigDecimal.ZERO)!=0){
|
||||
if (haveWithoutMoney.getWithoutMoney().compareTo(BigDecimal.ZERO)>0){
|
||||
throw exception(BILLING_NOT_COMPLETE);
|
||||
}
|
||||
cardService.rechargeByAdmin(vo);
|
||||
|
@ -198,7 +198,9 @@ public class AppStoreController {
|
||||
@Operation(summary = "添加二维码订单")
|
||||
public String payByCodeOrder(@RequestBody StoreOrderDto dto) {
|
||||
AddReqVO addReqVO = orderService.codePay(dto);
|
||||
memberAsyncService.batchRecord(addReqVO);
|
||||
if(CollectionUtil.isNotEmpty(addReqVO.getList())){
|
||||
memberAsyncService.batchRecord(addReqVO);
|
||||
}
|
||||
return JsonUtils.toJsonString(StoreResult.success(null));
|
||||
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package cn.iocoder.yudao.module.member.service.storeorder;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
@ -54,6 +55,7 @@ import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
@ -232,6 +234,9 @@ public class StoreOrderServiceImpl implements StoreOrderService {
|
||||
addReqVO.setOutType(OutTypeEnum.SELL.getCode());
|
||||
List<GoodsInfoReqVO> infos = new ArrayList<>();
|
||||
for (StoreGoodsDto detail : dto.getEquipmentGoodsCustoms()){
|
||||
if(detail.getGoodsId() == null){
|
||||
continue;
|
||||
}
|
||||
GoodsInfoReqVO vo = new GoodsInfoReqVO();
|
||||
BeanUtil.copyProperties(detail,vo);
|
||||
vo.setCarteenId(storeId);
|
||||
@ -239,7 +244,9 @@ public class StoreOrderServiceImpl implements StoreOrderService {
|
||||
infos.add(vo);
|
||||
}
|
||||
addReqVO.setList(infos);
|
||||
storeGoodsInventoryService.createStoreGoodsInventory(addReqVO);
|
||||
if(CollectionUtil.isNotEmpty(infos)){
|
||||
storeGoodsInventoryService.createStoreGoodsInventory(addReqVO);
|
||||
}
|
||||
|
||||
StoreOrderDO order = createOrder(dto,StoreOrderStatusEnum.COMPLETE.getCode());
|
||||
Double totalPrice = order.getTotalPrice();
|
||||
|
Reference in New Issue
Block a user