Browse Source

运营管理-筛选分类管理,详细收支明细管理接口添加

杨德宝 2 years ago
parent
commit
01aaffafad

+ 32 - 0
kxs-user/kxs-user-api/src/main/java/com/kxs/user/api/dto/admin/changeType/SysChangeTypePageDTO.java

@@ -0,0 +1,32 @@
+package com.kxs.user.api.dto.admin.changeType;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+
+/**
+ * 运营管理-筛选分类管理列表-dto
+ *
+ * @author 系统
+ * @date 2024-07-02 14:12:04
+ */
+@Data
+public class SysChangeTypePageDTO {
+
+    /**
+     * 分类名称
+     */
+    @Schema(description = "分类名称")
+    private String name;
+
+
+    /**
+     * 收支类型 1新增 2减少
+     */
+    @Schema(description = "收支类型 1新增 2减少")
+    private String kind;
+
+
+
+
+}

+ 32 - 0
kxs-user/kxs-user-api/src/main/java/com/kxs/user/api/dto/admin/changeTypeKind/SysChangeTypeKindPageDTO.java

@@ -0,0 +1,32 @@
+package com.kxs.user.api.dto.admin.changeTypeKind;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+
+/**
+ * 运营管理-详细收支明细列表-dto
+ *
+ * @author 系统
+ * @date 2024-07-02 14:12:05
+ */
+@Data
+public class SysChangeTypeKindPageDTO {
+
+    /**
+     * 分类ID
+     */
+    @Schema(description = "分类ID")
+    private Integer changeTypeId;
+
+
+    /**
+     * 类型名称
+     */
+    @Schema(description = "类型名称")
+    private String name;
+
+
+
+
+}

+ 92 - 0
kxs-user/kxs-user-biz/src/main/java/com/kxs/user/biz/controller/admin/SysChangeTypeController.java

@@ -0,0 +1,92 @@
+package com.kxs.user.biz.controller.admin;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.kxs.common.core.util.R;
+import com.kxs.user.api.dto.admin.changeType.SysChangeTypePageDTO;
+import com.kxs.user.api.model.KxsChangeType;
+import com.kxs.user.biz.service.KxsChangeTypeService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 收支分类-筛选分类管理
+ *
+ * @author 系统
+ * @since 2024-07-02 14:12:05
+ */
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("sysChangeType")
+public class SysChangeTypeController {
+
+    /**
+     * 服务对象
+     */
+    private final KxsChangeTypeService kxsChangeTypeService;
+
+
+
+    /**
+     * 运营管理-筛选分类管理列表
+     *
+     * @param page 分页对象
+     * @param param 查询实体
+     * @return 运营管理-筛选分类管理列表
+     */
+    @GetMapping("/page")
+    public R page(Page<KxsChangeType> page, SysChangeTypePageDTO param) {
+        kxsChangeTypeService.changeTypePage(page, param);
+        return R.ok(page);
+    }
+
+
+    /**
+     * 运营管理-筛选分类管理编辑
+     *
+     * @param param 实体对象
+     * @return 运营管理-筛选分类管理编辑
+     */
+    @PutMapping("/editChangeType")
+    public R editChangeType(@RequestBody KxsChangeType param) {
+        return R.ok(kxsChangeTypeService.updateById(param));
+    }
+
+
+    /**
+     * 运营管理-筛选分类管理删除
+     *
+     * @param idList 主键ID结合
+     * @return 运营管理-筛选分类管理删除
+     */
+    @DeleteMapping()
+    public R deleteById(@RequestParam("idList") List<Integer> idList) {
+        return R.ok(kxsChangeTypeService.removeByIds(idList));
+    }
+
+
+    /**
+     * 运营管理-筛选分类管理新增
+     *
+     * @param param 实体对象
+     * @return 运营管理-筛选分类管理新增
+     */
+    @PostMapping("/addChangeType")
+    public R addChangeType(@RequestBody KxsChangeType param) {
+        return R.ok(kxsChangeTypeService.save(param));
+    }
+
+
+
+
+
+}
+

+ 92 - 0
kxs-user/kxs-user-biz/src/main/java/com/kxs/user/biz/controller/admin/SysChangeTypeKindController.java

@@ -0,0 +1,92 @@
+package com.kxs.user.biz.controller.admin;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.kxs.common.core.util.R;
+import com.kxs.user.api.dto.admin.changeTypeKind.SysChangeTypeKindPageDTO;
+import com.kxs.user.api.model.KxsChangeTypeKind;
+import com.kxs.user.biz.service.KxsChangeTypeKindService;
+import lombok.RequiredArgsConstructor;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * 收支分类-详细收支明细分类
+ *
+ * @author 系统
+ * @since 2024-07-02 14:12:05
+ */
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("sysChangeTypeKind")
+public class SysChangeTypeKindController {
+
+    /**
+     * 服务对象
+     */
+    private final KxsChangeTypeKindService kxsChangeTypeKindService;
+
+
+
+    /**
+     * 运营管理-详细收支明细列表
+     *
+     * @param page 分页对象
+     * @param param 查询实体
+     * @return 运营管理-详细收支明细列表
+     */
+    @GetMapping("/page")
+    public R page(Page<KxsChangeTypeKind> page, SysChangeTypeKindPageDTO param) {
+        kxsChangeTypeKindService.changeTypeKindPage(page, param);
+        return R.ok(page);
+    }
+
+
+    /**
+     * 运营管理-详细收支明细新增
+     *
+     * @param param 实体对象
+     * @return 运营管理-详细收支明细新增
+     */
+    @PostMapping("/addChangeTypeKind")
+    public R addChangeTypeKind(@RequestBody KxsChangeTypeKind param) {
+        return R.ok(kxsChangeTypeKindService.save(param));
+    }
+
+
+    /**
+     * 运营管理-详细收支明细编辑
+     *
+     * @param param 实体对象
+     * @return 运营管理-详细收支明细编辑
+     */
+    @PutMapping("/editChangeTypeKind")
+    public R editChangeTypeKind(@RequestBody KxsChangeTypeKind param) {
+        return R.ok(kxsChangeTypeKindService.updateById(param));
+    }
+
+
+    /**
+     * 运营管理-详细收支明细删除
+     *
+     * @param idList 主键ID结合
+     * @return 运营管理-详细收支明细删除
+     */
+    @DeleteMapping()
+    public R deleteById(@RequestParam("idList") List<Integer> idList) {
+        return R.ok(kxsChangeTypeKindService.removeByIds(idList));
+    }
+
+
+
+
+
+}
+

+ 12 - 0
kxs-user/kxs-user-biz/src/main/java/com/kxs/user/biz/mapper/KxsChangeTypeKindMapper.java

@@ -1,8 +1,13 @@
 package com.kxs.user.biz.mapper;
 package com.kxs.user.biz.mapper;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.kxs.user.api.dto.admin.changeTypeKind.SysChangeTypeKindPageDTO;
 import com.kxs.user.api.model.KxsChangeTypeKind;
 import com.kxs.user.api.model.KxsChangeTypeKind;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 
 /**
 /**
  * 收支明细分类明细表(KxsChangeTypeKind)表数据库访问层
  * 收支明细分类明细表(KxsChangeTypeKind)表数据库访问层
@@ -13,5 +18,12 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 @Mapper
 public interface KxsChangeTypeKindMapper extends BaseMapper<KxsChangeTypeKind> {
 public interface KxsChangeTypeKindMapper extends BaseMapper<KxsChangeTypeKind> {
 
 
+    /**
+     * 分页查询
+     * @param page
+     * @param param
+     * @return
+     */
+    List<KxsChangeTypeKind> changeTypeKindPage(Page page, @Param("query") SysChangeTypeKindPageDTO param);
 }
 }
 
 

+ 12 - 0
kxs-user/kxs-user-biz/src/main/java/com/kxs/user/biz/mapper/KxsChangeTypeMapper.java

@@ -1,8 +1,13 @@
 package com.kxs.user.biz.mapper;
 package com.kxs.user.biz.mapper;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.kxs.user.api.dto.admin.changeType.SysChangeTypePageDTO;
 import com.kxs.user.api.model.KxsChangeType;
 import com.kxs.user.api.model.KxsChangeType;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
 
 
 /**
 /**
  * 收支明细分类表(KxsChangeType)表数据库访问层
  * 收支明细分类表(KxsChangeType)表数据库访问层
@@ -13,5 +18,12 @@ import org.apache.ibatis.annotations.Mapper;
 @Mapper
 @Mapper
 public interface KxsChangeTypeMapper extends BaseMapper<KxsChangeType> {
 public interface KxsChangeTypeMapper extends BaseMapper<KxsChangeType> {
 
 
+    /**
+     * 分页查询
+     * @param page
+     * @param param
+     * @return
+     */
+    List<KxsChangeType> changeTypePage(Page page, @Param("query") SysChangeTypePageDTO param);
 }
 }
 
 

+ 26 - 0
kxs-user/kxs-user-biz/src/main/java/com/kxs/user/biz/service/KxsChangeTypeKindService.java

@@ -0,0 +1,26 @@
+package com.kxs.user.biz.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.kxs.user.api.dto.admin.changeTypeKind.SysChangeTypeKindPageDTO;
+import com.kxs.user.api.model.KxsChangeTypeKind;
+
+import java.util.List;
+
+/**
+ * 收支明细分类明细表(KxsChangeTypeKind)表服务接口
+ *
+ * @author 系统
+ * @since 2024-07-02 14:11:53
+ */
+public interface KxsChangeTypeKindService extends IService<KxsChangeTypeKind> {
+
+    /**
+     * 收支明细分类明细分页查询
+     * @param page
+     * @param param
+     * @return
+     */
+    List<KxsChangeTypeKind> changeTypeKindPage(Page page, SysChangeTypeKindPageDTO param);
+}
+

+ 27 - 0
kxs-user/kxs-user-biz/src/main/java/com/kxs/user/biz/service/KxsChangeTypeService.java

@@ -0,0 +1,27 @@
+package com.kxs.user.biz.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.kxs.user.api.dto.admin.changeType.SysChangeTypePageDTO;
+import com.kxs.user.api.model.KxsChangeType;
+
+import java.util.List;
+
+/**
+ * 收支明细分类表(KxsChangeType)表服务接口
+ *
+ * @author 系统
+ * @since 2024-07-02 14:11:54
+ */
+public interface KxsChangeTypeService extends IService<KxsChangeType> {
+
+    /**
+     * 分页查询分类数据
+     * @param page
+     * @param param
+     * @return
+     */
+    List<KxsChangeType> changeTypePage(Page page, SysChangeTypePageDTO param);
+
+}
+

+ 31 - 0
kxs-user/kxs-user-biz/src/main/java/com/kxs/user/biz/service/impl/KxsChangeTypeKindServiceImpl.java

@@ -0,0 +1,31 @@
+package com.kxs.user.biz.service.impl;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.kxs.user.api.dto.admin.changeTypeKind.SysChangeTypeKindPageDTO;
+import com.kxs.user.biz.mapper.KxsChangeTypeKindMapper;
+import com.kxs.user.api.model.KxsChangeTypeKind;
+import com.kxs.user.biz.service.KxsChangeTypeKindService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 收支明细分类明细表(KxsChangeTypeKind)表服务实现类
+ *
+ * @author 系统
+ * @since 2024-07-02 14:11:53
+ */
+@Service("kxsChangeTypeKindService")
+public class KxsChangeTypeKindServiceImpl extends ServiceImpl<KxsChangeTypeKindMapper, KxsChangeTypeKind> implements KxsChangeTypeKindService {
+
+    @Override
+    public List<KxsChangeTypeKind> changeTypeKindPage(Page page, SysChangeTypeKindPageDTO param) {
+        List<KxsChangeTypeKind> list = baseMapper.changeTypeKindPage(page, param);
+        if(page !=null){
+            page.setRecords(list);
+        }
+        return list;
+    }
+}
+

+ 31 - 0
kxs-user/kxs-user-biz/src/main/java/com/kxs/user/biz/service/impl/KxsChangeTypeServiceImpl.java

@@ -0,0 +1,31 @@
+package com.kxs.user.biz.service.impl;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.kxs.user.api.dto.admin.changeType.SysChangeTypePageDTO;
+import com.kxs.user.api.model.KxsChangeType;
+import com.kxs.user.biz.mapper.KxsChangeTypeMapper;
+import com.kxs.user.biz.service.KxsChangeTypeService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 收支明细分类表(KxsChangeType)表服务实现类
+ *
+ * @author 系统
+ * @since 2024-07-02 14:11:54
+ */
+@Service("kxsChangeTypeService")
+public class KxsChangeTypeServiceImpl extends ServiceImpl<KxsChangeTypeMapper, KxsChangeType> implements KxsChangeTypeService {
+
+    @Override
+    public List<KxsChangeType> changeTypePage(Page page, SysChangeTypePageDTO param) {
+        List<KxsChangeType> list = baseMapper.changeTypePage(page, param);
+        if(page != null){
+            page.setRecords(list);
+        }
+        return list;
+    }
+}
+

+ 13 - 0
kxs-user/kxs-user-biz/src/main/resources/mapper/KxsChangeTypeKindMapper.xml

@@ -15,4 +15,17 @@
 
 
     </resultMap>
     </resultMap>
 
 
+    <select id="changeTypeKindPage" resultMap="KxsChangeTypeKindMap">
+        select * from kxs_change_type_kind kctk
+        <where>
+            and kctk.del_flag = 0
+            <if test="query.changeTypeId != null and query.changeTypeId != ''">
+                AND kctk.change_type_id = #{query.changeTypeId}
+            </if>
+            <if test="query.name != null and query.name != ''">
+                <bind name="nameLike" value="'%'+query.name+'%'"/>
+                AND kctk.name LIKE #{nameLike}
+            </if>
+        </where>
+    </select>
 </mapper>
 </mapper>

+ 18 - 0
kxs-user/kxs-user-biz/src/main/resources/mapper/KxsChangeTypeMapper.xml

@@ -14,4 +14,22 @@
 
 
     </resultMap>
     </resultMap>
 
 
+    <select id="changeTypePage" resultMap="KxsChangeTypeMap">
+        SELECT
+            *
+        FROM
+            kxs_change_type kct
+        <where>
+            and kct.del_flag = 0
+            <if test="query.kind != null and query.kind != ''">
+                <bind name="kindLike" value="'%'+query.kind+'%'"/>
+                AND kct.kind LIKE #{kindLike}
+            </if>
+            <if test="query.name != null and query.name != ''">
+                <bind name="nameLike" value="'%'+query.name+'%'"/>
+                AND kct.name LIKE #{nameLike}
+            </if>
+        </where>
+    </select>
+
 </mapper>
 </mapper>