|
@@ -0,0 +1,58 @@
|
|
|
+package com.fjhx.account.service.payment.impl;
|
|
|
+
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.fjhx.account.entity.payment.dto.PaymentTypeDto;
|
|
|
+import com.fjhx.account.entity.payment.dto.PaymentTypeSelectDto;
|
|
|
+import com.fjhx.account.entity.payment.po.PaymentType;
|
|
|
+import com.fjhx.account.entity.payment.vo.PaymentTypeVo;
|
|
|
+import com.fjhx.account.mapper.payment.PaymentTypeMapper;
|
|
|
+import com.fjhx.account.service.payment.PaymentTypeService;
|
|
|
+import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
+
|
|
|
+
|
|
|
+/**
|
|
|
+ * <p>
|
|
|
+ * 收付款类型 服务实现类
|
|
|
+ * </p>
|
|
|
+ *
|
|
|
+ * @author
|
|
|
+ * @since 2024-03-18
|
|
|
+ */
|
|
|
+@Service
|
|
|
+public class PaymentTypeServiceImpl extends ServiceImpl<PaymentTypeMapper, PaymentType> implements PaymentTypeService {
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Page<PaymentTypeVo> getPage(PaymentTypeSelectDto dto) {
|
|
|
+ IWrapper<PaymentType> wrapper = getWrapper();
|
|
|
+ wrapper.orderByAsc("pt", PaymentType::getSort);
|
|
|
+ wrapper.orderByDesc("pt", PaymentType::getId);
|
|
|
+ Page<PaymentTypeVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PaymentTypeVo detail(Long id) {
|
|
|
+ PaymentType PaymentType = this.getById(id);
|
|
|
+ PaymentTypeVo result = BeanUtil.toBean(PaymentType, PaymentTypeVo.class);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void add(PaymentTypeDto paymentTypeDto) {
|
|
|
+ this.save(paymentTypeDto);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void edit(PaymentTypeDto paymentTypeDto) {
|
|
|
+ this.updateById(paymentTypeDto);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void delete(Long id) {
|
|
|
+ this.removeById(id);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|