From 55642c818f14bf8cf52c98e6858014bd8dc3d3a7 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期四, 16 四月 2026 20:10:58 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
server/services/src/main/java/com/doumee/service/business/impl/OtherOrdersServiceImpl.java | 131 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 131 insertions(+), 0 deletions(-)
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/OtherOrdersServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/OtherOrdersServiceImpl.java
new file mode 100644
index 0000000..9d06292
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/service/business/impl/OtherOrdersServiceImpl.java
@@ -0,0 +1,131 @@
+package com.doumee.service.business.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.doumee.core.constants.Constants;
+import com.doumee.core.exception.BusinessException;
+import com.doumee.core.model.PageData;
+import com.doumee.core.model.PageWrap;
+import com.doumee.core.utils.Utils;
+import com.doumee.dao.business.OtherOrdersMapper;
+import com.doumee.dao.business.model.OtherOrders;
+import com.doumee.service.business.OtherOrdersService;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * 鍏朵粬璁㈠崟璁板綍Service瀹炵幇
+ * @author rk
+ * @date 2026/04/16
+ */
+@Service
+public class OtherOrdersServiceImpl implements OtherOrdersService {
+
+ @Autowired
+ private OtherOrdersMapper otherOrdersMapper;
+
+ @Override
+ public Integer create(OtherOrders otherOrders) {
+ otherOrdersMapper.insert(otherOrders);
+ return otherOrders.getId();
+ }
+
+ @Override
+ public void deleteById(Integer id) {
+ otherOrdersMapper.update(new UpdateWrapper<OtherOrders>().lambda()
+ .set(OtherOrders::getDeleted, Constants.ONE)
+ .eq(OtherOrders::getId, id));
+ }
+
+ @Override
+ public void delete(OtherOrders otherOrders) {
+ UpdateWrapper<OtherOrders> deleteWrapper = new UpdateWrapper<>(otherOrders);
+ otherOrdersMapper.delete(deleteWrapper);
+ }
+
+ @Override
+ public void deleteByIdInBatch(List<Integer> ids) {
+ if (ids == null || ids.isEmpty()) {
+ return;
+ }
+ otherOrdersMapper.deleteBatchIds(ids);
+ }
+
+ @Override
+ public void updateById(OtherOrders otherOrders) {
+ otherOrdersMapper.updateById(otherOrders);
+ }
+
+ @Override
+ public void updateByIdInBatch(List<OtherOrders> otherOrdersList) {
+ if (otherOrdersList == null || otherOrdersList.isEmpty()) {
+ return;
+ }
+ for (OtherOrders otherOrders : otherOrdersList) {
+ this.updateById(otherOrders);
+ }
+ }
+
+ @Override
+ public OtherOrders findById(Integer id) {
+ OtherOrders otherOrders = otherOrdersMapper.selectById(id);
+ if (Objects.isNull(otherOrders)) {
+ throw new BusinessException(com.doumee.core.constants.ResponseStatus.DATA_EMPTY);
+ }
+ return otherOrders;
+ }
+
+ @Override
+ public OtherOrders findOne(OtherOrders otherOrders) {
+ QueryWrapper<OtherOrders> wrapper = new QueryWrapper<>(otherOrders);
+ return otherOrdersMapper.selectOne(wrapper);
+ }
+
+ @Override
+ public List<OtherOrders> findList(OtherOrders otherOrders) {
+ QueryWrapper<OtherOrders> wrapper = new QueryWrapper<>(otherOrders);
+ return otherOrdersMapper.selectList(wrapper);
+ }
+
+ @Override
+ public PageData<OtherOrders> findPage(PageWrap<OtherOrders> pageWrap) {
+ IPage<OtherOrders> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
+ MPJLambdaWrapper<OtherOrders> queryWrapper = new MPJLambdaWrapper<OtherOrders>()
+ .selectAll(OtherOrders.class);
+ Utils.MP.blankToNull(pageWrap.getModel());
+ pageWrap.getModel().setDeleted(Constants.ZERO);
+ OtherOrders model = pageWrap.getModel();
+ if (model.getType() != null) {
+ queryWrapper.eq(OtherOrders::getType, model.getType());
+ }
+ if (model.getMemberId() != null) {
+ queryWrapper.eq(OtherOrders::getMemberId, model.getMemberId());
+ }
+ if (model.getPayStatus() != null) {
+ queryWrapper.eq(OtherOrders::getPayStatus, model.getPayStatus());
+ }
+ if (model.getOrderId() != null) {
+ queryWrapper.eq(OtherOrders::getOrderId, model.getOrderId());
+ }
+ for (PageWrap.SortData sortData : pageWrap.getSorts()) {
+ if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
+ queryWrapper.orderByDesc(sortData.getProperty());
+ } else {
+ queryWrapper.orderByAsc(sortData.getProperty());
+ }
+ }
+ return PageData.from(otherOrdersMapper.selectJoinPage(page, OtherOrders.class, queryWrapper));
+ }
+
+ @Override
+ public long count(OtherOrders otherOrders) {
+ QueryWrapper<OtherOrders> wrapper = new QueryWrapper<>(otherOrders);
+ return otherOrdersMapper.selectCount(wrapper);
+ }
+}
--
Gitblit v1.9.3