Przeglądaj źródła

实现用车审批或签功能

lamphua 1 rok temu
rodzic
commit
04ed117cdf

+ 19
- 1
oa-back/ruoyi-admin/src/main/java/com/ruoyi/web/controller/oa/CmcCarController.java Wyświetl plik

@@ -5,7 +5,9 @@ import java.text.SimpleDateFormat;
5 5
 import java.util.List;
6 6
 import javax.servlet.http.HttpServletResponse;
7 7
 
8
+import com.alibaba.fastjson2.JSONObject;
8 9
 import com.ruoyi.common.utils.DateUtils;
10
+import com.ruoyi.system.service.ISysUserService;
9 11
 import org.springframework.beans.factory.annotation.Autowired;
10 12
 import org.springframework.web.bind.annotation.GetMapping;
11 13
 import org.springframework.web.bind.annotation.PostMapping;
@@ -36,6 +38,9 @@ public class CmcCarController extends BaseController
36 38
 {
37 39
     @Autowired
38 40
     private ICmcCarService cmcCarService;
41
+
42
+    @Autowired
43
+    private ISysUserService userService;
39 44
     /**
40 45
      * 查询cmc车辆信息列表
41 46
      */
@@ -65,7 +70,20 @@ public class CmcCarController extends BaseController
65 70
     @GetMapping(value = "/{carId}")
66 71
     public AjaxResult getInfo(@PathVariable("carId") Integer carId)
67 72
     {
68
-        return success(cmcCarService.selectCmcCarByCarId(carId));
73
+        JSONObject jsonObject = new JSONObject();
74
+        CmcCar cmcCar = cmcCarService.selectCmcCarByCarId(carId);
75
+        jsonObject.put("carId", cmcCar.getCarId());
76
+        jsonObject.put("licensePlate", cmcCar.getLicensePlate());
77
+        jsonObject.put("driver", userService.selectUserById(cmcCar.getDriver()).getNickName());
78
+        jsonObject.put("brand", cmcCar.getBrand());
79
+        jsonObject.put("series", cmcCar.getSeries());
80
+        jsonObject.put("cost", cmcCar.getCost());
81
+        jsonObject.put("acquisitionTime", cmcCar.getAcquisitionTime());
82
+        jsonObject.put("expectLife", cmcCar.getExpectLife());
83
+        jsonObject.put("expectKm", cmcCar.getExpectKm());
84
+        jsonObject.put("isRent", cmcCar.getIsRent());
85
+        jsonObject.put("dayCost", cmcCar.getDayCost());
86
+        return success(jsonObject);
69 87
     }
70 88
 
71 89
     /**

+ 6
- 6
oa-back/ruoyi-system/src/main/java/com/ruoyi/oa/domain/CmcCarExpense.java Wyświetl plik

@@ -36,7 +36,7 @@ public class CmcCarExpense extends BaseEntity
36 36
     /** 发生日期 */
37 37
     @JsonFormat(pattern = "yyyy-MM-dd")
38 38
     @Excel(name = "发生日期", width = 30, dateFormat = "yyyy-MM-dd")
39
-    private Date occurrDate;
39
+    private Date occurDate;
40 40
 
41 41
     public void setCarExpenseId(String carExpenseId) 
42 42
     {
@@ -74,14 +74,14 @@ public class CmcCarExpense extends BaseEntity
74 74
     {
75 75
         return expense;
76 76
     }
77
-    public void setOccurrDate(Date occurrDate)
77
+    public void setOccurDate(Date occurDate)
78 78
     {
79
-        this.occurrDate = occurrDate;
79
+        this.occurDate = occurDate;
80 80
     }
81 81
 
82
-    public Date getOccurrDate()
82
+    public Date getOccurDate()
83 83
     {
84
-        return occurrDate;
84
+        return occurDate;
85 85
     }
86 86
 
87 87
     @Override
@@ -91,7 +91,7 @@ public class CmcCarExpense extends BaseEntity
91 91
             .append("carId", getCarId())
92 92
             .append("expenseType", getExpenseType())
93 93
             .append("expense", getExpense())
94
-            .append("occurrDate", getOccurrDate())
94
+            .append("occurDate", getOccurDate())
95 95
             .toString();
96 96
     }
97 97
 }

+ 6
- 6
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcCarExpenseMapper.xml Wyświetl plik

@@ -9,11 +9,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
9 9
         <result property="carId"    column="car_id"    />
10 10
         <result property="expenseType"    column="expense_type"    />
11 11
         <result property="expense"    column="expense"    />
12
-        <result property="occurrDate"    column="occurr_date"    />
12
+        <result property="occurDate"    column="occur_date"    />
13 13
     </resultMap>
14 14
 
15 15
     <sql id="selectCmcCarExpenseVo">
16
-        select car_expense_id, car_id, expense_type, expense, occurr_date from cmc_car_expense
16
+        select car_expense_id, car_id, expense_type, expense, occur_date from cmc_car_expense
17 17
     </sql>
18 18
 
19 19
     <select id="selectCmcCarExpenseList" parameterType="CmcCarExpense" resultMap="CmcCarExpenseResult">
@@ -22,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
22 22
             <if test="carId != null "> and car_id = #{carId}</if>
23 23
             <if test="expenseType != null  and expenseType != ''"> and expense_type = #{expenseType}</if>
24 24
             <if test="expense != null "> and expense = #{expense}</if>
25
-            <if test="occurrDate != null "> and occurr_date = #{occurrDate}</if>
25
+            <if test="occurDate != null "> and occur_date = #{occurDate}</if>
26 26
         </where>
27 27
     </select>
28 28
     
@@ -38,14 +38,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
38 38
             <if test="carId != null">car_id,</if>
39 39
             <if test="expenseType != null">expense_type,</if>
40 40
             <if test="expense != null">expense,</if>
41
-            <if test="occurrDate != null">occurr_date,</if>
41
+            <if test="occurDate != null">occur_date,</if>
42 42
          </trim>
43 43
         <trim prefix="values (" suffix=")" suffixOverrides=",">
44 44
             <if test="carExpenseId != null">#{carExpenseId},</if>
45 45
             <if test="carId != null">#{carId},</if>
46 46
             <if test="expenseType != null">#{expenseType},</if>
47 47
             <if test="expense != null">#{expense},</if>
48
-            <if test="occurrDate != null">#{occurrDate},</if>
48
+            <if test="occurDate != null">#{occurDate},</if>
49 49
          </trim>
50 50
     </insert>
51 51
 
@@ -55,7 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
55 55
             <if test="carId != null">car_id = #{carId},</if>
56 56
             <if test="expenseType != null">expense_type = #{expenseType},</if>
57 57
             <if test="expense != null">expense = #{expense},</if>
58
-            <if test="occurrDate != null">occurr_date = #{occurrDate},</if>
58
+            <if test="occurDate != null">occur_date = #{occurDate},</if>
59 59
         </trim>
60 60
         where car_expense_id = #{carExpenseId}
61 61
     </update>

+ 6
- 1
oa-back/ruoyi-system/src/main/resources/mapper/oa/CmcCarMapper.xml Wyświetl plik

@@ -16,10 +16,11 @@
16 16
         <result property="brand"    column="brand"    />
17 17
         <result property="isRent"    column="is_rent"    />
18 18
         <result property="dayCost"    column="day_cost"    />
19
+        <result property="remark"    column="remark"    />
19 20
     </resultMap>
20 21
 
21 22
     <sql id="selectCmcCarVo">
22
-        select car_id, license_plate, driver, acquisition_time, cost, expect_life, expect_km, series, brand, is_rent, day_cost from cmc_car
23
+        select car_id, license_plate, driver, acquisition_time, cost, expect_life, expect_km, series, brand, is_rent, day_cost, remark from cmc_car
23 24
     </sql>
24 25
 
25 26
     <select id="selectCmcCarList" parameterType="CmcCar" resultMap="CmcCarResult">
@@ -35,6 +36,7 @@
35 36
             <if test="brand != null  and brand != ''"> and brand like concat('%', #{brand}, '%')</if>
36 37
             <if test="isRent != null  and isRent != ''"> and isRent = #{isRent}</if>
37 38
             <if test="dayCost != null  and dayCost != ''"> and day_cost = #{dayCost}</if>
39
+            <if test="remark != null  and remark != ''"> and remark = #{remark}</if>
38 40
         </where>
39 41
     </select>
40 42
 
@@ -56,6 +58,7 @@
56 58
             <if test="brand != null">brand,</if>
57 59
             <if test="isRent != null">is_rent,</if>
58 60
             <if test="dayCost != null">day_cost,</if>
61
+            <if test="remark != null">remark,</if>
59 62
         </trim>
60 63
         <trim prefix="values (" suffix=")" suffixOverrides=",">
61 64
             <if test="licensePlate != null">#{licensePlate},</if>
@@ -68,6 +71,7 @@
68 71
             <if test="brand != null">#{brand},</if>
69 72
             <if test="isRent != null">#{isRent},</if>
70 73
             <if test="dayCost != null">#{dayCost},</if>
74
+            <if test="remark != null">#{remark},</if>
71 75
         </trim>
72 76
     </insert>
73 77
 
@@ -84,6 +88,7 @@
84 88
             <if test="brand != null">brand = #{brand},</if>
85 89
             <if test="isRent != null">is_rent = #{isRent},</if>
86 90
             <if test="dayCost != null">day_cost = #{dayCost},</if>
91
+            <if test="remark != null">remark = #{remark},</if>
87 92
         </trim>
88 93
         where car_id = #{carId}
89 94
     </update>

+ 1
- 1
oa-back/ruoyi-system/src/main/resources/mapper/system/SysUserPostMapper.xml Wyświetl plik

@@ -17,7 +17,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
17 17
 	<select id="selectDriverList" resultMap="SysUserResult">
18 18
 		select u.user_id, u.nick_name
19 19
 		from sys_user u left join sys_user_post up on u.user_id = up.user_id
20
-		where up.post_id = 27
20
+		where up.post_id = 27 and u.status = '0'
21 21
 	</select>
22 22
 
23 23
 	<select id="selectDeptLeaderByUserId" parameterType="String" resultMap="SysUserResult">

+ 22
- 21
oa-back/sql/sql.sql
Plik diff jest za duży
Wyświetl plik


+ 2
- 2
oa-ui/src/views/flowable/form/carForm.vue Wyświetl plik

@@ -2,7 +2,7 @@
2 2
  * @Author: ysh
3 3
  * @Date: 2024-02-29 11:44:28
4 4
  * @LastEditors: Please set LastEditors
5
- * @LastEditTime: 2024-03-12 09:46:54
5
+ * @LastEditTime: 2024-03-13 14:17:12
6 6
 -->
7 7
 <!--
8 8
  * @Author: wrh
@@ -326,7 +326,7 @@ export default {
326 326
           });
327 327
         })
328 328
       } else if (this.taskName == '分管审核' || this.taskName == '工会审核') {
329
-        this.$set(this.taskForm.variables, "approval", 16);
329
+        this.$set(this.taskForm.variables, "approvalList", [8,16]);
330 330
         complete(this.taskForm).then(response => {
331 331
           this.$modal.msgSuccess(response.msg);
332 332
           this.$emit('goBack')

Ładowanie…
Anuluj
Zapisz