Ver código fonte

1提交、修改用车申请;

2估算用车成本采用年数总和法折旧
lamphua 1 ano atrás
pai
commit
72decb2e67

+ 111
- 10
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcCarApprovalController.java Ver arquivo

@@ -1,21 +1,22 @@
1 1
 package com.ruoyi.web.controller.oa;
2 2
 
3
+import java.math.BigDecimal;
4
+import java.text.SimpleDateFormat;
3 5
 import java.util.List;
4 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 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 16
 import com.ruoyi.common.annotation.Log;
15 17
 import com.ruoyi.common.core.controller.BaseController;
16 18
 import com.ruoyi.common.core.domain.AjaxResult;
17 19
 import com.ruoyi.common.enums.BusinessType;
18
-import com.ruoyi.oa.domain.CmcCarApproval;
19 20
 import com.ruoyi.oa.service.ICmcCarApprovalService;
20 21
 import com.ruoyi.common.utils.poi.ExcelUtil;
21 22
 import com.ruoyi.common.core.page.TableDataInfo;
@@ -33,6 +34,15 @@ public class CmcCarApprovalController extends BaseController
33 34
     @Autowired
34 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 47
      * 查询cmc用车审批列表
38 48
      */
@@ -62,7 +72,28 @@ public class CmcCarApprovalController extends BaseController
62 72
     @GetMapping(value = "/{carApplyId}")
63 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,6 +106,28 @@ public class CmcCarApprovalController extends BaseController
75 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 132
      * 修改cmc用车审批
80 133
      */
@@ -85,6 +138,54 @@ public class CmcCarApprovalController extends BaseController
85 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 190
      * 删除cmc用车审批
90 191
      */

+ 1
- 1
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcCarController.java Ver arquivo

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

+ 0
- 6
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceApprovalController.java Ver arquivo

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

+ 0
- 6
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcDeviceController.java Ver arquivo

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

+ 3
- 3
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcCar.java Ver arquivo

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

+ 18
- 3
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcCarApproval.java Ver arquivo

@@ -43,7 +43,7 @@ public class CmcCarApproval extends BaseEntity
43 43
 
44 44
     /** 人数 */
45 45
     @Excel(name = "人数")
46
-    private Long passengers;
46
+    private Integer passengers;
47 47
 
48 48
     /** 开始日期 */
49 49
     @JsonFormat(pattern = "yyyy-MM-dd")
@@ -103,6 +103,11 @@ public class CmcCarApproval extends BaseEntity
103 103
     @Excel(name = "预计用车成本")
104 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 111
     public void setCarApplyId(String carApplyId)
107 112
     {
108 113
         this.carApplyId = carApplyId;
@@ -157,12 +162,12 @@ public class CmcCarApproval extends BaseEntity
157 162
     {
158 163
         return applyReason;
159 164
     }
160
-    public void setPassengers(Long passengers)
165
+    public void setPassengers(Integer passengers)
161 166
     {
162 167
         this.passengers = passengers;
163 168
     }
164 169
 
165
-    public Long getPassengers()
170
+    public Integer getPassengers()
166 171
     {
167 172
         return passengers;
168 173
     }
@@ -292,6 +297,15 @@ public class CmcCarApproval extends BaseEntity
292 297
     {
293 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 310
     @Override
297 311
     public String toString() {
@@ -317,6 +331,7 @@ public class CmcCarApproval extends BaseEntity
317 331
                 .append("dispatcher", getDispatcher())
318 332
                 .append("dispatchComment", getDispatchComment())
319 333
                 .append("estimateCost", getEstimateCost())
334
+                .append("applyDate", getApplyDate())
320 335
                 .toString();
321 336
     }
322 337
 }

+ 14
- 0
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcDeviceApproval.java Ver arquivo

@@ -87,6 +87,11 @@ public class CmcDeviceApproval extends BaseEntity
87 87
     @Excel(name = "预计设备成本")
88 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 95
     public void setDeviceApplyId(String deviceApplyId) 
91 96
     {
92 97
         this.deviceApplyId = deviceApplyId;
@@ -240,7 +245,15 @@ public class CmcDeviceApproval extends BaseEntity
240 245
     {
241 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 257
     @Override
245 258
     public String toString() {
246 259
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -261,6 +274,7 @@ public class CmcDeviceApproval extends BaseEntity
261 274
             .append("dispatcher", getDispatcher())
262 275
             .append("dispatchComment", getDispatchComment())
263 276
             .append("estimateCost", getEstimateCost())
277
+            .append("applyDate", getApplyDate())
264 278
             .toString();
265 279
     }
266 280
 }

+ 1
- 1
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/mapper/CmcCarMapper.java Ver arquivo

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

+ 1
- 1
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/ICmcCarService.java Ver arquivo

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

+ 1
- 1
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/service/impl/CmcCarServiceImpl.java Ver arquivo

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

+ 6
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcCarApprovalMapper.xml Ver arquivo

@@ -12,6 +12,7 @@
12 12
         <result property="projectNumber"    column="project_number"    />
13 13
         <result property="applyReason"    column="apply_reason"    />
14 14
         <result property="passengers"    column="passengers"    />
15
+        <result property="applyDate"    column="apply_date"    />
15 16
         <result property="beginDate"    column="begin_date"    />
16 17
         <result property="beginHalfday"    column="begin_halfday"    />
17 18
         <result property="endDate"    column="end_date"    />
@@ -29,7 +30,7 @@
29 30
     </resultMap>
30 31
 
31 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 34
     </sql>
34 35
 
35 36
     <select id="selectCmcCarApprovalList" parameterType="CmcCarApproval" resultMap="CmcCarApprovalResult">
@@ -41,6 +42,7 @@
41 42
             <if test="projectNumber != null  and projectNumber != ''"> and project_number = #{projectNumber}</if>
42 43
             <if test="applyReason != null  and applyReason != ''"> and apply_reason = #{applyReason}</if>
43 44
             <if test="passengers != null "> and passengers = #{passengers}</if>
45
+            <if test="applyDate != null "> and apply_date = #{beginDate}</if>
44 46
             <if test="beginDate != null "> and begin_date = #{beginDate}</if>
45 47
             <if test="beginHalfday != null  and beginHalfday != ''"> and begin_halfday = #{beginHalfday}</if>
46 48
             <if test="endDate != null "> and end_date = #{endDate}</if>
@@ -73,6 +75,7 @@
73 75
             <if test="projectNumber != null">project_number,</if>
74 76
             <if test="applyReason != null">apply_reason,</if>
75 77
             <if test="passengers != null">passengers,</if>
78
+            <if test="applyDate != null">apply_date,</if>
76 79
             <if test="beginDate != null">begin_date,</if>
77 80
             <if test="beginHalfday != null">begin_halfday,</if>
78 81
             <if test="endDate != null">end_date,</if>
@@ -96,6 +99,7 @@
96 99
             <if test="projectNumber != null">#{projectNumber},</if>
97 100
             <if test="applyReason != null">#{applyReason},</if>
98 101
             <if test="passengers != null">#{passengers},</if>
102
+            <if test="applyDate != null">#{applyDate},</if>
99 103
             <if test="beginDate != null">#{beginDate},</if>
100 104
             <if test="beginHalfday != null">#{beginHalfday},</if>
101 105
             <if test="endDate != null">#{endDate},</if>
@@ -122,6 +126,7 @@
122 126
             <if test="projectNumber != null">project_number = #{projectNumber},</if>
123 127
             <if test="applyReason != null">apply_reason = #{applyReason},</if>
124 128
             <if test="passengers != null">passengers = #{passengers},</if>
129
+            <if test="applyDate != null">apply_date = #{applyDate},</if>
125 130
             <if test="beginDate != null">begin_date = #{beginDate},</if>
126 131
             <if test="beginHalfday != null">begin_halfday = #{beginHalfday},</if>
127 132
             <if test="endDate != null">end_date = #{endDate},</if>

+ 4
- 4
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcCarMapper.xml Ver arquivo

@@ -22,17 +22,17 @@
22 22
     <select id="selectCmcCarList" parameterType="CmcCar" resultMap="CmcCarResult">
23 23
         <include refid="selectCmcCarVo"/>
24 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 26
             <if test="driver != null "> and driver = #{driver}</if>
27 27
             <if test="acquisitionTime != null "> and acquisition_time = #{acquisitionTime}</if>
28 28
             <if test="cost != null "> and cost = #{cost}</if>
29 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 32
         </where>
33 33
     </select>
34 34
 
35
-    <select id="selectCmcCarByCarId" parameterType="Long" resultMap="CmcCarResult">
35
+    <select id="selectCmcCarByCarId" parameterType="Integer" resultMap="CmcCarResult">
36 36
         <include refid="selectCmcCarVo"/>
37 37
         where car_id = #{carId}
38 38
     </select>

+ 6
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceApprovalMapper.xml Ver arquivo

@@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
10 10
         <result property="deviceId"    column="device_id"    />
11 11
         <result property="projectNumber"    column="project_number"    />
12 12
         <result property="applyReason"    column="apply_reason"    />
13
+        <result property="applyDate"    column="apply_date"    />
13 14
         <result property="beginDate"    column="begin_date"    />
14 15
         <result property="beginHalfday"    column="begin_halfday"    />
15 16
         <result property="endDate"    column="end_date"    />
@@ -25,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
25 26
     </resultMap>
26 27
 
27 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 30
     </sql>
30 31
 
31 32
     <select id="selectCmcDeviceApprovalList" parameterType="CmcDeviceApproval" resultMap="CmcDeviceApprovalResult">
@@ -35,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
35 36
             <if test="deviceId != null  and deviceId != ''"> and device_id = #{deviceId}</if>
36 37
             <if test="projectNumber != null  and projectNumber != ''"> and project_number = #{projectNumber}</if>
37 38
             <if test="applyReason != null  and applyReason != ''"> and apply_reason = #{applyReason}</if>
39
+            <if test="applyDate != null "> and apply_date = #{applyDate}</if>
38 40
             <if test="beginDate != null "> and begin_date = #{beginDate}</if>
39 41
             <if test="beginHalfday != null  and beginHalfday != ''"> and begin_halfday = #{beginHalfday}</if>
40 42
             <if test="endDate != null "> and end_date = #{endDate}</if>
@@ -63,6 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
63 65
             <if test="deviceId != null">device_id,</if>
64 66
             <if test="projectNumber != null">project_number,</if>
65 67
             <if test="applyReason != null">apply_reason,</if>
68
+            <if test="applyDate != null">apply_date,</if>
66 69
             <if test="beginDate != null">begin_date,</if>
67 70
             <if test="beginHalfday != null">begin_halfday,</if>
68 71
             <if test="endDate != null">end_date,</if>
@@ -82,6 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
82 85
             <if test="deviceId != null">#{deviceId},</if>
83 86
             <if test="projectNumber != null">#{projectNumber},</if>
84 87
             <if test="applyReason != null">#{applyReason},</if>
88
+            <if test="applyDate != null">#{applyDate},</if>
85 89
             <if test="beginDate != null">#{beginDate},</if>
86 90
             <if test="beginHalfday != null">#{beginHalfday},</if>
87 91
             <if test="endDate != null">#{endDate},</if>
@@ -104,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
104 108
             <if test="deviceId != null">device_id = #{deviceId},</if>
105 109
             <if test="projectNumber != null">project_number = #{projectNumber},</if>
106 110
             <if test="applyReason != null">apply_reason = #{applyReason},</if>
111
+            <if test="applyDate != null">apply_date = #{applyDate},</if>
107 112
             <if test="beginDate != null">begin_date = #{beginDate},</if>
108 113
             <if test="beginHalfday != null">begin_halfday = #{beginHalfday},</if>
109 114
             <if test="endDate != null">end_date = #{endDate},</if>

+ 12
- 12
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcDeviceMapper.xml Ver arquivo

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

+ 21
- 7
oa-back/sql/sql.sql
Diferenças do arquivo suprimidas por serem muito extensas
Ver arquivo


+ 24
- 0
oa-ui/src/api/oa/car/carApproval.js Ver arquivo

@@ -1,3 +1,9 @@
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 7
 import request from '@/utils/request'
2 8
 
3 9
 // 查询cmc用车审批列表
@@ -26,6 +32,15 @@ export function addCarApproval(data) {
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 44
 // 修改cmc用车审批
30 45
 export function updateCarApproval(data) {
31 46
   return request({
@@ -35,6 +50,15 @@ export function updateCarApproval(data) {
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 62
 // 删除cmc用车审批
39 63
 export function delCarApproval(carApplyId) {
40 64
   return request({

Carregando…
Cancelar
Salvar