|
@@ -7,6 +7,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.baomidou.dynamic.datasource.annotation.DSTransactional;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.fjhx.jushuitan.entity.jst.ThematicAnalysisBo;
|
|
|
import com.fjhx.jushuitan.entity.jst.dto.JstOrderInfoDto;
|
|
|
import com.fjhx.jushuitan.entity.jst.dto.JstOrderInfoSelectDto;
|
|
|
import com.fjhx.jushuitan.entity.jst.po.JstOrderDetail;
|
|
@@ -19,6 +20,7 @@ import com.fjhx.jushuitan.service.jst.JstOrderDetailService;
|
|
|
import com.fjhx.jushuitan.service.jst.JstOrderInfoService;
|
|
|
import com.fjhx.jushuitan.service.jst.JstOrderPayInfoService;
|
|
|
import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
+import com.ruoyi.common.utils.wrapper.SqlField;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
@@ -29,7 +31,7 @@ import java.util.List;
|
|
|
* 聚水潭订单表 服务实现类
|
|
|
* </p>
|
|
|
*
|
|
|
- * @author
|
|
|
+ * @author
|
|
|
* @since 2024-01-20
|
|
|
*/
|
|
|
@Service
|
|
@@ -50,10 +52,10 @@ public class JstOrderInfoServiceImpl extends ServiceImpl<JstOrderInfoMapper, Jst
|
|
|
@Override
|
|
|
public Page<JstOrderInfoVo> getPage(JstOrderInfoSelectDto dto) {
|
|
|
IWrapper<JstOrderInfo> wrapper = getWrapper();
|
|
|
- if(ObjectUtil.isNotNull(dto.getStartTime())){
|
|
|
+ if (ObjectUtil.isNotNull(dto.getStartTime())) {
|
|
|
wrapper.ge("joi", JstOrderInfo::getCreated, DateUtil.beginOfDay(dto.getStartTime()));
|
|
|
}
|
|
|
- if(ObjectUtil.isNotNull(dto.getEndTime())){
|
|
|
+ if (ObjectUtil.isNotNull(dto.getEndTime())) {
|
|
|
wrapper.le("joi", JstOrderInfo::getCreated, DateUtil.endOfDay(dto.getEndTime()));
|
|
|
}
|
|
|
wrapper.like("joi", JstOrderInfo::getOid, dto.getOid());
|
|
@@ -61,11 +63,11 @@ public class JstOrderInfoServiceImpl extends ServiceImpl<JstOrderInfoMapper, Jst
|
|
|
wrapper.orderByDesc("joi", JstOrderInfo::getId);
|
|
|
Page<JstOrderInfoVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
List<JstOrderInfoVo> records = page.getRecords();
|
|
|
- if (CollectionUtil.isNotEmpty(records)){
|
|
|
+ if (CollectionUtil.isNotEmpty(records)) {
|
|
|
records.forEach(item ->
|
|
|
- jstOrderPayInfoService.lambdaQuery().eq(JstOrderPayInfo::getOrderId, item.getId()).list().stream().findFirst().ifPresent(jstOrderPayInfo ->
|
|
|
- item.setPayDate(jstOrderPayInfo.getPayDate())
|
|
|
- )
|
|
|
+ jstOrderPayInfoService.lambdaQuery().eq(JstOrderPayInfo::getOrderId, item.getId()).list().stream().findFirst().ifPresent(jstOrderPayInfo ->
|
|
|
+ item.setPayDate(jstOrderPayInfo.getPayDate())
|
|
|
+ )
|
|
|
);
|
|
|
}
|
|
|
page.setRecords(records);
|
|
@@ -75,13 +77,13 @@ public class JstOrderInfoServiceImpl extends ServiceImpl<JstOrderInfoMapper, Jst
|
|
|
@Override
|
|
|
public JstOrderInfoVo detail(Long id) {
|
|
|
JstOrderInfo JstOrderInfo = this.getById(id);
|
|
|
- if(ObjectUtil.isNull(JstOrderInfo)){
|
|
|
+ if (ObjectUtil.isNull(JstOrderInfo)) {
|
|
|
throw new RuntimeException("订单不存在");
|
|
|
}
|
|
|
JstOrderInfoVo result = BeanUtil.toBean(JstOrderInfo, JstOrderInfoVo.class);
|
|
|
|
|
|
List<JstOrderDetail> detailList = jstOrderDetailService.lambdaQuery().eq(JstOrderDetail::getOrderId, id).list();
|
|
|
- if (CollectionUtil.isNotEmpty(detailList)){
|
|
|
+ if (CollectionUtil.isNotEmpty(detailList)) {
|
|
|
result.setItems(BeanUtil.copyToList(detailList, JstOrderDetailVo.class));
|
|
|
}
|
|
|
return result;
|
|
@@ -111,4 +113,27 @@ public class JstOrderInfoServiceImpl extends ServiceImpl<JstOrderInfoMapper, Jst
|
|
|
JstOrderInfo last = lambdaQuery().orderByDesc(JstOrderInfo::getTs).last("limit 1").list().stream().findFirst().orElse(new JstOrderInfo());
|
|
|
return last.getTs();
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Page<ThematicAnalysisBo> thematicAnalysis(JstOrderInfoSelectDto dto) {
|
|
|
+ IWrapper<Object> wrapper = IWrapper.getWrapper();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ wrapper.eq("joi.status", dto.getStatus());
|
|
|
+
|
|
|
+
|
|
|
+ wrapper.ge("joi.order_date", dto.getBeginTime());
|
|
|
+ wrapper.le("joi.order_date", dto.getEndTime());
|
|
|
+
|
|
|
+
|
|
|
+ wrapper.keyword(dto.getKeyword(),
|
|
|
+ new SqlField("joi.oid"),
|
|
|
+ new SqlField("joi.shop_name"),
|
|
|
+ new SqlField("joi.type")
|
|
|
+ );
|
|
|
+
|
|
|
+ return baseMapper.thematicAnalysisPage(dto.getPage(), wrapper);
|
|
|
+ }
|
|
|
}
|