|
|
@@ -29,10 +29,7 @@ import org.dromara.order.service.IOrderMainService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import java.util.Collection;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Set;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
@@ -155,22 +152,20 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
|
|
|
lqw.eq(bo.getConfirmTime() != null, OrderMain::getConfirmTime, bo.getConfirmTime());
|
|
|
lqw.eq(bo.getShippingTime() != null, OrderMain::getShippingTime, bo.getShippingTime());
|
|
|
lqw.eq(bo.getReceivingTime() != null, OrderMain::getReceivingTime, bo.getReceivingTime());
|
|
|
- lqw.eq(bo.getShippedQuantity() != null, OrderMain::getShippedQuantity, bo.getShippedQuantity());
|
|
|
- lqw.eq(bo.getUnshippedQuantity() != null, OrderMain::getUnshippedQuantity, bo.getUnshippedQuantity());
|
|
|
lqw.eq(bo.getPackageCount() != null, OrderMain::getPackageCount, bo.getPackageCount());
|
|
|
lqw.eq(bo.getSignedQuantity() != null, OrderMain::getSignedQuantity, bo.getSignedQuantity());
|
|
|
lqw.eq(bo.getAfterSaleCompleted() != null, OrderMain::getAfterSaleCompleted, bo.getAfterSaleCompleted());
|
|
|
lqw.eq(bo.getAfterSalePending() != null, OrderMain::getAfterSalePending, bo.getAfterSalePending());
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getPushStatus()), OrderMain::getPushStatus, bo.getPushStatus());
|
|
|
+ lqw.eq(StringUtils.isNotBlank(bo.getCheckStatus()), OrderMain::getCheckStatus, bo.getCheckStatus());
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getAttachmentPath()), OrderMain::getAttachmentPath, bo.getAttachmentPath());
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getDeliveryType()), OrderMain::getDeliveryType, bo.getDeliveryType());
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getOrderCategory()), OrderMain::getOrderCategory, bo.getOrderCategory());
|
|
|
- lqw.eq(StringUtils.isNotBlank(bo.getProductCode()), OrderMain::getProductCode, bo.getProductCode());
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getExpenseType()), OrderMain::getExpenseType, bo.getExpenseType());
|
|
|
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), OrderMain::getStatus, bo.getStatus());
|
|
|
if (params != null) {
|
|
|
lqw.between(params.get("beginTime") != null && params.get("endTime") != null,
|
|
|
- OrderMain::getCreateTime, params.get("beginTime"), params.get("endTime"));
|
|
|
+ OrderMain::getOrderTime, params.get("beginTime"), params.get("endTime"));
|
|
|
}
|
|
|
if (null != bo.getOrderStatuses() && bo.getOrderStatuses().contains(",")) {
|
|
|
lqw.in(OrderMain::getOrderStatus, bo.getOrderStatuses().split(","));
|
|
|
@@ -204,6 +199,21 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
|
|
|
// 2. 生成订单号并转换主单
|
|
|
String orderNo = SequenceUtils.generateOrderCode("RS");
|
|
|
bo.setOrderNo(orderNo);
|
|
|
+ Date originalDate = bo.getOrderTime(); // 假设是 2025-01-06 00:00:00
|
|
|
+ if (originalDate != null) {
|
|
|
+ Calendar calOriginal = Calendar.getInstance();
|
|
|
+ calOriginal.setTime(originalDate);
|
|
|
+
|
|
|
+ Calendar calNow = Calendar.getInstance(); // 获取当前时分秒
|
|
|
+
|
|
|
+ // 保留原日期的年月日,替换时分秒为当前时间
|
|
|
+ calOriginal.set(Calendar.HOUR_OF_DAY, calNow.get(Calendar.HOUR_OF_DAY));
|
|
|
+ calOriginal.set(Calendar.MINUTE, calNow.get(Calendar.MINUTE));
|
|
|
+ calOriginal.set(Calendar.SECOND, calNow.get(Calendar.SECOND));
|
|
|
+ calOriginal.set(Calendar.MILLISECOND, calNow.get(Calendar.MILLISECOND));
|
|
|
+
|
|
|
+ bo.setOrderTime(calOriginal.getTime());
|
|
|
+ }
|
|
|
OrderMain orderMain = MapstructUtils.convert(bo, OrderMain.class);
|
|
|
|
|
|
validEntityBeforeSave(orderMain);
|
|
|
@@ -270,6 +280,20 @@ public class OrderMainServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain
|
|
|
return baseMapper.updateById(order);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 修改审核状态
|
|
|
+ *
|
|
|
+ * @param bo 信息
|
|
|
+ * @return 结果
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public int updateCheckStatus(OrderMainBo bo) {
|
|
|
+ OrderMain order = new OrderMain();
|
|
|
+ order.setId(bo.getId());
|
|
|
+ order.setCheckStatus(bo.getCheckStatus());
|
|
|
+ return baseMapper.updateById(order);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 保存前的数据校验
|
|
|
*/
|