|
@@ -0,0 +1,66 @@
|
|
|
|
+package com.fjhx.account.service.account.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.account.dto.AccountSubjectsDto;
|
|
|
|
+import com.fjhx.account.entity.account.dto.AccountSubjectsSelectDto;
|
|
|
|
+import com.fjhx.account.entity.account.po.AccountSubjects;
|
|
|
|
+import com.fjhx.account.entity.account.vo.AccountSubjectsVo;
|
|
|
|
+import com.fjhx.account.mapper.account.AccountSubjectsMapper;
|
|
|
|
+import com.fjhx.account.service.account.AccountSubjectsService;
|
|
|
|
+import com.ruoyi.common.utils.wrapper.IWrapper;
|
|
|
|
+import org.springframework.stereotype.Service;
|
|
|
|
+
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * <p>
|
|
|
|
+ * 记账科目 服务实现类
|
|
|
|
+ * </p>
|
|
|
|
+ *
|
|
|
|
+ * @author
|
|
|
|
+ * @since 2024-03-18
|
|
|
|
+ */
|
|
|
|
+@Service
|
|
|
|
+public class AccountSubjectsServiceImpl extends ServiceImpl<AccountSubjectsMapper, AccountSubjects> implements AccountSubjectsService {
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public List<AccountSubjectsVo> getList(AccountSubjectsSelectDto dto) {
|
|
|
|
+ IWrapper<AccountSubjects> wrapper = getWrapper();
|
|
|
|
+ wrapper.orderByDesc("asu", AccountSubjects::getId);
|
|
|
|
+ List<AccountSubjectsVo> list = this.baseMapper.getList(wrapper);
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Page<AccountSubjectsVo> getPage(AccountSubjectsSelectDto dto) {
|
|
|
|
+ IWrapper<AccountSubjects> wrapper = getWrapper();
|
|
|
|
+ wrapper.orderByDesc("asu", AccountSubjects::getId);
|
|
|
|
+ Page<AccountSubjectsVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
|
|
|
|
+ return page;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public AccountSubjectsVo detail(Long id) {
|
|
|
|
+ AccountSubjects AccountSubjects = this.getById(id);
|
|
|
|
+ AccountSubjectsVo result = BeanUtil.toBean(AccountSubjects, AccountSubjectsVo.class);
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void add(AccountSubjectsDto accountSubjectsDto) {
|
|
|
|
+ this.save(accountSubjectsDto);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void edit(AccountSubjectsDto accountSubjectsDto) {
|
|
|
|
+ this.updateById(accountSubjectsDto);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void delete(Long id) {
|
|
|
|
+ this.removeById(id);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|