浏览代码

1提交、修改用车申请;

2估算用车成本采用年数总和法折旧
lamphua 1年前
父节点
当前提交
72decb2e67

+ 111
- 10
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcCarApprovalController.java 查看文件

1
 package com.ruoyi.web.controller.oa;
1
 package com.ruoyi.web.controller.oa;
2
 
2
 
3
+import java.math.BigDecimal;
4
+import java.text.SimpleDateFormat;
3
 import java.util.List;
5
 import java.util.List;
4
 import javax.servlet.http.HttpServletResponse;
6
 import javax.servlet.http.HttpServletResponse;
7
+
8
+import com.alibaba.fastjson2.JSONObject;
9
+import com.ruoyi.common.utils.DateUtils;
10
+import com.ruoyi.oa.domain.*;
11
+import com.ruoyi.oa.service.ICmcCarService;
12
+import com.ruoyi.system.service.ISysDeptService;
13
+import com.ruoyi.system.service.ISysUserService;
5
 import org.springframework.beans.factory.annotation.Autowired;
14
 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;
15
+import org.springframework.web.bind.annotation.*;
14
 import com.ruoyi.common.annotation.Log;
16
 import com.ruoyi.common.annotation.Log;
15
 import com.ruoyi.common.core.controller.BaseController;
17
 import com.ruoyi.common.core.controller.BaseController;
16
 import com.ruoyi.common.core.domain.AjaxResult;
18
 import com.ruoyi.common.core.domain.AjaxResult;
17
 import com.ruoyi.common.enums.BusinessType;
19
 import com.ruoyi.common.enums.BusinessType;
18
-import com.ruoyi.oa.domain.CmcCarApproval;
19
 import com.ruoyi.oa.service.ICmcCarApprovalService;
20
 import com.ruoyi.oa.service.ICmcCarApprovalService;
20
 import com.ruoyi.common.utils.poi.ExcelUtil;
21
 import com.ruoyi.common.utils.poi.ExcelUtil;
21
 import com.ruoyi.common.core.page.TableDataInfo;
22
 import com.ruoyi.common.core.page.TableDataInfo;
33
     @Autowired
34
     @Autowired
34
     private ICmcCarApprovalService cmcCarApprovalService;
35
     private ICmcCarApprovalService cmcCarApprovalService;
35
 
36
 
37
+    @Autowired
38
+    private ISysUserService userService;
39
+
40
+    @Autowired
41
+    private ISysDeptService deptService;
42
+
43
+    @Autowired
44
+    private ICmcCarService cmcCarService;
45
+
36
     /**
46
     /**
37
      * 查询cmc用车审批列表
47
      * 查询cmc用车审批列表
38
      */
48
      */
62
     @GetMapping(value = "/{carApplyId}")
72
     @GetMapping(value = "/{carApplyId}")
63
     public AjaxResult getInfo(@PathVariable("carApplyId") String carApplyId)
73
     public AjaxResult getInfo(@PathVariable("carApplyId") String carApplyId)
64
     {
74
     {
65
-        return success(cmcCarApprovalService.selectCmcCarApprovalByCarApplyId(carApplyId));
75
+        JSONObject formData = new JSONObject();
76
+        CmcCarApproval cmcCarApproval = cmcCarApprovalService.selectCmcCarApprovalByCarApplyId(carApplyId);
77
+        formData.put("user", userService.selectUserById(cmcCarApproval.getApplier()).getNickName());
78
+        formData.put("deptName", deptService.selectDeptById(userService.selectUserById(cmcCarApproval.getApplier()).getDeptId()).getDeptName());
79
+        formData.put("date", cmcCarApproval.getApplyDate());
80
+        formData.put("startTime", cmcCarApproval.getBeginDate());
81
+        formData.put("endTime", cmcCarApproval.getEndDate());
82
+        formData.put("day", cmcCarApproval.getDays());
83
+        formData.put("passengers", cmcCarApproval.getPassengers());
84
+        formData.put("projectNumber", cmcCarApproval.getProjectNumber());
85
+        formData.put("applyReason", cmcCarApproval.getApplyReason());
86
+        formData.put("deptUser", userService.selectUserById(cmcCarApproval.getDeptUserId()).getNickName());
87
+        formData.put("deptComment", cmcCarApproval.getDeptComment());
88
+        formData.put("managerUser", userService.selectUserById(cmcCarApproval.getManagerUserId()).getNickName());
89
+        formData.put("managerComment", cmcCarApproval.getManagerComment());
90
+        formData.put("unionUser", userService.selectUserById(cmcCarApproval.getUnionUserId()).getNickName());
91
+        formData.put("unionComment", cmcCarApproval.getUnionComment());
92
+        formData.put("dispatcher", userService.selectUserById(cmcCarApproval.getDispatcher()).getNickName());
93
+        formData.put("dispatchComment", cmcCarApproval.getDispatchComment());
94
+        formData.put("cars", cmcCarApproval.getCars());
95
+        formData.put("drivers", cmcCarApproval.getDrivers());
96
+        return success(formData);
66
     }
97
     }
67
 
98
 
68
     /**
99
     /**
75
         return toAjax(cmcCarApprovalService.insertCmcCarApproval(cmcCarApproval));
106
         return toAjax(cmcCarApprovalService.insertCmcCarApproval(cmcCarApproval));
76
     }
107
     }
77
 
108
 
109
+    /**
110
+     * 提交用车审批表
111
+     */
112
+    @Log(title = "用车审批表", businessType = BusinessType.INSERT)
113
+    @PostMapping( "/submit")
114
+    public AjaxResult submit(@RequestParam("form")String formData)
115
+    {
116
+        JSONObject formDataJson = JSONObject.parse(formData);
117
+        CmcCarApproval cmcCarApproval = new CmcCarApproval();
118
+        cmcCarApproval.setCarApplyId(formDataJson.getString("formId"));
119
+        cmcCarApproval.setApplier(getLoginUser().getUserId());
120
+        cmcCarApproval.setApplyDate(DateUtils.getNowDate());
121
+        cmcCarApproval.setProjectNumber(formDataJson.getString("projectNumber"));
122
+        cmcCarApproval.setApplyReason(formDataJson.getString("applyReason"));
123
+        cmcCarApproval.setPassengers(formDataJson.getInteger("passengers"));
124
+        cmcCarApproval.setBeginDate(formDataJson.getDate("startTime"));
125
+        cmcCarApproval.setEndDate(formDataJson.getDate("endTime"));
126
+        cmcCarApproval.setDays(formDataJson.getLong("day"));
127
+        cmcCarApprovalService.insertCmcCarApproval(cmcCarApproval);
128
+        return AjaxResult.success("提交用车审批表成功");
129
+    }
130
+
78
     /**
131
     /**
79
      * 修改cmc用车审批
132
      * 修改cmc用车审批
80
      */
133
      */
85
         return toAjax(cmcCarApprovalService.updateCmcCarApproval(cmcCarApproval));
138
         return toAjax(cmcCarApprovalService.updateCmcCarApproval(cmcCarApproval));
86
     }
139
     }
87
 
140
 
141
+    /**
142
+     * 修改用车审批表
143
+     */
144
+    @Log(title = "用车审批表", businessType = BusinessType.UPDATE)
145
+    @PutMapping( "/modify")
146
+    public AjaxResult modify(@RequestParam("form")String formData)
147
+    {
148
+        JSONObject formDataJson = JSONObject.parse(formData);
149
+        CmcCarApproval cmcCarApproval = cmcCarApprovalService.selectCmcCarApprovalByCarApplyId(formDataJson.getString("carApplyId"));
150
+        if (formDataJson.getString("deptComment") != null) {
151
+            cmcCarApproval.setDeptUserId(getLoginUser().getUserId());
152
+            cmcCarApproval.setDeptComment(formDataJson.getString("deptComment"));
153
+        }
154
+        if (formDataJson.getString("managerComment") != null) {
155
+            cmcCarApproval.setManagerUserId(getLoginUser().getUserId());
156
+            cmcCarApproval.setManagerComment(formDataJson.getString("managerComment"));
157
+        }
158
+        if (formDataJson.getString("unionComment") != null) {
159
+            cmcCarApproval.setUnionUserId(getLoginUser().getUserId());
160
+            cmcCarApproval.setUnionComment(formDataJson.getString("unionComment"));
161
+        }
162
+        if (formDataJson.getString("dispatchComment") != null) {
163
+            cmcCarApproval.setDispatcher(getLoginUser().getUserId());
164
+            cmcCarApproval.setDispatchComment(formDataJson.getString("dispatchComment"));
165
+            cmcCarApproval.setCars(formDataJson.getString("cars"));
166
+            cmcCarApproval.setDrivers(formDataJson.getString("drivers"));
167
+            String[] cars = formDataJson.getString("cars").split(",");
168
+            for (String car : cars) {
169
+                CmcCar cmcCar = cmcCarService.selectCmcCarByCarId(Integer.parseInt(car));
170
+                if (cmcCar.getAcquisitionTime() != null && cmcCar.getCost() != null) {
171
+                    // 年数总和法折旧
172
+                    int acquisitionYear = Integer.parseInt(new SimpleDateFormat("yyyy").format(cmcCar.getAcquisitionTime()));
173
+                    int life = cmcCar.getExpectLife() == null ? 0 : cmcCar.getExpectLife();
174
+                    int total = 0;
175
+                    for (int i = 0; i < life + 1; i++)
176
+                        total += i;
177
+                    if (total > 0) {
178
+                        int currentYear = Integer.parseInt(new SimpleDateFormat("yyyy").format(DateUtils.getNowDate()));
179
+                        int num = life - (currentYear - acquisitionYear) + 1;
180
+                        cmcCarApproval.setEstimateCost(new BigDecimal(num  * 0.95 / total).multiply(cmcCar.getCost()));
181
+                    }
182
+                }
183
+            }
184
+        }
185
+        cmcCarApprovalService.updateCmcCarApproval(cmcCarApproval);
186
+        return AjaxResult.success("修改用车审批表成功");
187
+    }
188
+
88
     /**
189
     /**
89
      * 删除cmc用车审批
190
      * 删除cmc用车审批
90
      */
191
      */

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

60
      * 获取cmc车辆信息详细信息
60
      * 获取cmc车辆信息详细信息
61
      */
61
      */
62
     @GetMapping(value = "/{carId}")
62
     @GetMapping(value = "/{carId}")
63
-    public AjaxResult getInfo(@PathVariable("carId") Long carId)
63
+    public AjaxResult getInfo(@PathVariable("carId") Integer carId)
64
     {
64
     {
65
         return success(cmcCarService.selectCmcCarByCarId(carId));
65
         return success(cmcCarService.selectCmcCarByCarId(carId));
66
     }
66
     }

+ 0
- 6
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceApprovalController.java 查看文件

37
     /**
37
     /**
38
      * 查询cmc设备审批列表
38
      * 查询cmc设备审批列表
39
      */
39
      */
40
-    @PreAuthorize("@ss.hasPermi('oa:approval:list')")
41
     @GetMapping("/list")
40
     @GetMapping("/list")
42
     public TableDataInfo list(CmcDeviceApproval cmcDeviceApproval)
41
     public TableDataInfo list(CmcDeviceApproval cmcDeviceApproval)
43
     {
42
     {
49
     /**
48
     /**
50
      * 导出cmc设备审批列表
49
      * 导出cmc设备审批列表
51
      */
50
      */
52
-    @PreAuthorize("@ss.hasPermi('oa:approval:export')")
53
     @Log(title = "cmc设备审批", businessType = BusinessType.EXPORT)
51
     @Log(title = "cmc设备审批", businessType = BusinessType.EXPORT)
54
     @PostMapping("/export")
52
     @PostMapping("/export")
55
     public void export(HttpServletResponse response, CmcDeviceApproval cmcDeviceApproval)
53
     public void export(HttpServletResponse response, CmcDeviceApproval cmcDeviceApproval)
62
     /**
60
     /**
63
      * 获取cmc设备审批详细信息
61
      * 获取cmc设备审批详细信息
64
      */
62
      */
65
-    @PreAuthorize("@ss.hasPermi('oa:approval:query')")
66
     @GetMapping(value = "/{deviceApplyId}")
63
     @GetMapping(value = "/{deviceApplyId}")
67
     public AjaxResult getInfo(@PathVariable("deviceApplyId") String deviceApplyId)
64
     public AjaxResult getInfo(@PathVariable("deviceApplyId") String deviceApplyId)
68
     {
65
     {
72
     /**
69
     /**
73
      * 新增cmc设备审批
70
      * 新增cmc设备审批
74
      */
71
      */
75
-    @PreAuthorize("@ss.hasPermi('oa:approval:add')")
76
     @Log(title = "cmc设备审批", businessType = BusinessType.INSERT)
72
     @Log(title = "cmc设备审批", businessType = BusinessType.INSERT)
77
     @PostMapping
73
     @PostMapping
78
     public AjaxResult add(@RequestBody CmcDeviceApproval cmcDeviceApproval)
74
     public AjaxResult add(@RequestBody CmcDeviceApproval cmcDeviceApproval)
83
     /**
79
     /**
84
      * 修改cmc设备审批
80
      * 修改cmc设备审批
85
      */
81
      */
86
-    @PreAuthorize("@ss.hasPermi('oa:approval:edit')")
87
     @Log(title = "cmc设备审批", businessType = BusinessType.UPDATE)
82
     @Log(title = "cmc设备审批", businessType = BusinessType.UPDATE)
88
     @PutMapping
83
     @PutMapping
89
     public AjaxResult edit(@RequestBody CmcDeviceApproval cmcDeviceApproval)
84
     public AjaxResult edit(@RequestBody CmcDeviceApproval cmcDeviceApproval)
94
     /**
89
     /**
95
      * 删除cmc设备审批
90
      * 删除cmc设备审批
96
      */
91
      */
97
-    @PreAuthorize("@ss.hasPermi('oa:approval:remove')")
98
     @Log(title = "cmc设备审批", businessType = BusinessType.DELETE)
92
     @Log(title = "cmc设备审批", businessType = BusinessType.DELETE)
99
 	@DeleteMapping("/{deviceApplyIds}")
93
 	@DeleteMapping("/{deviceApplyIds}")
100
     public AjaxResult remove(@PathVariable String[] deviceApplyIds)
94
     public AjaxResult remove(@PathVariable String[] deviceApplyIds)

+ 0
- 6
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceController.java 查看文件

37
     /**
37
     /**
38
      * 查询cmc设备信息列表
38
      * 查询cmc设备信息列表
39
      */
39
      */
40
-    @PreAuthorize("@ss.hasPermi('oa:device:list')")
41
     @GetMapping("/list")
40
     @GetMapping("/list")
42
     public TableDataInfo list(CmcDevice cmcDevice)
41
     public TableDataInfo list(CmcDevice cmcDevice)
43
     {
42
     {
49
     /**
48
     /**
50
      * 导出cmc设备信息列表
49
      * 导出cmc设备信息列表
51
      */
50
      */
52
-    @PreAuthorize("@ss.hasPermi('oa:device:export')")
53
     @Log(title = "cmc设备信息", businessType = BusinessType.EXPORT)
51
     @Log(title = "cmc设备信息", businessType = BusinessType.EXPORT)
54
     @PostMapping("/export")
52
     @PostMapping("/export")
55
     public void export(HttpServletResponse response, CmcDevice cmcDevice)
53
     public void export(HttpServletResponse response, CmcDevice cmcDevice)
62
     /**
60
     /**
63
      * 获取cmc设备信息详细信息
61
      * 获取cmc设备信息详细信息
64
      */
62
      */
65
-    @PreAuthorize("@ss.hasPermi('oa:device:query')")
66
     @GetMapping(value = "/{deviceId}")
63
     @GetMapping(value = "/{deviceId}")
67
     public AjaxResult getInfo(@PathVariable("deviceId") Long deviceId)
64
     public AjaxResult getInfo(@PathVariable("deviceId") Long deviceId)
68
     {
65
     {
72
     /**
69
     /**
73
      * 新增cmc设备信息
70
      * 新增cmc设备信息
74
      */
71
      */
75
-    @PreAuthorize("@ss.hasPermi('oa:device:add')")
76
     @Log(title = "cmc设备信息", businessType = BusinessType.INSERT)
72
     @Log(title = "cmc设备信息", businessType = BusinessType.INSERT)
77
     @PostMapping
73
     @PostMapping
78
     public AjaxResult add(@RequestBody CmcDevice cmcDevice)
74
     public AjaxResult add(@RequestBody CmcDevice cmcDevice)
83
     /**
79
     /**
84
      * 修改cmc设备信息
80
      * 修改cmc设备信息
85
      */
81
      */
86
-    @PreAuthorize("@ss.hasPermi('oa:device:edit')")
87
     @Log(title = "cmc设备信息", businessType = BusinessType.UPDATE)
82
     @Log(title = "cmc设备信息", businessType = BusinessType.UPDATE)
88
     @PutMapping
83
     @PutMapping
89
     public AjaxResult edit(@RequestBody CmcDevice cmcDevice)
84
     public AjaxResult edit(@RequestBody CmcDevice cmcDevice)
94
     /**
89
     /**
95
      * 删除cmc设备信息
90
      * 删除cmc设备信息
96
      */
91
      */
97
-    @PreAuthorize("@ss.hasPermi('oa:device:remove')")
98
     @Log(title = "cmc设备信息", businessType = BusinessType.DELETE)
92
     @Log(title = "cmc设备信息", businessType = BusinessType.DELETE)
99
 	@DeleteMapping("/{deviceIds}")
93
 	@DeleteMapping("/{deviceIds}")
100
     public AjaxResult remove(@PathVariable Long[] deviceIds)
94
     public AjaxResult remove(@PathVariable Long[] deviceIds)

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

19
     private static final long serialVersionUID = 1L;
19
     private static final long serialVersionUID = 1L;
20
 
20
 
21
     /** 车辆id */
21
     /** 车辆id */
22
-    private Long carId;
22
+    private Integer carId;
23
 
23
 
24
     /** 车牌号 */
24
     /** 车牌号 */
25
     @Excel(name = "车牌号")
25
     @Excel(name = "车牌号")
50
     @Excel(name = "车级")
50
     @Excel(name = "车级")
51
     private String level;
51
     private String level;
52
 
52
 
53
-    public void setCarId(Long carId)
53
+    public void setCarId(Integer carId)
54
     {
54
     {
55
         this.carId = carId;
55
         this.carId = carId;
56
     }
56
     }
57
 
57
 
58
-    public Long getCarId()
58
+    public Integer getCarId()
59
     {
59
     {
60
         return carId;
60
         return carId;
61
     }
61
     }

+ 18
- 3
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcCarApproval.java 查看文件

43
 
43
 
44
     /** 人数 */
44
     /** 人数 */
45
     @Excel(name = "人数")
45
     @Excel(name = "人数")
46
-    private Long passengers;
46
+    private Integer passengers;
47
 
47
 
48
     /** 开始日期 */
48
     /** 开始日期 */
49
     @JsonFormat(pattern = "yyyy-MM-dd")
49
     @JsonFormat(pattern = "yyyy-MM-dd")
103
     @Excel(name = "预计用车成本")
103
     @Excel(name = "预计用车成本")
104
     private BigDecimal estimateCost;
104
     private BigDecimal estimateCost;
105
 
105
 
106
+    /** 申请日期 */
107
+    @JsonFormat(pattern = "yyyy-MM-dd")
108
+    @Excel(name = "申请日期", width = 30, dateFormat = "yyyy-MM-dd")
109
+    private Date applyDate;
110
+
106
     public void setCarApplyId(String carApplyId)
111
     public void setCarApplyId(String carApplyId)
107
     {
112
     {
108
         this.carApplyId = carApplyId;
113
         this.carApplyId = carApplyId;
157
     {
162
     {
158
         return applyReason;
163
         return applyReason;
159
     }
164
     }
160
-    public void setPassengers(Long passengers)
165
+    public void setPassengers(Integer passengers)
161
     {
166
     {
162
         this.passengers = passengers;
167
         this.passengers = passengers;
163
     }
168
     }
164
 
169
 
165
-    public Long getPassengers()
170
+    public Integer getPassengers()
166
     {
171
     {
167
         return passengers;
172
         return passengers;
168
     }
173
     }
292
     {
297
     {
293
         return estimateCost;
298
         return estimateCost;
294
     }
299
     }
300
+    public void setApplyDate(Date applyDate)
301
+    {
302
+        this.applyDate = applyDate;
303
+    }
304
+
305
+    public Date getApplyDate()
306
+    {
307
+        return applyDate;
308
+    }
295
 
309
 
296
     @Override
310
     @Override
297
     public String toString() {
311
     public String toString() {
317
                 .append("dispatcher", getDispatcher())
331
                 .append("dispatcher", getDispatcher())
318
                 .append("dispatchComment", getDispatchComment())
332
                 .append("dispatchComment", getDispatchComment())
319
                 .append("estimateCost", getEstimateCost())
333
                 .append("estimateCost", getEstimateCost())
334
+                .append("applyDate", getApplyDate())
320
                 .toString();
335
                 .toString();
321
     }
336
     }
322
 }
337
 }

+ 14
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcDeviceApproval.java 查看文件

87
     @Excel(name = "预计设备成本")
87
     @Excel(name = "预计设备成本")
88
     private BigDecimal estimateCost;
88
     private BigDecimal estimateCost;
89
 
89
 
90
+    /** 申请日期 */
91
+    @JsonFormat(pattern = "yyyy-MM-dd")
92
+    @Excel(name = "申请日期", width = 30, dateFormat = "yyyy-MM-dd")
93
+    private Date applyDate;
94
+
90
     public void setDeviceApplyId(String deviceApplyId) 
95
     public void setDeviceApplyId(String deviceApplyId) 
91
     {
96
     {
92
         this.deviceApplyId = deviceApplyId;
97
         this.deviceApplyId = deviceApplyId;
240
     {
245
     {
241
         return estimateCost;
246
         return estimateCost;
242
     }
247
     }
248
+    public void setApplyDate(Date applyDate)
249
+    {
250
+        this.applyDate = applyDate;
251
+    }
243
 
252
 
253
+    public Date getApplyDate()
254
+    {
255
+        return applyDate;
256
+    }
244
     @Override
257
     @Override
245
     public String toString() {
258
     public String toString() {
246
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
259
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
261
             .append("dispatcher", getDispatcher())
274
             .append("dispatcher", getDispatcher())
262
             .append("dispatchComment", getDispatchComment())
275
             .append("dispatchComment", getDispatchComment())
263
             .append("estimateCost", getEstimateCost())
276
             .append("estimateCost", getEstimateCost())
277
+            .append("applyDate", getApplyDate())
264
             .toString();
278
             .toString();
265
     }
279
     }
266
 }
280
 }

+ 1
- 1
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/mapper/CmcCarMapper.java 查看文件

17
      * @param carId cmc车辆信息主键
17
      * @param carId cmc车辆信息主键
18
      * @return cmc车辆信息
18
      * @return cmc车辆信息
19
      */
19
      */
20
-    public CmcCar selectCmcCarByCarId(Long carId);
20
+    public CmcCar selectCmcCarByCarId(Integer carId);
21
 
21
 
22
     /**
22
     /**
23
      * 查询cmc车辆信息列表
23
      * 查询cmc车辆信息列表

+ 1
- 1
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/ICmcCarService.java 查看文件

17
      * @param carId cmc车辆信息主键
17
      * @param carId cmc车辆信息主键
18
      * @return cmc车辆信息
18
      * @return cmc车辆信息
19
      */
19
      */
20
-    public CmcCar selectCmcCarByCarId(Long carId);
20
+    public CmcCar selectCmcCarByCarId(Integer carId);
21
 
21
 
22
     /**
22
     /**
23
      * 查询cmc车辆信息列表
23
      * 查询cmc车辆信息列表

+ 1
- 1
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/impl/CmcCarServiceImpl.java 查看文件

26
      * @return cmc车辆信息
26
      * @return cmc车辆信息
27
      */
27
      */
28
     @Override
28
     @Override
29
-    public CmcCar selectCmcCarByCarId(Long carId)
29
+    public CmcCar selectCmcCarByCarId(Integer carId)
30
     {
30
     {
31
         return cmcCarMapper.selectCmcCarByCarId(carId);
31
         return cmcCarMapper.selectCmcCarByCarId(carId);
32
     }
32
     }

+ 6
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcCarApprovalMapper.xml 查看文件

12
         <result property="projectNumber"    column="project_number"    />
12
         <result property="projectNumber"    column="project_number"    />
13
         <result property="applyReason"    column="apply_reason"    />
13
         <result property="applyReason"    column="apply_reason"    />
14
         <result property="passengers"    column="passengers"    />
14
         <result property="passengers"    column="passengers"    />
15
+        <result property="applyDate"    column="apply_date"    />
15
         <result property="beginDate"    column="begin_date"    />
16
         <result property="beginDate"    column="begin_date"    />
16
         <result property="beginHalfday"    column="begin_halfday"    />
17
         <result property="beginHalfday"    column="begin_halfday"    />
17
         <result property="endDate"    column="end_date"    />
18
         <result property="endDate"    column="end_date"    />
29
     </resultMap>
30
     </resultMap>
30
 
31
 
31
     <sql id="selectCmcCarApprovalVo">
32
     <sql id="selectCmcCarApprovalVo">
32
-        select car_apply_id, applier, cars, drivers, project_number, apply_reason, passengers, begin_date, begin_halfday, end_date, end_halfday, days, dept_user_id, dept_comment, manager_user_id, manager_comment, union_user_id, union_comment, dispatcher, dispatch_comment, estimate_cost from cmc_car_approval
33
+        select car_apply_id, applier, cars, drivers, project_number, apply_reason, passengers, apply_date, begin_date, begin_halfday, end_date, end_halfday, days, dept_user_id, dept_comment, manager_user_id, manager_comment, union_user_id, union_comment, dispatcher, dispatch_comment, estimate_cost from cmc_car_approval
33
     </sql>
34
     </sql>
34
 
35
 
35
     <select id="selectCmcCarApprovalList" parameterType="CmcCarApproval" resultMap="CmcCarApprovalResult">
36
     <select id="selectCmcCarApprovalList" parameterType="CmcCarApproval" resultMap="CmcCarApprovalResult">
41
             <if test="projectNumber != null  and projectNumber != ''"> and project_number = #{projectNumber}</if>
42
             <if test="projectNumber != null  and projectNumber != ''"> and project_number = #{projectNumber}</if>
42
             <if test="applyReason != null  and applyReason != ''"> and apply_reason = #{applyReason}</if>
43
             <if test="applyReason != null  and applyReason != ''"> and apply_reason = #{applyReason}</if>
43
             <if test="passengers != null "> and passengers = #{passengers}</if>
44
             <if test="passengers != null "> and passengers = #{passengers}</if>
45
+            <if test="applyDate != null "> and apply_date = #{beginDate}</if>
44
             <if test="beginDate != null "> and begin_date = #{beginDate}</if>
46
             <if test="beginDate != null "> and begin_date = #{beginDate}</if>
45
             <if test="beginHalfday != null  and beginHalfday != ''"> and begin_halfday = #{beginHalfday}</if>
47
             <if test="beginHalfday != null  and beginHalfday != ''"> and begin_halfday = #{beginHalfday}</if>
46
             <if test="endDate != null "> and end_date = #{endDate}</if>
48
             <if test="endDate != null "> and end_date = #{endDate}</if>
73
             <if test="projectNumber != null">project_number,</if>
75
             <if test="projectNumber != null">project_number,</if>
74
             <if test="applyReason != null">apply_reason,</if>
76
             <if test="applyReason != null">apply_reason,</if>
75
             <if test="passengers != null">passengers,</if>
77
             <if test="passengers != null">passengers,</if>
78
+            <if test="applyDate != null">apply_date,</if>
76
             <if test="beginDate != null">begin_date,</if>
79
             <if test="beginDate != null">begin_date,</if>
77
             <if test="beginHalfday != null">begin_halfday,</if>
80
             <if test="beginHalfday != null">begin_halfday,</if>
78
             <if test="endDate != null">end_date,</if>
81
             <if test="endDate != null">end_date,</if>
96
             <if test="projectNumber != null">#{projectNumber},</if>
99
             <if test="projectNumber != null">#{projectNumber},</if>
97
             <if test="applyReason != null">#{applyReason},</if>
100
             <if test="applyReason != null">#{applyReason},</if>
98
             <if test="passengers != null">#{passengers},</if>
101
             <if test="passengers != null">#{passengers},</if>
102
+            <if test="applyDate != null">#{applyDate},</if>
99
             <if test="beginDate != null">#{beginDate},</if>
103
             <if test="beginDate != null">#{beginDate},</if>
100
             <if test="beginHalfday != null">#{beginHalfday},</if>
104
             <if test="beginHalfday != null">#{beginHalfday},</if>
101
             <if test="endDate != null">#{endDate},</if>
105
             <if test="endDate != null">#{endDate},</if>
122
             <if test="projectNumber != null">project_number = #{projectNumber},</if>
126
             <if test="projectNumber != null">project_number = #{projectNumber},</if>
123
             <if test="applyReason != null">apply_reason = #{applyReason},</if>
127
             <if test="applyReason != null">apply_reason = #{applyReason},</if>
124
             <if test="passengers != null">passengers = #{passengers},</if>
128
             <if test="passengers != null">passengers = #{passengers},</if>
129
+            <if test="applyDate != null">apply_date = #{applyDate},</if>
125
             <if test="beginDate != null">begin_date = #{beginDate},</if>
130
             <if test="beginDate != null">begin_date = #{beginDate},</if>
126
             <if test="beginHalfday != null">begin_halfday = #{beginHalfday},</if>
131
             <if test="beginHalfday != null">begin_halfday = #{beginHalfday},</if>
127
             <if test="endDate != null">end_date = #{endDate},</if>
132
             <if test="endDate != null">end_date = #{endDate},</if>

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

22
     <select id="selectCmcCarList" parameterType="CmcCar" resultMap="CmcCarResult">
22
     <select id="selectCmcCarList" parameterType="CmcCar" resultMap="CmcCarResult">
23
         <include refid="selectCmcCarVo"/>
23
         <include refid="selectCmcCarVo"/>
24
         <where>
24
         <where>
25
-            <if test="licensePlate != null  and licensePlate != ''"> and license_plate = #{licensePlate}</if>
25
+            <if test="licensePlate != null  and licensePlate != ''"> and license_plate like concat('%', #{licensePlate}, '%')</if>
26
             <if test="driver != null "> and driver = #{driver}</if>
26
             <if test="driver != null "> and driver = #{driver}</if>
27
             <if test="acquisitionTime != null "> and acquisition_time = #{acquisitionTime}</if>
27
             <if test="acquisitionTime != null "> and acquisition_time = #{acquisitionTime}</if>
28
             <if test="cost != null "> and cost = #{cost}</if>
28
             <if test="cost != null "> and cost = #{cost}</if>
29
             <if test="expectLife != null "> and expect_life = #{expectLife}</if>
29
             <if test="expectLife != null "> and expect_life = #{expectLife}</if>
30
-            <if test="series != null  and series != ''"> and series = #{series}</if>
31
-            <if test="level != null  and level != ''"> and level = #{level}</if>
30
+            <if test="series != null  and series != ''"> and series like concat('%', #{series}, '%')</if>
31
+            <if test="level != null  and level != ''"> and level like concat('%', #{level}, '%')</if>
32
         </where>
32
         </where>
33
     </select>
33
     </select>
34
 
34
 
35
-    <select id="selectCmcCarByCarId" parameterType="Long" resultMap="CmcCarResult">
35
+    <select id="selectCmcCarByCarId" parameterType="Integer" resultMap="CmcCarResult">
36
         <include refid="selectCmcCarVo"/>
36
         <include refid="selectCmcCarVo"/>
37
         where car_id = #{carId}
37
         where car_id = #{carId}
38
     </select>
38
     </select>

+ 6
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceApprovalMapper.xml 查看文件

10
         <result property="deviceId"    column="device_id"    />
10
         <result property="deviceId"    column="device_id"    />
11
         <result property="projectNumber"    column="project_number"    />
11
         <result property="projectNumber"    column="project_number"    />
12
         <result property="applyReason"    column="apply_reason"    />
12
         <result property="applyReason"    column="apply_reason"    />
13
+        <result property="applyDate"    column="apply_date"    />
13
         <result property="beginDate"    column="begin_date"    />
14
         <result property="beginDate"    column="begin_date"    />
14
         <result property="beginHalfday"    column="begin_halfday"    />
15
         <result property="beginHalfday"    column="begin_halfday"    />
15
         <result property="endDate"    column="end_date"    />
16
         <result property="endDate"    column="end_date"    />
25
     </resultMap>
26
     </resultMap>
26
 
27
 
27
     <sql id="selectCmcDeviceApprovalVo">
28
     <sql id="selectCmcDeviceApprovalVo">
28
-        select device_apply_id, applier, device_id, project_number, apply_reason, begin_date, begin_halfday, end_date, end_halfday, days, dept_user_id, dept_comment, manager_user_id, manager_comment, dispatcher, dispatch_comment, estimate_cost from cmc_device_approval
29
+        select device_apply_id, applier, device_id, project_number, apply_reason, apply_date, begin_date, begin_halfday, end_date, end_halfday, days, dept_user_id, dept_comment, manager_user_id, manager_comment, dispatcher, dispatch_comment, estimate_cost from cmc_device_approval
29
     </sql>
30
     </sql>
30
 
31
 
31
     <select id="selectCmcDeviceApprovalList" parameterType="CmcDeviceApproval" resultMap="CmcDeviceApprovalResult">
32
     <select id="selectCmcDeviceApprovalList" parameterType="CmcDeviceApproval" resultMap="CmcDeviceApprovalResult">
35
             <if test="deviceId != null  and deviceId != ''"> and device_id = #{deviceId}</if>
36
             <if test="deviceId != null  and deviceId != ''"> and device_id = #{deviceId}</if>
36
             <if test="projectNumber != null  and projectNumber != ''"> and project_number = #{projectNumber}</if>
37
             <if test="projectNumber != null  and projectNumber != ''"> and project_number = #{projectNumber}</if>
37
             <if test="applyReason != null  and applyReason != ''"> and apply_reason = #{applyReason}</if>
38
             <if test="applyReason != null  and applyReason != ''"> and apply_reason = #{applyReason}</if>
39
+            <if test="applyDate != null "> and apply_date = #{applyDate}</if>
38
             <if test="beginDate != null "> and begin_date = #{beginDate}</if>
40
             <if test="beginDate != null "> and begin_date = #{beginDate}</if>
39
             <if test="beginHalfday != null  and beginHalfday != ''"> and begin_halfday = #{beginHalfday}</if>
41
             <if test="beginHalfday != null  and beginHalfday != ''"> and begin_halfday = #{beginHalfday}</if>
40
             <if test="endDate != null "> and end_date = #{endDate}</if>
42
             <if test="endDate != null "> and end_date = #{endDate}</if>
63
             <if test="deviceId != null">device_id,</if>
65
             <if test="deviceId != null">device_id,</if>
64
             <if test="projectNumber != null">project_number,</if>
66
             <if test="projectNumber != null">project_number,</if>
65
             <if test="applyReason != null">apply_reason,</if>
67
             <if test="applyReason != null">apply_reason,</if>
68
+            <if test="applyDate != null">apply_date,</if>
66
             <if test="beginDate != null">begin_date,</if>
69
             <if test="beginDate != null">begin_date,</if>
67
             <if test="beginHalfday != null">begin_halfday,</if>
70
             <if test="beginHalfday != null">begin_halfday,</if>
68
             <if test="endDate != null">end_date,</if>
71
             <if test="endDate != null">end_date,</if>
82
             <if test="deviceId != null">#{deviceId},</if>
85
             <if test="deviceId != null">#{deviceId},</if>
83
             <if test="projectNumber != null">#{projectNumber},</if>
86
             <if test="projectNumber != null">#{projectNumber},</if>
84
             <if test="applyReason != null">#{applyReason},</if>
87
             <if test="applyReason != null">#{applyReason},</if>
88
+            <if test="applyDate != null">#{applyDate},</if>
85
             <if test="beginDate != null">#{beginDate},</if>
89
             <if test="beginDate != null">#{beginDate},</if>
86
             <if test="beginHalfday != null">#{beginHalfday},</if>
90
             <if test="beginHalfday != null">#{beginHalfday},</if>
87
             <if test="endDate != null">#{endDate},</if>
91
             <if test="endDate != null">#{endDate},</if>
104
             <if test="deviceId != null">device_id = #{deviceId},</if>
108
             <if test="deviceId != null">device_id = #{deviceId},</if>
105
             <if test="projectNumber != null">project_number = #{projectNumber},</if>
109
             <if test="projectNumber != null">project_number = #{projectNumber},</if>
106
             <if test="applyReason != null">apply_reason = #{applyReason},</if>
110
             <if test="applyReason != null">apply_reason = #{applyReason},</if>
111
+            <if test="applyDate != null">apply_date = #{applyDate},</if>
107
             <if test="beginDate != null">begin_date = #{beginDate},</if>
112
             <if test="beginDate != null">begin_date = #{beginDate},</if>
108
             <if test="beginHalfday != null">begin_halfday = #{beginHalfday},</if>
113
             <if test="beginHalfday != null">begin_halfday = #{beginHalfday},</if>
109
             <if test="endDate != null">end_date = #{endDate},</if>
114
             <if test="endDate != null">end_date = #{endDate},</if>

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

1
 <?xml version="1.0" encoding="UTF-8" ?>
1
 <?xml version="1.0" encoding="UTF-8" ?>
2
 <!DOCTYPE mapper
2
 <!DOCTYPE mapper
3
-PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
-"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
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.CmcDeviceMapper">
5
 <mapper namespace="com.ruoyi.oa.mapper.CmcDeviceMapper">
6
-    
6
+
7
     <resultMap type="CmcDevice" id="CmcDeviceResult">
7
     <resultMap type="CmcDevice" id="CmcDeviceResult">
8
         <result property="deviceId"    column="device_id"    />
8
         <result property="deviceId"    column="device_id"    />
9
         <result property="code"    column="code"    />
9
         <result property="code"    column="code"    />
20
 
20
 
21
     <select id="selectCmcDeviceList" parameterType="CmcDevice" resultMap="CmcDeviceResult">
21
     <select id="selectCmcDeviceList" parameterType="CmcDevice" resultMap="CmcDeviceResult">
22
         <include refid="selectCmcDeviceVo"/>
22
         <include refid="selectCmcDeviceVo"/>
23
-        <where>  
24
-            <if test="code != null  and code != ''"> and code = #{code}</if>
25
-            <if test="type != null  and type != ''"> and type = #{type}</if>
23
+        <where>
24
+            <if test="code != null  and code != ''"> and code like concat('%', #{code}, '%')</if>
25
+            <if test="type != null  and type != ''"> and type like concat('%', #{type}, '%')</if>
26
             <if test="acquisitionTime != null "> and acquisition_time = #{acquisitionTime}</if>
26
             <if test="acquisitionTime != null "> and acquisition_time = #{acquisitionTime}</if>
27
             <if test="cost != null "> and cost = #{cost}</if>
27
             <if test="cost != null "> and cost = #{cost}</if>
28
             <if test="expectLife != null "> and expect_life = #{expectLife}</if>
28
             <if test="expectLife != null "> and expect_life = #{expectLife}</if>
29
-            <if test="series != null  and series != ''"> and series = #{series}</if>
29
+            <if test="series != null  and series != ''"> and series like concat('%', #{series}, '%')</if>
30
         </where>
30
         </where>
31
     </select>
31
     </select>
32
-    
32
+
33
     <select id="selectCmcDeviceByDeviceId" parameterType="Long" resultMap="CmcDeviceResult">
33
     <select id="selectCmcDeviceByDeviceId" parameterType="Long" resultMap="CmcDeviceResult">
34
         <include refid="selectCmcDeviceVo"/>
34
         <include refid="selectCmcDeviceVo"/>
35
         where device_id = #{deviceId}
35
         where device_id = #{deviceId}
36
     </select>
36
     </select>
37
-        
37
+
38
     <insert id="insertCmcDevice" parameterType="CmcDevice" useGeneratedKeys="true" keyProperty="deviceId">
38
     <insert id="insertCmcDevice" parameterType="CmcDevice" useGeneratedKeys="true" keyProperty="deviceId">
39
         insert into cmc_device
39
         insert into cmc_device
40
         <trim prefix="(" suffix=")" suffixOverrides=",">
40
         <trim prefix="(" suffix=")" suffixOverrides=",">
44
             <if test="cost != null">cost,</if>
44
             <if test="cost != null">cost,</if>
45
             <if test="expectLife != null">expect_life,</if>
45
             <if test="expectLife != null">expect_life,</if>
46
             <if test="series != null">series,</if>
46
             <if test="series != null">series,</if>
47
-         </trim>
47
+        </trim>
48
         <trim prefix="values (" suffix=")" suffixOverrides=",">
48
         <trim prefix="values (" suffix=")" suffixOverrides=",">
49
             <if test="code != null">#{code},</if>
49
             <if test="code != null">#{code},</if>
50
             <if test="type != null">#{type},</if>
50
             <if test="type != null">#{type},</if>
52
             <if test="cost != null">#{cost},</if>
52
             <if test="cost != null">#{cost},</if>
53
             <if test="expectLife != null">#{expectLife},</if>
53
             <if test="expectLife != null">#{expectLife},</if>
54
             <if test="series != null">#{series},</if>
54
             <if test="series != null">#{series},</if>
55
-         </trim>
55
+        </trim>
56
     </insert>
56
     </insert>
57
 
57
 
58
     <update id="updateCmcDevice" parameterType="CmcDevice">
58
     <update id="updateCmcDevice" parameterType="CmcDevice">
73
     </delete>
73
     </delete>
74
 
74
 
75
     <delete id="deleteCmcDeviceByDeviceIds" parameterType="String">
75
     <delete id="deleteCmcDeviceByDeviceIds" parameterType="String">
76
-        delete from cmc_device where device_id in 
76
+        delete from cmc_device where device_id in
77
         <foreach item="deviceId" collection="array" open="(" separator="," close=")">
77
         <foreach item="deviceId" collection="array" open="(" separator="," close=")">
78
             #{deviceId}
78
             #{deviceId}
79
         </foreach>
79
         </foreach>

+ 21
- 7
oa-back/sql/sql.sql
文件差异内容过多而无法显示
查看文件


+ 24
- 0
oa-ui/src/api/oa/car/carApproval.js 查看文件

1
+/*
2
+ * @Author: wrh
3
+ * @Date: 2024-03-05 17:26:42
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2024-03-06 13:43:59
6
+ */
1
 import request from '@/utils/request'
7
 import request from '@/utils/request'
2
 
8
 
3
 // 查询cmc用车审批列表
9
 // 查询cmc用车审批列表
26
   })
32
   })
27
 }
33
 }
28
 
34
 
35
+// 新增cmc用车审批
36
+export function submitCarApproval(data) {
37
+  return request({
38
+    url: '/oa/carApproval/submit',
39
+    method: 'post',
40
+    data: data
41
+  })
42
+}
43
+
29
 // 修改cmc用车审批
44
 // 修改cmc用车审批
30
 export function updateCarApproval(data) {
45
 export function updateCarApproval(data) {
31
   return request({
46
   return request({
35
   })
50
   })
36
 }
51
 }
37
 
52
 
53
+// 修改cmc用车审批
54
+export function modifyCarApproval(data) {
55
+  return request({
56
+    url: '/oa/carApproval/modify',
57
+    method: 'put',
58
+    data: data
59
+  })
60
+}
61
+
38
 // 删除cmc用车审批
62
 // 删除cmc用车审批
39
 export function delCarApproval(carApplyId) {
63
 export function delCarApproval(carApplyId) {
40
   return request({
64
   return request({

正在加载...
取消
保存