Browse Source

更改安全日报字段名

lamphua 1 year ago
parent
commit
7add84a880

+ 2
- 2
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcSafeReportController.java View File

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

+ 9
- 9
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcSafeReport.java View File

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

+ 7
- 7
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcSafeReportMapper.xml View File

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

+ 1
- 1
oa-back/sql/sql.sql View File

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

+ 29
- 27
oa-ui/src/views/oa/safe/report.vue View File

14
           placeholder="请选择报告日期">
14
           placeholder="请选择报告日期">
15
         </el-date-picker>
15
         </el-date-picker>
16
       </el-form-item>
16
       </el-form-item>
17
-      <!-- <el-form-item label="公司人员" prop="userId">
17
+      <!-- <el-form-item label="公司人员" prop="member">
18
         <el-input
18
         <el-input
19
-          v-model="queryParams.userId"
19
+          v-model="queryParams.member"
20
           placeholder="请输入公司人员"
20
           placeholder="请输入公司人员"
21
           clearable
21
           clearable
22
           @keyup.enter.native="handleQuery"
22
           @keyup.enter.native="handleQuery"
31
         />
31
         />
32
       </el-form-item> -->
32
       </el-form-item> -->
33
       <el-form-item label="填报人" prop="reporter">
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
       </el-form-item>
39
       </el-form-item>
36
       <el-form-item>
40
       <el-form-item>
37
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
41
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
49
           v-hasPermi="['oa:report:edit']">修改</el-button>
53
           v-hasPermi="['oa:report:edit']">修改</el-button>
50
       </el-col>
54
       </el-col>
51
       <el-col :span="1.5">
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
       </el-col>
58
       </el-col>
55
       <el-col :span="1.5">
59
       <el-col :span="1.5">
56
         <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
60
         <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
102
           <el-date-picker clearable v-model="form.reportDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择报告日期">
106
           <el-date-picker clearable v-model="form.reportDate" type="date" value-format="yyyy-MM-dd" placeholder="请选择报告日期">
103
           </el-date-picker>
107
           </el-date-picker>
104
         </el-form-item>
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
             <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId"
111
             <el-option v-for="item in userList" :key="item.userId" :label="item.nickName" :value="item.userId"
108
               v-if="item.nickName != 'admin'">
112
               v-if="item.nickName != 'admin'">
109
             </el-option>
113
             </el-option>
174
         pageSize: 10,
178
         pageSize: 10,
175
         projectId: null,
179
         projectId: null,
176
         reportDate: null,
180
         reportDate: null,
177
-        userId: null,
181
+        member: null,
178
         employee: null,
182
         employee: null,
179
         content: null,
183
         content: null,
180
         reporter: null
184
         reporter: null
184
       // 表单校验
188
       // 表单校验
185
       rules: {
189
       rules: {
186
         projectId: [{ required: true, message: "项目编号不能为空", trigger: "blur" }],
190
         projectId: [{ required: true, message: "项目编号不能为空", trigger: "blur" }],
187
-        userId: [{ required: true, message: "公司人员不能为空", trigger: "blur" }],
191
+        member: [{ required: true, message: "公司人员不能为空", trigger: "blur" }],
188
         reportDate: [{ required: true, message: "报告日期不能为空", trigger: "blur" }],
192
         reportDate: [{ required: true, message: "报告日期不能为空", trigger: "blur" }],
189
         content: [{ required: true, message: "安全汇报内容不能为空", trigger: "blur" }],
193
         content: [{ required: true, message: "安全汇报内容不能为空", trigger: "blur" }],
190
       }
194
       }
199
     /** 查询安全汇报列表 */
203
     /** 查询安全汇报列表 */
200
     getList() {
204
     getList() {
201
       this.loading = true;
205
       this.loading = true;
202
-      listSafeReport(this.queryParams).then(response => {        
206
+      listSafeReport(this.queryParams).then(response => {
203
         let rows = response.rows;
207
         let rows = response.rows;
204
         for (let i = 0; i < rows.length; i++) {
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
           else {
211
           else {
208
             let arr = []
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
         this.safeReportList = rows;
220
         this.safeReportList = rows;
255
         safeReportId: null,
259
         safeReportId: null,
256
         projectId: null,
260
         projectId: null,
257
         reportDate: null,
261
         reportDate: null,
258
-        userId: null,
262
+        member: null,
259
         employee: null,
263
         employee: null,
260
         content: null,
264
         content: null,
261
         reporter: null
265
         reporter: null
289
       this.reset();
293
       this.reset();
290
       const safeReportId = row.safeReportId || this.ids
294
       const safeReportId = row.safeReportId || this.ids
291
       getSafeReport(safeReportId).then(response => {
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
         this.form = response.data;
304
         this.form = response.data;
299
         this.open = true;
305
         this.open = true;
305
       this.$refs["form"].validate(valid => {
311
       this.$refs["form"].validate(valid => {
306
         if (valid) {
312
         if (valid) {
307
           this.form.reporter = this.$store.getters.userId;
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
           if (this.form.safeReportId != null) {
315
           if (this.form.safeReportId != null) {
314
             updateSafeReport(this.form).then(response => {
316
             updateSafeReport(this.form).then(response => {
315
               this.$modal.msgSuccess("修改成功");
317
               this.$modal.msgSuccess("修改成功");

Loading…
Cancel
Save