Merge branch 'order' into report
This commit is contained in:
commit
1858f252ca
|
|
@ -89,7 +89,8 @@ public class OrderCartController extends BaseController
|
|||
public AjaxResult editSave(@RequestBody OrderCart orderCart)
|
||||
{
|
||||
OrderCartParamChecker.editCheck(orderCart);
|
||||
return toAjax(iOrderCartService.updateOrderCart(orderCart));
|
||||
iOrderCartService.updateOrderCart(orderCart);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -100,9 +101,9 @@ public class OrderCartController extends BaseController
|
|||
@ResponseBody
|
||||
public AjaxResult remove(@RequestBody OrderCartDelParam param)
|
||||
{
|
||||
if(Objects.isNull(param) || CollUtil.isEmpty(param.getShoppingCartIds())) {
|
||||
if(Objects.isNull(param) || CollUtil.isEmpty(param.getCartIds())) {
|
||||
throw new ServiceException("购物车餐品ID为空");
|
||||
}
|
||||
return toAjax(iOrderCartService.deleteOrderCartByCartIds(param.getShoppingCartIds()));
|
||||
return toAjax(iOrderCartService.deleteOrderCartByCartIds(param.getCartIds()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ public class OrderCart extends BaseEntity
|
|||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("shoppingCartId", getCartId())
|
||||
.append("cartId", getCartId())
|
||||
.append("userId", getUserId())
|
||||
.append("menuId", getMenuId())
|
||||
.append("canteenId", getCanteenId())
|
||||
|
|
|
|||
|
|
@ -41,6 +41,6 @@ public class DeviceOrderDetailInfoAddParam {
|
|||
message = "计算价格不能小于0"
|
||||
) BigDecimal finalPrice;
|
||||
private Integer salesMode;
|
||||
private String shoppingCartId;
|
||||
private String cartId;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,5 +7,5 @@ import java.util.List;
|
|||
|
||||
@Data
|
||||
public class OrderCartDelParam extends BaseEntity {
|
||||
private List<Long> shoppingCartIds;
|
||||
private List<Long> cartIds;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,6 @@ public class OrderDetailInfoAddParam {
|
|||
message = "计算价格不能小于0"
|
||||
) BigDecimal finalPrice;
|
||||
private Integer salesMode;
|
||||
private String shoppingCartId;
|
||||
private String cartId;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public class OrderCartVO extends BaseEntity
|
|||
{
|
||||
|
||||
/** 主键 */
|
||||
private Long shoppingCartId;
|
||||
private Long cartId;
|
||||
|
||||
/** 人员id */
|
||||
@Excel(name = "人员id")
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ public interface OrderCartMapper
|
|||
* @param cartId 订单购物车主键
|
||||
* @return 订单购物车
|
||||
*/
|
||||
public OrderCart selectOrderCartByShoppingCartId(Long cartId);
|
||||
public OrderCart selectOrderCartByCartId(Long cartId);
|
||||
|
||||
/**
|
||||
* 查询订单购物车列表
|
||||
|
|
@ -51,7 +51,7 @@ public interface OrderCartMapper
|
|||
* @param cartId 订单购物车主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOrderCartByShoppingCartId(Long cartId);
|
||||
public int deleteOrderCartByCartId(Long cartId);
|
||||
|
||||
/**
|
||||
* 批量删除订单购物车
|
||||
|
|
@ -59,5 +59,5 @@ public interface OrderCartMapper
|
|||
* @param cartIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteOrderCartByShoppingCartIds(@Param("cartIds") List<Long> cartIds);
|
||||
public int deleteOrderCartByCartIds(@Param("cartIds") List<Long> cartIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class OrderCartServiceImpl implements IOrderCartService
|
|||
@Override
|
||||
public OrderCart selectOrderCartByCartId(Long cartId)
|
||||
{
|
||||
return orderCartMapper.selectOrderCartByShoppingCartId(cartId);
|
||||
return orderCartMapper.selectOrderCartByCartId(cartId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -104,23 +104,23 @@ public class OrderCartServiceImpl implements IOrderCartService
|
|||
return orderCartVOList;
|
||||
}
|
||||
|
||||
private OrderCartVO convertToOrderCartVO(OrderCart shoppingCart,
|
||||
private OrderCartVO convertToOrderCartVO(OrderCart orderCart,
|
||||
Map<Long, List<CookRecipeDishesVO>> cookRecipeDishMap) {
|
||||
OrderCartVO shoppingCartVO = new OrderCartVO();
|
||||
BeanUtils.copyProperties(shoppingCart, shoppingCartVO);
|
||||
shoppingCartVO.setIsValid(0);
|
||||
OrderCartVO orderCartVO = new OrderCartVO();
|
||||
BeanUtils.copyProperties(orderCart, orderCartVO);
|
||||
orderCartVO.setIsValid(0);
|
||||
|
||||
List<CookRecipeDishesVO> cookRecipeDishes = cookRecipeDishMap.get(shoppingCart.getMealtimeType().longValue());
|
||||
List<CookRecipeDishesVO> cookRecipeDishes = cookRecipeDishMap.get(orderCart.getMealtimeType().longValue());
|
||||
if (CollUtil.isNotEmpty(cookRecipeDishes)) {
|
||||
for (CookRecipeDishesVO cookRecipeDishesVO : cookRecipeDishes) {
|
||||
if (shoppingCart.getGoodsId().equals(cookRecipeDishesVO.getDishesId())) {
|
||||
shoppingCartVO.setIsValid(1);
|
||||
if (orderCart.getGoodsId().equals(cookRecipeDishesVO.getDishesId())) {
|
||||
orderCartVO.setIsValid(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return shoppingCartVO;
|
||||
return orderCartVO;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -165,7 +165,7 @@ public class OrderCartServiceImpl implements IOrderCartService
|
|||
@Override
|
||||
public int deleteOrderCartByCartIds(List<Long> cartIds)
|
||||
{
|
||||
return orderCartMapper.deleteOrderCartByShoppingCartIds(cartIds);
|
||||
return orderCartMapper.deleteOrderCartByCartIds(cartIds);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -177,6 +177,6 @@ public class OrderCartServiceImpl implements IOrderCartService
|
|||
@Override
|
||||
public int deleteOrderCartByCartId(Long cartId)
|
||||
{
|
||||
return orderCartMapper.deleteOrderCartByShoppingCartId(cartId);
|
||||
return orderCartMapper.deleteOrderCartByCartId(cartId);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public class OrderCartParamChecker {
|
|||
|
||||
public static void editCheck(OrderCart orderCart) {
|
||||
checkOrderShoppingCart(orderCart);
|
||||
checkShoppingCartId(orderCart);
|
||||
checkCartId(orderCart);
|
||||
checkQuantity(orderCart);
|
||||
}
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ public class OrderCartParamChecker {
|
|||
throw new ServiceException("订单购物车对象为空");
|
||||
}
|
||||
}
|
||||
private static void checkShoppingCartId(OrderCart orderCart) {
|
||||
private static void checkCartId(OrderCart orderCart) {
|
||||
if (orderCart.getCartId() == null) {
|
||||
throw new ServiceException("购物车ID为空");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectOrderCartByShoppingCartId" parameterType="Long" resultMap="OrderCartResult">
|
||||
<select id="selectOrderCartByCartId" parameterType="Long" resultMap="OrderCartResult">
|
||||
<include refid="selectOrderShoppingCartVo"/>
|
||||
where cart_id = #{cartId}
|
||||
</select>
|
||||
|
|
@ -119,14 +119,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where cart_id = #{cartId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteOrderCartByShoppingCartId" parameterType="Long">
|
||||
<delete id="deleteOrderCartByCartId" parameterType="Long">
|
||||
delete from order_cart where cart_id = #{cartId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteOrderCartByShoppingCartIds" parameterType="String">
|
||||
<delete id="deleteOrderCartByCartIds" parameterType="String">
|
||||
delete from order_cart where cart_id in
|
||||
<foreach item="shoppingCartId" collection="cartIds" open="(" separator="," close=")">
|
||||
#{shoppingCartId}
|
||||
<foreach item="cartId" collection="cartIds" open="(" separator="," close=")">
|
||||
#{cartId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue