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
 import java.util.List;
5
 import java.util.List;
6
 import javax.servlet.http.HttpServletResponse;
6
 import javax.servlet.http.HttpServletResponse;
7
 
7
 
8
+import com.alibaba.fastjson2.JSONObject;
8
 import com.ruoyi.common.utils.DateUtils;
9
 import com.ruoyi.common.utils.DateUtils;
10
+import com.ruoyi.system.service.ISysUserService;
9
 import org.springframework.beans.factory.annotation.Autowired;
11
 import org.springframework.beans.factory.annotation.Autowired;
10
 import org.springframework.web.bind.annotation.GetMapping;
12
 import org.springframework.web.bind.annotation.GetMapping;
11
 import org.springframework.web.bind.annotation.PostMapping;
13
 import org.springframework.web.bind.annotation.PostMapping;
36
 {
38
 {
37
     @Autowired
39
     @Autowired
38
     private ICmcCarService cmcCarService;
40
     private ICmcCarService cmcCarService;
41
+
42
+    @Autowired
43
+    private ISysUserService userService;
39
     /**
44
     /**
40
      * 查询cmc车辆信息列表
45
      * 查询cmc车辆信息列表
41
      */
46
      */
65
     @GetMapping(value = "/{carId}")
70
     @GetMapping(value = "/{carId}")
66
     public AjaxResult getInfo(@PathVariable("carId") Integer carId)
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
     /** 发生日期 */
36
     /** 发生日期 */
37
     @JsonFormat(pattern = "yyyy-MM-dd")
37
     @JsonFormat(pattern = "yyyy-MM-dd")
38
     @Excel(name = "发生日期", width = 30, dateFormat = "yyyy-MM-dd")
38
     @Excel(name = "发生日期", width = 30, dateFormat = "yyyy-MM-dd")
39
-    private Date occurrDate;
39
+    private Date occurDate;
40
 
40
 
41
     public void setCarExpenseId(String carExpenseId) 
41
     public void setCarExpenseId(String carExpenseId) 
42
     {
42
     {
74
     {
74
     {
75
         return expense;
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
     @Override
87
     @Override
91
             .append("carId", getCarId())
91
             .append("carId", getCarId())
92
             .append("expenseType", getExpenseType())
92
             .append("expenseType", getExpenseType())
93
             .append("expense", getExpense())
93
             .append("expense", getExpense())
94
-            .append("occurrDate", getOccurrDate())
94
+            .append("occurDate", getOccurDate())
95
             .toString();
95
             .toString();
96
     }
96
     }
97
 }
97
 }

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

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

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

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

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

17
 	<select id="selectDriverList" resultMap="SysUserResult">
17
 	<select id="selectDriverList" resultMap="SysUserResult">
18
 		select u.user_id, u.nick_name
18
 		select u.user_id, u.nick_name
19
 		from sys_user u left join sys_user_post up on u.user_id = up.user_id
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
 	</select>
21
 	</select>
22
 
22
 
23
 	<select id="selectDeptLeaderByUserId" parameterType="String" resultMap="SysUserResult">
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
  * @Author: ysh
2
  * @Author: ysh
3
  * @Date: 2024-02-29 11:44:28
3
  * @Date: 2024-02-29 11:44:28
4
  * @LastEditors: Please set LastEditors
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
  * @Author: wrh
8
  * @Author: wrh
326
           });
326
           });
327
         })
327
         })
328
       } else if (this.taskName == '分管审核' || this.taskName == '工会审核') {
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
         complete(this.taskForm).then(response => {
330
         complete(this.taskForm).then(response => {
331
           this.$modal.msgSuccess(response.msg);
331
           this.$modal.msgSuccess(response.msg);
332
           this.$emit('goBack')
332
           this.$emit('goBack')

Ładowanie…
Anuluj
Zapisz