|
@@ -71,9 +71,18 @@ public class CartServiceImpl extends ServiceImpl<MtCartMapper, MtCart> implement
|
|
|
*
|
|
|
* @param reqDto
|
|
|
* @throws BusinessCheckException
|
|
|
+ * @return
|
|
|
*/
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public Integer saveCart(MtCart reqDto, String action) throws BusinessCheckException {
|
|
|
+ if (reqDto.getId() == null && (reqDto.getMerchantId() == null || reqDto.getMerchantId() < 1)) {
|
|
|
+ throw new BusinessCheckException("商户不能为空");
|
|
|
+ }
|
|
|
+ if (reqDto.getId() == null && (reqDto.getStoreId() == null || reqDto.getStoreId() < 1)) {
|
|
|
+ throw new BusinessCheckException("店铺不能为空");
|
|
|
+ }
|
|
|
+
|
|
|
MtCart mtCart = new MtCart();
|
|
|
Integer cartId = 1;
|
|
|
|
|
@@ -190,8 +199,10 @@ public class CartServiceImpl extends ServiceImpl<MtCartMapper, MtCart> implement
|
|
|
*
|
|
|
* @param cartIds
|
|
|
* @throws BusinessCheckException
|
|
|
+ * @return
|
|
|
*/
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public void removeCart(String cartIds) {
|
|
|
String[] ids = cartIds.split(",");
|
|
|
if (ids.length < 1) {
|
|
@@ -210,9 +221,11 @@ public class CartServiceImpl extends ServiceImpl<MtCartMapper, MtCart> implement
|
|
|
*
|
|
|
* @param hangNo 挂单序号
|
|
|
* @throws BusinessCheckException
|
|
|
+ * @return
|
|
|
*/
|
|
|
@Override
|
|
|
@OperationServiceLog(description = "删除挂单")
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public void removeCartByHangNo(String hangNo) {
|
|
|
if (hangNo != null && StringUtil.isNotEmpty(hangNo)) {
|
|
|
mtCartMapper.deleteCartByHangNo(hangNo);
|
|
@@ -224,12 +237,20 @@ public class CartServiceImpl extends ServiceImpl<MtCartMapper, MtCart> implement
|
|
|
*
|
|
|
* @param userId
|
|
|
* @throws BusinessCheckException
|
|
|
+ * @return
|
|
|
*/
|
|
|
@Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public void clearCart(Integer userId) {
|
|
|
mtCartMapper.clearCart(userId);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据条件查找
|
|
|
+ *
|
|
|
+ * @param params 查询参数
|
|
|
+ * @return
|
|
|
+ * */
|
|
|
@Override
|
|
|
public List<MtCart> queryCartListByParams(Map<String, Object> params) {
|
|
|
String status = params.get("status") == null ? StatusEnum.ENABLED.getKey() : params.get("status").toString();
|
|
@@ -283,6 +304,7 @@ public class CartServiceImpl extends ServiceImpl<MtCartMapper, MtCart> implement
|
|
|
*/
|
|
|
@Override
|
|
|
@OperationServiceLog(description = "执行挂单")
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
public MtCart setHangNo(Integer cartId, String hangNo, String isVisitor) {
|
|
|
MtCart mtCart = mtCartMapper.selectById(cartId);
|
|
|
if (mtCart != null) {
|