소스 검색

学习资料表

lamphua 1 개월 전
부모
커밋
01a886d4fd

+ 97
- 0
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcResourceController.java 파일 보기

@@ -0,0 +1,97 @@
1
+package com.ruoyi.web.controller.oa;
2
+
3
+import java.util.List;
4
+import javax.servlet.http.HttpServletResponse;
5
+import org.springframework.beans.factory.annotation.Autowired;
6
+import org.springframework.web.bind.annotation.GetMapping;
7
+import org.springframework.web.bind.annotation.PostMapping;
8
+import org.springframework.web.bind.annotation.PutMapping;
9
+import org.springframework.web.bind.annotation.DeleteMapping;
10
+import org.springframework.web.bind.annotation.PathVariable;
11
+import org.springframework.web.bind.annotation.RequestBody;
12
+import org.springframework.web.bind.annotation.RequestMapping;
13
+import org.springframework.web.bind.annotation.RestController;
14
+import com.ruoyi.common.annotation.Log;
15
+import com.ruoyi.common.core.controller.BaseController;
16
+import com.ruoyi.common.core.domain.AjaxResult;
17
+import com.ruoyi.common.enums.BusinessType;
18
+import com.ruoyi.oa.domain.CmcResource;
19
+import com.ruoyi.oa.service.ICmcResourceService;
20
+import com.ruoyi.common.utils.poi.ExcelUtil;
21
+import com.ruoyi.common.core.page.TableDataInfo;
22
+
23
+/**
24
+ * 学习资料Controller
25
+ * 
26
+ * @author cmc
27
+ * @date 2025-03-05
28
+ */
29
+@RestController
30
+@RequestMapping("/oa/resource")
31
+public class CmcResourceController extends BaseController
32
+{
33
+    @Autowired
34
+    private ICmcResourceService cmcResourceService;
35
+
36
+    /**
37
+     * 查询学习资料列表
38
+     */
39
+    @GetMapping("/list")
40
+    public TableDataInfo list(CmcResource cmcResource)
41
+    {
42
+        startPage();
43
+        List<CmcResource> list = cmcResourceService.selectCmcResourceList(cmcResource);
44
+        return getDataTable(list);
45
+    }
46
+
47
+    /**
48
+     * 导出学习资料列表
49
+     */
50
+    @Log(title = "学习资料", businessType = BusinessType.EXPORT)
51
+    @PostMapping("/export")
52
+    public void export(HttpServletResponse response, CmcResource cmcResource)
53
+    {
54
+        List<CmcResource> list = cmcResourceService.selectCmcResourceList(cmcResource);
55
+        ExcelUtil<CmcResource> util = new ExcelUtil<CmcResource>(CmcResource.class);
56
+        util.exportExcel(response, list, "学习资料数据");
57
+    }
58
+
59
+    /**
60
+     * 获取学习资料详细信息
61
+     */
62
+    @GetMapping(value = "/{resourceId}")
63
+    public AjaxResult getInfo(@PathVariable("resourceId") Integer resourceId)
64
+    {
65
+        return success(cmcResourceService.selectCmcResourceByResourceId(resourceId));
66
+    }
67
+
68
+    /**
69
+     * 新增学习资料
70
+     */
71
+    @Log(title = "学习资料", businessType = BusinessType.INSERT)
72
+    @PostMapping
73
+    public AjaxResult add(@RequestBody CmcResource cmcResource)
74
+    {
75
+        return toAjax(cmcResourceService.insertCmcResource(cmcResource));
76
+    }
77
+
78
+    /**
79
+     * 修改学习资料
80
+     */
81
+    @Log(title = "学习资料", businessType = BusinessType.UPDATE)
82
+    @PutMapping
83
+    public AjaxResult edit(@RequestBody CmcResource cmcResource)
84
+    {
85
+        return toAjax(cmcResourceService.updateCmcResource(cmcResource));
86
+    }
87
+
88
+    /**
89
+     * 删除学习资料
90
+     */
91
+    @Log(title = "学习资料", businessType = BusinessType.DELETE)
92
+	@DeleteMapping("/{resourceIds}")
93
+    public AjaxResult remove(@PathVariable Integer[] resourceIds)
94
+    {
95
+        return toAjax(cmcResourceService.deleteCmcResourceByResourceIds(resourceIds));
96
+    }
97
+}

+ 7
- 0
oa-back/ruoyi-flowable/src/main/java/com/ruoyi/flowable/service/impl/FlowTaskServiceImpl.java 파일 보기

@@ -140,6 +140,8 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
140 140
     @Resource
141 141
     private ICmcPerformanceService cmcPerformanceService;
142 142
     @Resource
143
+    private ICmcTrainApprovalService cmcTrainApprovalService;
144
+    @Resource
143 145
     private ICmcBudgetService cmcBudgetService;
144 146
     @Resource
145 147
     private FlowVarInstMapper flowVarInstMapper;
@@ -1811,5 +1813,10 @@ public class FlowTaskServiceImpl extends FlowServiceFactory implements IFlowTask
1811 1813
             if (cmcPerformance != null)
1812 1814
                 flowTaskDto.setTitle(cmcPerformance.getRemark());
1813 1815
         }
1816
+        if (flowTaskDto.getProcDefName().equals("参培审核")) {
1817
+            CmcTrainApproval cmcTrainApproval = cmcTrainApprovalService.selectCmcTrainApprovalByParticipateId(formId);
1818
+            if (cmcTrainApproval != null)
1819
+                flowTaskDto.setTitle(cmcTrainApproval.getContent());
1820
+        }
1814 1821
     }
1815 1822
 }

+ 178
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcResource.java 파일 보기

@@ -0,0 +1,178 @@
1
+package com.ruoyi.oa.domain;
2
+
3
+import java.util.Date;
4
+import com.fasterxml.jackson.annotation.JsonFormat;
5
+import com.ruoyi.common.core.domain.entity.SysDept;
6
+import com.ruoyi.common.core.domain.entity.SysUser;
7
+import org.apache.commons.lang3.builder.ToStringBuilder;
8
+import org.apache.commons.lang3.builder.ToStringStyle;
9
+import com.ruoyi.common.annotation.Excel;
10
+import com.ruoyi.common.core.domain.BaseEntity;
11
+
12
+/**
13
+ * 学习资料对象 cmc_resource
14
+ * 
15
+ * @author cmc
16
+ * @date 2025-03-05
17
+ */
18
+public class CmcResource extends BaseEntity
19
+{
20
+    private static final long serialVersionUID = 1L;
21
+
22
+    /** 资料id */
23
+    private Integer resourceId;
24
+
25
+    /** 上传人 */
26
+    private Long uploader;
27
+    @Excel(name = "上传人")
28
+    private String uploadUserName;
29
+    private SysUser uploadUser;
30
+
31
+    /** 上传部门 */
32
+    private Long uploadDept;
33
+    @Excel(name = "上传部门")
34
+    private String deptName;
35
+    private SysDept dept;
36
+
37
+    /** 标题 */
38
+    @Excel(name = "标题")
39
+    private String title;
40
+
41
+    /** 上传附件 */
42
+    @Excel(name = "上传附件")
43
+    private String sourcePath;
44
+
45
+    /** 文件类型 */
46
+    @Excel(name = "文件类型")
47
+    private String type;
48
+
49
+    /** 专业领域 */
50
+    @Excel(name = "专业领域")
51
+    private String field;
52
+
53
+    /** 上传时间 */
54
+    @JsonFormat(pattern = "yyyy-MM-dd")
55
+    @Excel(name = "上传时间", width = 30, dateFormat = "yyyy-MM-dd")
56
+    private Date uploadTime;
57
+
58
+    /** 学习时长 */
59
+    @Excel(name = "学习时长")
60
+    private Long hours;
61
+
62
+    public void setResourceId(Integer resourceId) 
63
+    {
64
+        this.resourceId = resourceId;
65
+    }
66
+
67
+    public Integer getResourceId() 
68
+    {
69
+        return resourceId;
70
+    }
71
+    public void setUploader(Long uploader) 
72
+    {
73
+        this.uploader = uploader;
74
+    }
75
+
76
+    public Long getUploader() 
77
+    {
78
+        return uploader;
79
+    }
80
+    public void setUploadDept(Long uploadDept) 
81
+    {
82
+        this.uploadDept = uploadDept;
83
+    }
84
+
85
+    public Long getUploadDept() 
86
+    {
87
+        return uploadDept;
88
+    }
89
+    public void setTitle(String title) 
90
+    {
91
+        this.title = title;
92
+    }
93
+
94
+    public String getTitle() 
95
+    {
96
+        return title;
97
+    }
98
+    public void setSourcePath(String sourcePath) 
99
+    {
100
+        this.sourcePath = sourcePath;
101
+    }
102
+
103
+    public String getSourcePath() 
104
+    {
105
+        return sourcePath;
106
+    }
107
+    public void setType(String type) 
108
+    {
109
+        this.type = type;
110
+    }
111
+
112
+    public String getType() 
113
+    {
114
+        return type;
115
+    }
116
+    public void setField(String field) 
117
+    {
118
+        this.field = field;
119
+    }
120
+
121
+    public String getField() 
122
+    {
123
+        return field;
124
+    }
125
+    public void setUploadTime(Date uploadTime) 
126
+    {
127
+        this.uploadTime = uploadTime;
128
+    }
129
+
130
+    public Date getUploadTime() 
131
+    {
132
+        return uploadTime;
133
+    }
134
+    public void setHours(Long hours) 
135
+    {
136
+        this.hours = hours;
137
+    }
138
+
139
+    public Long getHours() 
140
+    {
141
+        return hours;
142
+    }
143
+    public void setUploadUser(SysUser uploadUser)
144
+    {
145
+        this.uploadUser = uploadUser;
146
+        this.uploadUserName = uploadUser == null ? "" : uploadUser.getNickName();
147
+    }
148
+
149
+    public SysUser getUploadUser()
150
+    {
151
+        return uploadUser;
152
+    }
153
+    public void setDept(SysDept dept)
154
+    {
155
+        this.dept = dept;
156
+        this.deptName = dept == null ? "" : dept.getDeptName();
157
+    }
158
+
159
+    public SysDept getDept()
160
+    {
161
+        return dept;
162
+    }
163
+
164
+    @Override
165
+    public String toString() {
166
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
167
+            .append("resourceId", getResourceId())
168
+            .append("uploader", getUploader())
169
+            .append("uploadDept", getUploadDept())
170
+            .append("title", getTitle())
171
+            .append("sourcePath", getSourcePath())
172
+            .append("type", getType())
173
+            .append("field", getField())
174
+            .append("uploadTime", getUploadTime())
175
+            .append("hours", getHours())
176
+            .toString();
177
+    }
178
+}

+ 61
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/mapper/CmcResourceMapper.java 파일 보기

@@ -0,0 +1,61 @@
1
+package com.ruoyi.oa.mapper;
2
+
3
+import java.util.List;
4
+import com.ruoyi.oa.domain.CmcResource;
5
+
6
+/**
7
+ * 学习资料Mapper接口
8
+ * 
9
+ * @author cmc
10
+ * @date 2025-03-05
11
+ */
12
+public interface CmcResourceMapper 
13
+{
14
+    /**
15
+     * 查询学习资料
16
+     * 
17
+     * @param resourceId 学习资料主键
18
+     * @return 学习资料
19
+     */
20
+    public CmcResource selectCmcResourceByResourceId(Integer resourceId);
21
+
22
+    /**
23
+     * 查询学习资料列表
24
+     * 
25
+     * @param cmcResource 学习资料
26
+     * @return 学习资料集合
27
+     */
28
+    public List<CmcResource> selectCmcResourceList(CmcResource cmcResource);
29
+
30
+    /**
31
+     * 新增学习资料
32
+     * 
33
+     * @param cmcResource 学习资料
34
+     * @return 结果
35
+     */
36
+    public int insertCmcResource(CmcResource cmcResource);
37
+
38
+    /**
39
+     * 修改学习资料
40
+     * 
41
+     * @param cmcResource 学习资料
42
+     * @return 结果
43
+     */
44
+    public int updateCmcResource(CmcResource cmcResource);
45
+
46
+    /**
47
+     * 删除学习资料
48
+     * 
49
+     * @param resourceId 学习资料主键
50
+     * @return 结果
51
+     */
52
+    public int deleteCmcResourceByResourceId(Integer resourceId);
53
+
54
+    /**
55
+     * 批量删除学习资料
56
+     * 
57
+     * @param resourceIds 需要删除的数据主键集合
58
+     * @return 结果
59
+     */
60
+    public int deleteCmcResourceByResourceIds(Integer[] resourceIds);
61
+}

+ 61
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/ICmcResourceService.java 파일 보기

@@ -0,0 +1,61 @@
1
+package com.ruoyi.oa.service;
2
+
3
+import java.util.List;
4
+import com.ruoyi.oa.domain.CmcResource;
5
+
6
+/**
7
+ * 学习资料Service接口
8
+ * 
9
+ * @author cmc
10
+ * @date 2025-03-05
11
+ */
12
+public interface ICmcResourceService 
13
+{
14
+    /**
15
+     * 查询学习资料
16
+     * 
17
+     * @param resourceId 学习资料主键
18
+     * @return 学习资料
19
+     */
20
+    public CmcResource selectCmcResourceByResourceId(Integer resourceId);
21
+
22
+    /**
23
+     * 查询学习资料列表
24
+     * 
25
+     * @param cmcResource 学习资料
26
+     * @return 学习资料集合
27
+     */
28
+    public List<CmcResource> selectCmcResourceList(CmcResource cmcResource);
29
+
30
+    /**
31
+     * 新增学习资料
32
+     * 
33
+     * @param cmcResource 学习资料
34
+     * @return 结果
35
+     */
36
+    public int insertCmcResource(CmcResource cmcResource);
37
+
38
+    /**
39
+     * 修改学习资料
40
+     * 
41
+     * @param cmcResource 学习资料
42
+     * @return 结果
43
+     */
44
+    public int updateCmcResource(CmcResource cmcResource);
45
+
46
+    /**
47
+     * 批量删除学习资料
48
+     * 
49
+     * @param resourceIds 需要删除的学习资料主键集合
50
+     * @return 结果
51
+     */
52
+    public int deleteCmcResourceByResourceIds(Integer[] resourceIds);
53
+
54
+    /**
55
+     * 删除学习资料信息
56
+     * 
57
+     * @param resourceId 学习资料主键
58
+     * @return 结果
59
+     */
60
+    public int deleteCmcResourceByResourceId(Integer resourceId);
61
+}

+ 93
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/impl/CmcResourceServiceImpl.java 파일 보기

@@ -0,0 +1,93 @@
1
+package com.ruoyi.oa.service.impl;
2
+
3
+import java.util.List;
4
+import org.springframework.beans.factory.annotation.Autowired;
5
+import org.springframework.stereotype.Service;
6
+import com.ruoyi.oa.mapper.CmcResourceMapper;
7
+import com.ruoyi.oa.domain.CmcResource;
8
+import com.ruoyi.oa.service.ICmcResourceService;
9
+
10
+/**
11
+ * 学习资料Service业务层处理
12
+ * 
13
+ * @author cmc
14
+ * @date 2025-03-05
15
+ */
16
+@Service
17
+public class CmcResourceServiceImpl implements ICmcResourceService 
18
+{
19
+    @Autowired
20
+    private CmcResourceMapper cmcResourceMapper;
21
+
22
+    /**
23
+     * 查询学习资料
24
+     * 
25
+     * @param resourceId 学习资料主键
26
+     * @return 学习资料
27
+     */
28
+    @Override
29
+    public CmcResource selectCmcResourceByResourceId(Integer resourceId)
30
+    {
31
+        return cmcResourceMapper.selectCmcResourceByResourceId(resourceId);
32
+    }
33
+
34
+    /**
35
+     * 查询学习资料列表
36
+     * 
37
+     * @param cmcResource 学习资料
38
+     * @return 学习资料
39
+     */
40
+    @Override
41
+    public List<CmcResource> selectCmcResourceList(CmcResource cmcResource)
42
+    {
43
+        return cmcResourceMapper.selectCmcResourceList(cmcResource);
44
+    }
45
+
46
+    /**
47
+     * 新增学习资料
48
+     * 
49
+     * @param cmcResource 学习资料
50
+     * @return 结果
51
+     */
52
+    @Override
53
+    public int insertCmcResource(CmcResource cmcResource)
54
+    {
55
+        return cmcResourceMapper.insertCmcResource(cmcResource);
56
+    }
57
+
58
+    /**
59
+     * 修改学习资料
60
+     * 
61
+     * @param cmcResource 学习资料
62
+     * @return 结果
63
+     */
64
+    @Override
65
+    public int updateCmcResource(CmcResource cmcResource)
66
+    {
67
+        return cmcResourceMapper.updateCmcResource(cmcResource);
68
+    }
69
+
70
+    /**
71
+     * 批量删除学习资料
72
+     * 
73
+     * @param resourceIds 需要删除的学习资料主键
74
+     * @return 结果
75
+     */
76
+    @Override
77
+    public int deleteCmcResourceByResourceIds(Integer[] resourceIds)
78
+    {
79
+        return cmcResourceMapper.deleteCmcResourceByResourceIds(resourceIds);
80
+    }
81
+
82
+    /**
83
+     * 删除学习资料信息
84
+     * 
85
+     * @param resourceId 学习资料主键
86
+     * @return 结果
87
+     */
88
+    @Override
89
+    public int deleteCmcResourceByResourceId(Integer resourceId)
90
+    {
91
+        return cmcResourceMapper.deleteCmcResourceByResourceId(resourceId);
92
+    }
93
+}

+ 105
- 0
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcResourceMapper.xml 파일 보기

@@ -0,0 +1,105 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.ruoyi.oa.mapper.CmcResourceMapper">
6
+    
7
+    <resultMap type="CmcResource" id="CmcResourceResult">
8
+        <result property="resourceId"    column="resource_id"    />
9
+        <result property="uploader"    column="uploader"    />
10
+        <result property="uploadDept"    column="upload_dept"    />
11
+        <result property="title"    column="title"    />
12
+        <result property="sourcePath"    column="source_path"    />
13
+        <result property="type"    column="type"    />
14
+        <result property="field"    column="field"    />
15
+        <result property="uploadTime"    column="upload_time"    />
16
+        <result property="hours"    column="hours"    />
17
+        <association property="uploadUser"    javaType="SysUser"         resultMap="UploadUserResult" />
18
+        <association property="dept"    javaType="SysDept"         resultMap="SysDeptResult" />
19
+    </resultMap>
20
+
21
+    <resultMap type="SysUser" id="UploadUserResult">
22
+        <result property="userId"    column="user_id"    />
23
+        <result property="nickName"    column="nick_name"    />
24
+    </resultMap>
25
+
26
+    <resultMap type="SysDept" id="SysDeptResult">
27
+        <result property="deptId"    column="dept_id"    />
28
+        <result property="deptName"    column="dept_name"    />
29
+    </resultMap>
30
+
31
+    <sql id="selectCmcResourceVo">
32
+        select r.resource_id, r.uploader, r.upload_dept, r.title, r.source_path, r.type, r.field, r.upload_time, r.hours from cmc_resource as r
33
+        left join sys_user as u on u.user_id = r.uploader
34
+        left join sys_dept as d on d.dept_id = r.upload_dept
35
+    </sql>
36
+
37
+    <select id="selectCmcResourceList" parameterType="CmcResource" resultMap="CmcResourceResult">
38
+        <include refid="selectCmcResourceVo"/>
39
+        <where>  
40
+            <if test="uploader != null "> and r.uploader = #{uploader}</if>
41
+            <if test="uploadDept != null "> and r.upload_dept = #{uploadDept}</if>
42
+            <if test="title != null  and title != ''"> and r.title = #{title}</if>
43
+            <if test="sourcePath != null  and sourcePath != ''"> and r.source_path = #{sourcePath}</if>
44
+            <if test="type != null  and type != ''"> and r.type = #{type}</if>
45
+            <if test="field != null  and field != ''"> and r.field = #{field}</if>
46
+            <if test="uploadTime != null "> and r.upload_time = #{uploadTime}</if>
47
+            <if test="hours != null "> and r.hours = #{hours}</if>
48
+        </where>
49
+    </select>
50
+    
51
+    <select id="selectCmcResourceByResourceId" parameterType="Integer" resultMap="CmcResourceResult">
52
+        <include refid="selectCmcResourceVo"/>
53
+        where resource_id = #{resourceId}
54
+    </select>
55
+        
56
+    <insert id="insertCmcResource" parameterType="CmcResource" useGeneratedKeys="true" keyProperty="resourceId">
57
+        insert into cmc_resource
58
+        <trim prefix="(" suffix=")" suffixOverrides=",">
59
+            <if test="uploader != null">uploader,</if>
60
+            <if test="uploadDept != null">upload_dept,</if>
61
+            <if test="title != null">title,</if>
62
+            <if test="sourcePath != null">source_path,</if>
63
+            <if test="type != null">type,</if>
64
+            <if test="field != null">field,</if>
65
+            <if test="uploadTime != null">upload_time,</if>
66
+            <if test="hours != null">hours,</if>
67
+         </trim>
68
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
69
+            <if test="uploader != null">#{uploader},</if>
70
+            <if test="uploadDept != null">#{uploadDept},</if>
71
+            <if test="title != null">#{title},</if>
72
+            <if test="sourcePath != null">#{sourcePath},</if>
73
+            <if test="type != null">#{type},</if>
74
+            <if test="field != null">#{field},</if>
75
+            <if test="uploadTime != null">#{uploadTime},</if>
76
+            <if test="hours != null">#{hours},</if>
77
+         </trim>
78
+    </insert>
79
+
80
+    <update id="updateCmcResource" parameterType="CmcResource">
81
+        update cmc_resource
82
+        <trim prefix="SET" suffixOverrides=",">
83
+            <if test="uploader != null">uploader = #{uploader},</if>
84
+            <if test="uploadDept != null">upload_dept = #{uploadDept},</if>
85
+            <if test="title != null">title = #{title},</if>
86
+            <if test="sourcePath != null">source_path = #{sourcePath},</if>
87
+            <if test="type != null">type = #{type},</if>
88
+            <if test="field != null">field = #{field},</if>
89
+            <if test="uploadTime != null">upload_time = #{uploadTime},</if>
90
+            <if test="hours != null">hours = #{hours},</if>
91
+        </trim>
92
+        where resource_id = #{resourceId}
93
+    </update>
94
+
95
+    <delete id="deleteCmcResourceByResourceId" parameterType="Integer">
96
+        delete from cmc_resource where resource_id = #{resourceId}
97
+    </delete>
98
+
99
+    <delete id="deleteCmcResourceByResourceIds" parameterType="String">
100
+        delete from cmc_resource where resource_id in 
101
+        <foreach item="resourceId" collection="array" open="(" separator="," close=")">
102
+            #{resourceId}
103
+        </foreach>
104
+    </delete>
105
+</mapper>

Loading…
취소
저장