|
@@ -1,9 +1,14 @@
|
|
|
package com.fjhx.ehsd.service.purchase.impl;
|
|
|
|
|
|
+import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
+import com.fjhx.common.constant.SourceConstant;
|
|
|
import com.fjhx.ehsd.entity.purchase.po.EhsdPurchase;
|
|
|
import com.fjhx.ehsd.mapper.purchase.EhsdPurchaseMapper;
|
|
|
import com.fjhx.ehsd.service.purchase.EhsdPurchaseService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.fjhx.purchase.entity.purchase.po.Purchase;
|
|
|
+import com.ruoyi.common.utils.wrapper.SqlField;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.fjhx.ehsd.entity.purchase.vo.EhsdPurchaseVo;
|
|
@@ -22,12 +27,30 @@ import cn.hutool.core.bean.BeanUtil;
|
|
|
* @since 2023-05-17
|
|
|
*/
|
|
|
@Service
|
|
|
+@DS(SourceConstant.EHSD)
|
|
|
public class EhsdPurchaseServiceImpl extends ServiceImpl<EhsdPurchaseMapper, EhsdPurchase> implements EhsdPurchaseService {
|
|
|
|
|
|
+ /**
|
|
|
+ * 分页
|
|
|
+ * @param dto
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Override
|
|
|
public Page<EhsdPurchaseVo> getPage(EhsdPurchaseSelectDto dto) {
|
|
|
IWrapper<EhsdPurchase> wrapper = getWrapper();
|
|
|
- wrapper.orderByDesc("ep", EhsdPurchase::getId);
|
|
|
+ wrapper.orderByDesc("t1", EhsdPurchase::getCreateTime);
|
|
|
+ if (ObjectUtils.isNotEmpty(dto.getPurchaseStatus())) {
|
|
|
+ wrapper.eq("t1", EhsdPurchase::getStatus, dto.getPurchaseStatus());
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotEmpty(dto.getArrivalStatus())) {
|
|
|
+ wrapper.eq("t1", EhsdPurchase::getArrivalStatus, dto.getArrivalStatus());
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotEmpty(dto.getPayStatus())) {
|
|
|
+ wrapper.eq("t1", EhsdPurchase::getPayStatus, dto.getPayStatus());
|
|
|
+ }
|
|
|
+ if (ObjectUtils.isNotEmpty(dto.getKeyword())) {
|
|
|
+ wrapper.keyword(dto.getKeyword(),new SqlField("t2.name"),new SqlField("t1.`code`"));
|
|
|
+ }
|
|
|
Page<EhsdPurchaseVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
return page;
|
|
|
}
|