yzc 1 vuosi sitten
vanhempi
commit
573a7c8371

+ 71 - 0
hx-oa/src/main/java/com/fjhx/oa/controller/seal/SealConfigController.java

@@ -0,0 +1,71 @@
+package com.fjhx.oa.controller.seal;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.oa.entity.seal.dto.SealConfigDto;
+import com.fjhx.oa.entity.seal.dto.SealConfigSelectDto;
+import com.fjhx.oa.entity.seal.vo.SealConfigVo;
+import com.fjhx.oa.service.seal.SealConfigService;
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+
+/**
+ * <p>
+ * 印章管理 前端控制器
+ * </p>
+ *
+ * @author
+ * @since 2024-04-09
+ */
+@RestController
+@RequestMapping("/sealConfig")
+public class SealConfigController {
+
+    @Autowired
+    private SealConfigService sealConfigService;
+
+    /**
+     * 印章管理分页
+     */
+    @PostMapping("/page")
+    public Page<SealConfigVo> page(@RequestBody SealConfigSelectDto dto) {
+        return sealConfigService.getPage(dto);
+    }
+
+    /**
+     * 印章管理明细
+     */
+    @PostMapping("/detail")
+    public SealConfigVo detail(@RequestBody BaseSelectDto dto) {
+        return sealConfigService.detail(dto.getId());
+    }
+
+    /**
+     * 印章管理新增
+     */
+    @PostMapping("/add")
+    public void add(@RequestBody SealConfigDto sealConfigDto) {
+        sealConfigService.add(sealConfigDto);
+    }
+
+    /**
+     * 印章管理编辑
+     */
+    @PostMapping("/edit")
+    public void edit(@RequestBody SealConfigDto sealConfigDto) {
+        sealConfigService.edit(sealConfigDto);
+    }
+
+    /**
+     * 印章管理删除
+     */
+    @PostMapping("/delete")
+    public void delete(@RequestBody BaseSelectDto dto) {
+        sealConfigService.delete(dto.getId());
+    }
+
+}

+ 17 - 0
hx-oa/src/main/java/com/fjhx/oa/entity/seal/dto/SealConfigDto.java

@@ -0,0 +1,17 @@
+package com.fjhx.oa.entity.seal.dto;
+
+import com.fjhx.oa.entity.seal.po.SealConfig;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 印章管理新增编辑入参实体
+ *
+ * @author
+ * @since 2024-04-09
+ */
+@Getter
+@Setter
+public class SealConfigDto extends SealConfig {
+
+}

+ 32 - 0
hx-oa/src/main/java/com/fjhx/oa/entity/seal/dto/SealConfigSelectDto.java

@@ -0,0 +1,32 @@
+package com.fjhx.oa.entity.seal.dto;
+
+import com.ruoyi.common.core.domain.BaseSelectDto;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 印章管理列表查询入参实体
+ *
+ * @author
+ * @since 2024-04-09
+ */
+@Getter
+@Setter
+public class SealConfigSelectDto extends BaseSelectDto {
+
+    /**
+     * 印章类型
+     */
+    private String type;
+
+    /**
+     * 保管人
+     */
+    private Long custodyUserId;
+
+    /**
+     * 保管部门
+     */
+    private Long custodyDeptId;
+
+}

+ 46 - 0
hx-oa/src/main/java/com/fjhx/oa/entity/seal/po/SealConfig.java

@@ -0,0 +1,46 @@
+package com.fjhx.oa.entity.seal.po;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ruoyi.common.core.domain.BasePo;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 印章管理
+ * </p>
+ *
+ * @author
+ * @since 2024-04-09
+ */
+@Getter
+@Setter
+@TableName("seal_config")
+public class SealConfig extends BasePo {
+
+    /**
+     * 印章名称
+     */
+    private String name;
+
+    /**
+     * 印章类型
+     */
+    private String type;
+
+    /**
+     * 保管人
+     */
+    private Long custodyUserId;
+
+    /**
+     * 保管部门
+     */
+    private Long custodyDeptId;
+
+    /**
+     * 用途说明
+     */
+    private String remark;
+
+}

+ 27 - 0
hx-oa/src/main/java/com/fjhx/oa/entity/seal/vo/SealConfigVo.java

@@ -0,0 +1,27 @@
+package com.fjhx.oa.entity.seal.vo;
+
+import com.fjhx.oa.entity.seal.po.SealConfig;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * 印章管理列表查询返回值实体
+ *
+ * @author
+ * @since 2024-04-09
+ */
+@Getter
+@Setter
+public class SealConfigVo extends SealConfig {
+
+    /**
+     * 保管人
+     */
+    private String custodyUserName;
+
+    /**
+     * 保管部门
+     */
+    private String custodyDeptName;
+
+}

+ 26 - 0
hx-oa/src/main/java/com/fjhx/oa/mapper/seal/SealConfigMapper.java

@@ -0,0 +1,26 @@
+package com.fjhx.oa.mapper.seal;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.oa.entity.seal.po.SealConfig;
+import com.fjhx.oa.entity.seal.vo.SealConfigVo;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import org.apache.ibatis.annotations.Param;
+
+
+/**
+ * <p>
+ * 印章管理 Mapper 接口
+ * </p>
+ *
+ * @author
+ * @since 2024-04-09
+ */
+public interface SealConfigMapper extends BaseMapper<SealConfig> {
+
+    /**
+     * 印章管理分页
+     */
+    Page<SealConfigVo> getPage(@Param("page") Page<Object> page, @Param("ew") IWrapper<SealConfig> wrapper);
+
+}

+ 0 - 1
hx-oa/src/main/java/com/fjhx/oa/service/education/impl/EducationSubsidyServiceImpl.java

@@ -51,7 +51,6 @@ public class EducationSubsidyServiceImpl extends ServiceImpl<EducationSubsidyMap
         IWrapper<EducationSubsidy> wrapper = getWrapper();
 
         wrapper.keyword(dto.getKeyword(), new SqlField("es", EducationSubsidy::getCode));
-        wrapper.eq("es", EducationSubsidy::getStatus, dto.getStatus());
 
         wrapper.orderByDesc("es", EducationSubsidy::getId);
         Page<EducationSubsidyVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);

+ 46 - 0
hx-oa/src/main/java/com/fjhx/oa/service/seal/SealConfigService.java

@@ -0,0 +1,46 @@
+package com.fjhx.oa.service.seal;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.oa.entity.seal.dto.SealConfigDto;
+import com.fjhx.oa.entity.seal.dto.SealConfigSelectDto;
+import com.fjhx.oa.entity.seal.po.SealConfig;
+import com.fjhx.oa.entity.seal.vo.SealConfigVo;
+import com.ruoyi.common.core.service.BaseService;
+
+
+/**
+ * <p>
+ * 印章管理 服务类
+ * </p>
+ *
+ * @author
+ * @since 2024-04-09
+ */
+public interface SealConfigService extends BaseService<SealConfig> {
+
+    /**
+     * 印章管理分页
+     */
+    Page<SealConfigVo> getPage(SealConfigSelectDto dto);
+
+    /**
+     * 印章管理明细
+     */
+    SealConfigVo detail(Long id);
+
+    /**
+     * 印章管理新增
+     */
+    void add(SealConfigDto sealConfigDto);
+
+    /**
+     * 印章管理编辑
+     */
+    void edit(SealConfigDto sealConfigDto);
+
+    /**
+     * 印章管理删除
+     */
+    void delete(Long id);
+
+}

+ 82 - 0
hx-oa/src/main/java/com/fjhx/oa/service/seal/impl/SealConfigServiceImpl.java

@@ -0,0 +1,82 @@
+package com.fjhx.oa.service.seal.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.util.ObjectUtil;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.oa.entity.seal.dto.SealConfigDto;
+import com.fjhx.oa.entity.seal.dto.SealConfigSelectDto;
+import com.fjhx.oa.entity.seal.po.SealConfig;
+import com.fjhx.oa.entity.seal.vo.SealConfigVo;
+import com.fjhx.oa.mapper.seal.SealConfigMapper;
+import com.fjhx.oa.service.seal.SealConfigService;
+import com.fjhx.tenant.utils.DeptUstil;
+import com.ruoyi.common.utils.wrapper.IWrapper;
+import com.ruoyi.common.utils.wrapper.SqlField;
+import com.ruoyi.system.utils.UserUtil;
+import org.springframework.stereotype.Service;
+
+import java.util.Arrays;
+import java.util.List;
+
+
+/**
+ * <p>
+ * 印章管理 服务实现类
+ * </p>
+ *
+ * @author
+ * @since 2024-04-09
+ */
+@Service
+public class SealConfigServiceImpl extends ServiceImpl<SealConfigMapper, SealConfig> implements SealConfigService {
+
+    @Override
+    public Page<SealConfigVo> getPage(SealConfigSelectDto dto) {
+        IWrapper<SealConfig> wrapper = getWrapper();
+
+        wrapper.keyword(dto.getKeyword(), new SqlField("sc", SealConfig::getName), new SqlField("sc", SealConfig::getRemark));
+        wrapper.eq("sc", SealConfig::getType, dto.getType());
+        wrapper.eq("sc", SealConfig::getCustodyUserId, dto.getCustodyUserId());
+        wrapper.eq("sc", SealConfig::getCustodyDeptId, dto.getCustodyDeptId());
+
+        wrapper.orderByDesc("sc", SealConfig::getId);
+        Page<SealConfigVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
+        List<SealConfigVo> records = page.getRecords();
+        setInfo(records);
+        return page;
+    }
+
+    @Override
+    public SealConfigVo detail(Long id) {
+        SealConfig SealConfig = this.getById(id);
+        SealConfigVo result = BeanUtil.toBean(SealConfig, SealConfigVo.class);
+        setInfo(Arrays.asList(result));
+        return result;
+    }
+
+    void setInfo(List<SealConfigVo> records) {
+        if (ObjectUtil.isEmpty(records)) {
+            return;
+        }
+
+        UserUtil.assignmentNickName(records, SealConfigVo::getCustodyUserId, SealConfigVo::setCustodyUserName);
+        DeptUstil.assignmentNickName(records, SealConfigVo::getCustodyDeptId, SealConfigVo::setCustodyDeptName);
+    }
+
+    @Override
+    public void add(SealConfigDto sealConfigDto) {
+        this.save(sealConfigDto);
+    }
+
+    @Override
+    public void edit(SealConfigDto sealConfigDto) {
+        this.updateById(sealConfigDto);
+    }
+
+    @Override
+    public void delete(Long id) {
+        this.removeById(id);
+    }
+
+}

+ 19 - 0
hx-oa/src/main/resources/mapper/seal/SealConfigMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fjhx.oa.mapper.seal.SealConfigMapper">
+    <select id="getPage" resultType="com.fjhx.oa.entity.seal.vo.SealConfigVo">
+        select sc.id,
+               sc.name,
+               sc.type,
+               sc.custody_user_id,
+               sc.custody_dept_id,
+               sc.remark,
+               sc.create_user,
+               sc.create_time,
+               sc.update_user,
+               sc.update_time
+        from seal_config sc
+            ${ew.customSqlSegment}
+    </select>
+
+</mapper>