浏览代码

更改安全日报字段名

lamphua 11 个月前
父节点
当前提交
7add84a880

+ 2
- 2
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcSafeReportController.java 查看文件

@@ -47,7 +47,7 @@ public class CmcSafeReportController extends BaseController
47 47
         startPage();
48 48
         List<CmcSafeReport> list = cmcSafeReportService.selectCmcSafeReportList(cmcSafeReport);
49 49
         for (CmcSafeReport safeReport : list) {
50
-            String userId = safeReport.getUserId();
50
+            String userId = safeReport.getMember();
51 51
             StringBuilder userName = new StringBuilder();
52 52
             if (userId != null && !userId.equals("") && userId.split(",").length > 0) {
53 53
                 for (String user : userId.split(","))
@@ -67,7 +67,7 @@ public class CmcSafeReportController extends BaseController
67 67
     {
68 68
         List<CmcSafeReport> list = cmcSafeReportService.selectCmcSafeReportList(cmcSafeReport);
69 69
         for (CmcSafeReport safeReport : list) {
70
-            String userId = safeReport.getUserId();
70
+            String userId = safeReport.getMember();
71 71
             StringBuilder userName = new StringBuilder();
72 72
             if (userId != null && !userId.equals("") && userId.split(",").length > 0) {
73 73
                 for (String user : userId.split(","))

+ 9
- 9
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcSafeReport.java 查看文件

@@ -19,7 +19,7 @@ public class CmcSafeReport extends BaseEntity
19 19
     private static final long serialVersionUID = 1L;
20 20
 
21 21
     /** 安全报告id */
22
-    private Long safeReportId;
22
+    private Integer safeReportId;
23 23
 
24 24
     /** 项目id */
25 25
     private String projectId;
@@ -30,7 +30,7 @@ public class CmcSafeReport extends BaseEntity
30 30
     private CmcProject project;
31 31
 
32 32
     /** 公司人员 */
33
-    private String userId;
33
+    private String member;
34 34
     @Excel(name = "公司人员")
35 35
     private String userNames;
36 36
 
@@ -53,12 +53,12 @@ public class CmcSafeReport extends BaseEntity
53 53
     @Excel(name = "报告日期", width = 30, dateFormat = "yyyy-MM-dd")
54 54
     private Date reportDate;
55 55
 
56
-    public void setSafeReportId(Long safeReportId)
56
+    public void setSafeReportId(Integer safeReportId)
57 57
     {
58 58
         this.safeReportId = safeReportId;
59 59
     }
60 60
 
61
-    public Long getSafeReportId()
61
+    public Integer getSafeReportId()
62 62
     {
63 63
         return safeReportId;
64 64
     }
@@ -91,14 +91,14 @@ public class CmcSafeReport extends BaseEntity
91 91
     {
92 92
         return reportDate;
93 93
     }
94
-    public void setUserId(String userId)
94
+    public void setMember(String member)
95 95
     {
96
-        this.userId = userId;
96
+        this.member = member;
97 97
     }
98 98
 
99
-    public String getUserId()
99
+    public String getMember()
100 100
     {
101
-        return userId;
101
+        return member;
102 102
     }
103 103
     public void setUserNames(String userNames)
104 104
     {
@@ -153,7 +153,7 @@ public class CmcSafeReport extends BaseEntity
153 153
                 .append("safeReportId", getSafeReportId())
154 154
                 .append("projectId", getProjectId())
155 155
                 .append("reportDate", getReportDate())
156
-                .append("userId", getUserId())
156
+                .append("member", getMember())
157 157
                 .append("employee", getEmployee())
158 158
                 .append("content", getContent())
159 159
                 .append("reporter", getReporter())

+ 7
- 7
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcSafeReportMapper.xml 查看文件

@@ -8,7 +8,7 @@
8 8
         <result property="safeReportId"    column="safe_report_id"    />
9 9
         <result property="projectId"    column="project_id"    />
10 10
         <result property="reportDate"    column="report_date"    />
11
-        <result property="userId"    column="user_id"    />
11
+        <result property="member"    column="member"    />
12 12
         <result property="employee"    column="employee"    />
13 13
         <result property="content"    column="content"    />
14 14
         <result property="reporter"    column="reporter"    />
@@ -17,7 +17,7 @@
17 17
     </resultMap>
18 18
 
19 19
     <resultMap type="SysUser" id="ReportUserResult">
20
-        <result property="userId"    column="user_id"    />
20
+        <result property="member"    column="user_id"    />
21 21
         <result property="nickName"    column="nick_name"    />
22 22
     </resultMap>
23 23
 
@@ -28,7 +28,7 @@
28 28
     </resultMap>
29 29
 
30 30
     <sql id="selectCmcSafeReportVo">
31
-        select sr.safe_report_id, sr.project_id, p.project_number, p.project_name, sr.report_date, sr.user_id, sr.employee, sr.content, sr.reporter, u.nick_name from cmc_safe_report as sr
31
+        select sr.safe_report_id, sr.project_id, p.project_number, p.project_name, sr.report_date, sr.member, sr.employee, sr.content, sr.reporter, u.nick_name from cmc_safe_report as sr
32 32
         left join sys_user as u on sr.reporter = u.user_id
33 33
         left join cmc_project as p on sr.project_id = p.project_id
34 34
     </sql>
@@ -38,7 +38,7 @@
38 38
         <where>
39 39
             <if test="projectId != null  and projectId != ''"> and sr.project_id = #{projectId}</if>
40 40
             <if test="reportDate != null "> and sr.report_date = #{reportDate}</if>
41
-            <if test="userId != null  and userId != ''"> and find_in_set(sr.user_id, #{userId})</if>
41
+            <if test="member != null  and member != ''"> and sr.member like concat('%', #{member}, '%')</if>
42 42
             <if test="employee != null  and employee != ''"> and sr.employee like concat('%', #{employee}, '%')</if>
43 43
             <if test="content != null  and content != ''"> and sr.content = #{content}</if>
44 44
             <if test="reporter != null "> and sr.reporter = #{reporter}</if>
@@ -55,7 +55,7 @@
55 55
         <trim prefix="(" suffix=")" suffixOverrides=",">
56 56
             <if test="projectId != null">project_id,</if>
57 57
             <if test="reportDate != null">report_date,</if>
58
-            <if test="userId != null">user_id,</if>
58
+            <if test="member != null">member,</if>
59 59
             <if test="employee != null">employee,</if>
60 60
             <if test="content != null">content,</if>
61 61
             <if test="reporter != null">reporter,</if>
@@ -63,7 +63,7 @@
63 63
         <trim prefix="values (" suffix=")" suffixOverrides=",">
64 64
             <if test="projectId != null">#{projectId},</if>
65 65
             <if test="reportDate != null">#{reportDate},</if>
66
-            <if test="userId != null">#{userId},</if>
66
+            <if test="member != null">#{member},</if>
67 67
             <if test="employee != null">#{employee},</if>
68 68
             <if test="content != null">#{content},</if>
69 69
             <if test="reporter != null">#{reporter},</if>
@@ -75,7 +75,7 @@
75 75
         <trim prefix="SET" suffixOverrides=",">
76 76
             <if test="projectId != null">project_id = #{projectId},</if>
77 77
             <if test="reportDate != null">report_date = #{reportDate},</if>
78
-            <if test="userId != null">user_id = #{userId},</if>
78
+            <if test="member != null">member = #{member},</if>
79 79
             <if test="employee != null">employee = #{employee},</if>
80 80
             <if test="content != null">content = #{content},</if>
81 81
             <if test="reporter != null">reporter = #{reporter},</if>

+ 1
- 1
oa-back/sql/sql.sql 查看文件

@@ -12603,7 +12603,7 @@ create table `cmc_safe_report`  (
12603 12603
   `safe_report_id` 	int not null auto_increment		comment '安全报告id',
12604 12604
   `project_id` 		char(19) 		default null 	comment '项目id',
12605 12605
   `report_date` 	date 			default null 	comment '报告日期',
12606
-  `user_id` 		varchar(100) 	default null 	comment '公司人员',
12606
+  `member` 			varchar(100) 	default null 	comment '公司人员',
12607 12607
   `employee` 		varchar(255) 	default null 	comment '临时人员',
12608 12608
   `content` 		varchar(255) 	default null 	comment '安全报告',
12609 12609
   `reporter` 		bigint 			default null 	comment '填报人',

+ 29
- 27
oa-ui/src/views/oa/safe/report.vue 查看文件

@@ -14,9 +14,9 @@
14 14
           placeholder="请选择报告日期">
15 15
         </el-date-picker>
16 16
       </el-form-item>
17
-      <!-- <el-form-item label="公司人员" prop="userId">
17
+      <!-- <el-form-item label="公司人员" prop="member">
18 18
         <el-input
19
-          v-model="queryParams.userId"
19
+          v-model="queryParams.member"
20 20
           placeholder="请输入公司人员"
21 21
           clearable
22 22
           @keyup.enter.native="handleQuery"
@@ -31,7 +31,11 @@
31 31
         />
32 32
       </el-form-item> -->
33 33
       <el-form-item label="填报人" prop="reporter">
34
-        <el-input v-model="queryParams.reporter" placeholder="请输入填报人" clearable @keyup.enter.native="handleQuery" />
34
+        <el-select v-model="queryParams.reporter" filterable clearable style="width:220px">
35
+            <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId"
36
+              v-if="item.nickName != 'admin'">
37
+            </el-option>
38
+          </el-select>
35 39
       </el-form-item>
36 40
       <el-form-item>
37 41
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -49,8 +53,8 @@
49 53
           v-hasPermi="['oa:report:edit']">修改</el-button>
50 54
       </el-col>
51 55
       <el-col :span="1.5">
52
-        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple && canDelete" @click="handleDelete"
53
-          v-hasPermi="['oa:report:remove']">删除</el-button>
56
+        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple && canDelete"
57
+          @click="handleDelete" v-hasPermi="['oa:report:remove']">删除</el-button>
54 58
       </el-col>
55 59
       <el-col :span="1.5">
56 60
         <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
@@ -102,8 +106,8 @@
102 106
           <el-date-picker clearable v-model="form.reportDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择报告日期">
103 107
           </el-date-picker>
104 108
         </el-form-item>
105
-        <el-form-item label="公司人员" prop="userId">
106
-          <el-select v-model="form.userId" filterable multiple clearable style="width:380px">
109
+        <el-form-item label="公司人员" prop="member">
110
+          <el-select v-model="form.member" filterable multiple clearable style="width:380px">
107 111
             <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId"
108 112
               v-if="item.nickName != 'admin'">
109 113
             </el-option>
@@ -174,7 +178,7 @@ export default {
174 178
         pageSize: 10,
175 179
         projectId: null,
176 180
         reportDate: null,
177
-        userId: null,
181
+        member: null,
178 182
         employee: null,
179 183
         content: null,
180 184
         reporter: null
@@ -184,7 +188,7 @@ export default {
184 188
       // 表单校验
185 189
       rules: {
186 190
         projectId: [{ required: true, message: "项目编号不能为空", trigger: "blur" }],
187
-        userId: [{ required: true, message: "公司人员不能为空", trigger: "blur" }],
191
+        member: [{ required: true, message: "公司人员不能为空", trigger: "blur" }],
188 192
         reportDate: [{ required: true, message: "报告日期不能为空", trigger: "blur" }],
189 193
         content: [{ required: true, message: "安全汇报内容不能为空", trigger: "blur" }],
190 194
       }
@@ -199,18 +203,18 @@ export default {
199 203
     /** 查询安全汇报列表 */
200 204
     getList() {
201 205
       this.loading = true;
202
-      listSafeReport(this.queryParams).then(response => {        
206
+      listSafeReport(this.queryParams).then(response => {
203 207
         let rows = response.rows;
204 208
         for (let i = 0; i < rows.length; i++) {
205
-          if (rows[i].userId == null)
206
-            rows[i].userId = []
209
+          if (rows[i].member == null)
210
+            rows[i].member = []
207 211
           else {
208 212
             let arr = []
209
-            rows[i].userId = rows[i].userId.split(',');
210
-            for (let userId of rows[i].userId) {
211
-              arr.push(parseInt(userId))
213
+            rows[i].member = rows[i].member.split(',');
214
+            for (let member of rows[i].member) {
215
+              arr.push(parseInt(member))
212 216
             }
213
-            rows[i].userId = arr
217
+            rows[i].member = arr
214 218
           }
215 219
         }
216 220
         this.safeReportList = rows;
@@ -255,7 +259,7 @@ export default {
255 259
         safeReportId: null,
256 260
         projectId: null,
257 261
         reportDate: null,
258
-        userId: null,
262
+        member: null,
259 263
         employee: null,
260 264
         content: null,
261 265
         reporter: null
@@ -289,11 +293,13 @@ export default {
289 293
       this.reset();
290 294
       const safeReportId = row.safeReportId || this.ids
291 295
       getSafeReport(safeReportId).then(response => {
292
-        if (response.data.userId != null && response.data.userId != '') {
293
-          let userIds = [];
294
-          for (let i = 0; i < response.data.userId.split(',').length; i++)
295
-            userIds[i] = userId;
296
-          this.$set(this.form, "userId", userIds);
296
+        if (response.data.member != null && response.data.member != '') {
297
+          let arr = []
298
+          response.data.member = response.data.member.split(',');
299
+          for (let member of response.data.member) {
300
+            arr.push(parseInt(member))
301
+          }
302
+          response.data.member = arr
297 303
         }
298 304
         this.form = response.data;
299 305
         this.open = true;
@@ -305,11 +311,7 @@ export default {
305 311
       this.$refs["form"].validate(valid => {
306 312
         if (valid) {
307 313
           this.form.reporter = this.$store.getters.userId;
308
-          if (this.form.userId != "" && this.form.userId != undefined && this.form.userId != null)
309
-            this.form.userId = this.form.userId.join(',');
310
-          else
311
-            this.form.userId = undefined;
312
-          console.log(this.form);
314
+          this.form.member = this.form.member.join(',');
313 315
           if (this.form.safeReportId != null) {
314 316
             updateSafeReport(this.form).then(response => {
315 317
               this.$modal.msgSuccess("修改成功");

正在加载...
取消
保存