瀏覽代碼

用户结余

baolei 1 月之前
父節點
當前提交
4cf246123f

+ 42 - 0
src/main/java/com/hzy/framework/web/service/CommonService.java

@@ -0,0 +1,42 @@
+package com.hzy.framework.web.service;
+
+import com.hzy.common.utils.DateUtils;
+import com.hzy.project.system.user.domain.User;
+import com.hzy.project.system.user.service.IUserService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * RuoYi首创 html调用 thymeleaf 实现字典读取
+ * 
+ * @author ruoyi
+ */
+@Service("common")
+public class CommonService
+{
+
+    /**
+     * 查询用户数据信息
+     * 
+     * @return 参数键值
+     */
+    public List<String> getDurationList() throws ParseException {
+
+        List<String> list = new ArrayList<>();
+
+        Date start = DateUtils.parseDate("2025-10-01",DateUtils.YYYY_MM_DD);
+        Date end = DateUtils.getNowDate();
+
+        for (Date curr = start; curr.before(end); curr = DateUtils.addMonths(curr, 1)) {
+            list.add(DateUtils.parseDateToStr("yyyyMM", curr));
+        }
+
+        return list;
+    }
+
+}

+ 8 - 4
src/main/resources/templates/business/balance/balance.html

@@ -13,15 +13,19 @@
                         <ul>
                             <li>
                                 <label>用户ID:</label>
-                                <input type="text" name="userId"/>
-                                <select name="incomeType" th:with="users=${@user.getUserList()}">
+<!--                                <input type="text" name="userId"/>-->
+                                <select name="userId" th:with="users=${@user.getUserList()}">
                                     <option value="">所有</option>
                                     <option th:each="user : ${users}" th:text="${user.userName}" th:value="${user.userId}"></option>
                                 </select>
                             </li>
                             <li>
-                                <label>期初数:</label>
-                                <input type="text" name="duration"/>
+                                <label>结余周期:</label>
+<!--                                <input type="text" name="duration"/>-->
+                                <select name="duration" th:with="commons=${@common.getDurationList()}">
+                                    <option value="">所有</option>
+                                    <option th:each="common : ${commons}" th:text="${common}" th:value="${common}"></option>
+                                </select>
                             </li>
 <!--                            <li>-->
 <!--                                <label>期初数:</label>-->