瀏覽代碼

项目、合同时间范围查询修改

lamphua 5 天之前
父節點
當前提交
73cf1a7a75

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

@@ -140,6 +140,7 @@ public class CmcContractController extends BaseController
140 140
                     Calendar calendar = Calendar.getInstance();
141 141
                     calendar.set(Calendar.YEAR, Integer.parseInt(monthList.get(i).split("-")[0]));
142 142
                     calendar.set(Calendar.MONTH, Integer.parseInt(monthList.get(i).split("-")[1]) - 1);
143
+                    calendar.set(Calendar.DAY_OF_MONTH, 1);
143 144
                     String endTimeString = monthList.get(i) + "-" + calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
144 145
                     Map<String, Object> params = new HashMap<>();
145 146
                     params.put("beginTime", beginTimeString + " 00:00:00");
@@ -181,6 +182,7 @@ public class CmcContractController extends BaseController
181 182
                 Calendar calendar = Calendar.getInstance();
182 183
                 calendar.set(Calendar.YEAR, Integer.parseInt(new SimpleDateFormat("yyyy").format(cmcContract.getSignDate())));
183 184
                 calendar.set(Calendar.MONTH, i - 1);
185
+                calendar.set(Calendar.DAY_OF_MONTH, 1);
184 186
                 String endTimeString = new SimpleDateFormat("yyyy").format(cmcContract.getSignDate()) + "-" + month + "-" + calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
185 187
                 Map<String, Object> params = new HashMap<>();
186 188
                 params.put("beginTime", beginTimeString + " 00:00:00");
@@ -218,6 +220,14 @@ public class CmcContractController extends BaseController
218 220
             yearAmountObject.put(new SimpleDateFormat("yyyy").format(cmcContract.getSignDate()), totalAmount);
219 221
             paidYearAmountObject.put(new SimpleDateFormat("yyyy").format(cmcContract.getSignDate()), paidTotalAmount);
220 222
         }
223
+        if (!endTime.equals("")) {
224
+            Calendar calendar = Calendar.getInstance();
225
+            calendar.set(Calendar.YEAR, Integer.parseInt(endTime.split("-")[0]));
226
+            calendar.set(Calendar.MONTH, Integer.parseInt(endTime.split("-")[1]) - 1);
227
+            calendar.set(Calendar.DAY_OF_MONTH, 1);
228
+            endTime = endTime.split("-")[0] + "-" + endTime.split("-")[1] + "-"
229
+                    + calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
230
+        }
221 231
         getProjectSourceStatistic(cmcContract, sourceCountObject, paidSourceCountObject, sourceAmountObject, paidSourceAmountObject, totalCount, paidTotalCount, totalAmount, paidTotalAmount, beginTime, endTime);
222 232
         yearCountArray.add(yearCountObject);
223 233
         monthCountArray.add(monthCountObject);

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

@@ -307,6 +307,7 @@ public class CmcProjectController extends BaseController {
307 307
                     Calendar calendar = Calendar.getInstance();
308 308
                     calendar.set(Calendar.YEAR, Integer.parseInt(monthList.get(i).split("-")[0]));
309 309
                     calendar.set(Calendar.MONTH, Integer.parseInt(monthList.get(i).split("-")[1]) - 1);
310
+                    calendar.set(Calendar.DAY_OF_MONTH, 1);
310 311
                     String endTimeString = monthList.get(i) + "-" + calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
311 312
                     Map<String, Object> params = new HashMap<>();
312 313
                     params.put("beginTime", beginTimeString + " 00:00:00");
@@ -383,6 +384,7 @@ public class CmcProjectController extends BaseController {
383 384
                 Calendar calendar = Calendar.getInstance();
384 385
                 calendar.set(Calendar.YEAR, Integer.parseInt(cmcProject.getProjectNumber()));
385 386
                 calendar.set(Calendar.MONTH, i - 1);
387
+                calendar.set(Calendar.DAY_OF_MONTH, 1);
386 388
                 String endTimeString = cmcProject.getProjectNumber() + "-" + month + "-"
387 389
                         + calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
388 390
                 String monthKey = cmcProject.getProjectNumber() + "-" + month;
@@ -509,6 +511,7 @@ public class CmcProjectController extends BaseController {
509 511
             Calendar calendar = Calendar.getInstance();
510 512
             calendar.set(Calendar.YEAR, Integer.parseInt(endTime.split("-")[0]));
511 513
             calendar.set(Calendar.MONTH, Integer.parseInt(endTime.split("-")[1]) - 1);
514
+            calendar.set(Calendar.DAY_OF_MONTH, 1);
512 515
             endTime = endTime.split("-")[0] + "-" + endTime.split("-")[1] + "-"
513 516
                     + calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
514 517
         }

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

@@ -160,6 +160,7 @@ public class CmcSubContractController extends BaseController
160 160
                     Calendar calendar = Calendar.getInstance();
161 161
                     calendar.set(Calendar.YEAR, Integer.parseInt(monthList.get(i).split("-")[0]));
162 162
                     calendar.set(Calendar.MONTH, Integer.parseInt(monthList.get(i).split("-")[1]) - 1);
163
+                    calendar.set(Calendar.DAY_OF_MONTH, 1);
163 164
                     String endTimeString = monthList.get(i) + "-" + calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
164 165
                     Map<String, Object> params = new HashMap<>();
165 166
                     params.put("beginTime", beginTimeString + " 00:00:00");
@@ -201,6 +202,7 @@ public class CmcSubContractController extends BaseController
201 202
                 Calendar calendar = Calendar.getInstance();
202 203
                 calendar.set(Calendar.YEAR, Integer.parseInt(new SimpleDateFormat("yyyy").format(cmcSubContract.getSignDate())));
203 204
                 calendar.set(Calendar.MONTH, i - 1);
205
+                calendar.set(Calendar.DAY_OF_MONTH, 1);
204 206
                 String endTimeString = new SimpleDateFormat("yyyy").format(cmcSubContract.getSignDate()) + "-" + month + "-" + calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
205 207
                 Map<String, Object> params = new HashMap<>();
206 208
                 params.put("beginTime", beginTimeString + " 00:00:00");
@@ -238,6 +240,14 @@ public class CmcSubContractController extends BaseController
238 240
             yearAmountObject.put(new SimpleDateFormat("yyyy").format(cmcSubContract.getSignDate()), totalAmount);
239 241
             paidYearAmountObject.put(new SimpleDateFormat("yyyy").format(cmcSubContract.getSignDate()), paidTotalAmount);
240 242
         }
243
+        if (!endTime.equals("")) {
244
+            Calendar calendar = Calendar.getInstance();
245
+            calendar.set(Calendar.YEAR, Integer.parseInt(endTime.split("-")[0]));
246
+            calendar.set(Calendar.MONTH, Integer.parseInt(endTime.split("-")[1]) - 1);
247
+            calendar.set(Calendar.DAY_OF_MONTH, 1);
248
+            endTime = endTime.split("-")[0] + "-" + endTime.split("-")[1] + "-"
249
+                    + calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
250
+        }
241 251
         getProjectSourceStatistic(cmcSubContract, sourceCountObject, paidSourceCountObject, sourceAmountObject, paidSourceAmountObject, totalCount, paidTotalCount, totalAmount, paidTotalAmount, beginTime, endTime);
242 252
         yearCountArray.add(yearCountObject);
243 253
         monthCountArray.add(monthCountObject);

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

@@ -142,12 +142,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
142 142
             <if test="lendTime != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', lendTime) == '2000' "> and b.lend_time is not null</if>
143 143
             <if test="lendTime != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', lendTime) != '2000' "> and YEAR(b.lend_time) = YEAR(#{lendTime})</if>
144 144
             <if test="params.beginTime != null and params.beginTime != '' and lendTime != null"> and MONTH(b.lend_time) = MONTH(#{lendTime})</if>
145
-            <if test="params.beginTime != null and params.beginTime != '' and lendTime == null">
146
-                and date_format(b.apply_date,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
147
-            </if>
148
-            <if test="params.endTime != null and params.endTime != '' and lendTime == null">
149
-                and date_format(b.apply_date,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
150
-            </if>
151 145
             <if test="unionTime != null "> and b.union_time = #{unionTime}</if>
152 146
         </where>
153 147
         order by b.apply_date desc

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

@@ -139,7 +139,7 @@
139 139
             <if test="passengers != null "> and ca.passengers = #{passengers}</if>
140 140
             <if test="applyDate != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', applyDate) == '2000' "> and ca.apply_date is not null</if>
141 141
             <if test="applyDate != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', applyDate) != '2000' "> and YEAR(ca.apply_date) = YEAR(#{applyDate})</if>
142
-            <if test="params.beginTime != null and params.beginTime != ''"> and MONTH(ca.apply_date) = MONTH(#{applyDate})</if>
142
+            <if test="params.beginTime != null and params.beginTime != '' and applyDate != null"> and MONTH(ca.apply_date) = MONTH(#{applyDate})</if>
143 143
             <if test="beginDate != null "> and ca.begin_date = #{beginDate}</if>
144 144
             <if test="endDate != null "> and ca.end_date = #{endDate}</if>
145 145
             <if test="days != null "> and ca.days = #{days}</if>
@@ -276,12 +276,4 @@
276 276
         </foreach>
277 277
     </delete>
278 278
 
279
-    <select id="selectCmcCarApprovalListByRange" parameterType="CmcCarApproval" resultMap="CmcCarApprovalResult">
280
-        <include refid="selectCmcCarApprovalVo"/>
281
-        <where>
282
-            <if test="params.beginTime != null and params.beginTime != ''"> and ca.apply_date &gt;= #{params.beginTime}</if>
283
-            <if test="params.endTime != null and params.endTime != ''"> and ca.apply_date &lt;= #{params.endTime}</if>
284
-        </where>
285
-        order by ca.apply_date desc
286
-    </select>
287 279
 </mapper>

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

@@ -81,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
81 81
             <if test="zjlUserId != null "> and c.zjl_user_id = #{zjlUserId}</if>
82 82
             <if test="checkTime != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', checkTime) == '2000' "> and c.check_time is not null</if>
83 83
             <if test="checkTime != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', checkTime) != '2000' "> and YEAR(c.check_time) = YEAR(#{checkTime})</if>
84
-            <if test="params.beginTime != null and params.beginTime != ''"> and MONTH(c.check_time) = MONTH(#{checkTime})</if>
84
+            <if test="params.beginTime != null and params.beginTime != '' and checkTime != null"> and MONTH(c.check_time) = MONTH(#{checkTime})</if>
85 85
             <if test="zjlComment != null  and zjlComment != ''"> and c.zjl_comment = #{zjlComment}</if>
86 86
         </where>
87 87
     </select>
@@ -164,12 +164,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
164 164
         </foreach>
165 165
     </delete>
166 166
 
167
-    <select id="selectCmcCheckListByRange" parameterType="CmcCheck" resultMap="CmcCheckResult">
168
-        <include refid="selectCmcCheckVo"/>
169
-        <where>
170
-            <if test="params.beginTime != null and params.beginTime != ''"> and c.check_time &gt;= #{params.beginTime}</if>
171
-            <if test="params.endTime != null and params.endTime != ''"> and c.check_time &lt;= #{params.endTime}</if>
172
-        </where>
173
-        order by c.check_time desc
174
-    </select>
175 167
 </mapper>

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

@@ -166,10 +166,6 @@
166 166
             <if test="projectSource != null  and projectSource != ''"> and p.project_source = #{projectSource}</if>
167 167
             <if test="projectName != null  and projectName != ''"> and p.project_name like concat('%', #{projectName}, '%')</if>
168 168
             <if test="partyAName != null  and partyAName != ''"> and pa.party_a_name like concat('%', #{partyAName}, '%')</if>
169
-<<<<<<< HEAD
170
-=======
171
-            
172
->>>>>>> 2790a39d2f9879e185c89178e7033c6745b4bae9
173 169
         </where>
174 170
         group by t1.contract_id
175 171
         order by t1.draft_time desc

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

@@ -84,10 +84,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
84 84
             <if test="applyDate != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', applyDate) == '2000' "> and da.apply_date is not null</if>
85 85
             <if test="applyDate != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', applyDate) != '2000' "> and YEAR(da.apply_date) = YEAR(#{applyDate})</if>
86 86
             <if test="params.beginTime != null and params.beginTime != '' and applyDate != null"> and MONTH(da.apply_date) = MONTH(#{applyDate})</if>
87
-            <if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != '' and applyDate == null">
88
-                and date_format(da.apply_date,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
89
-                and date_format(da.apply_date,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
90
-            </if>
91 87
             <if test="returnDate != null "> and da.return_date = #{returnDate}</if>
92 88
             <if test="beginDate != null "> and da.begin_date = #{beginDate}</if>
93 89
             <if test="endDate != null "> and da.end_date = #{endDate}</if>
@@ -197,12 +193,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
197 193
         </foreach>
198 194
     </delete>
199 195
 
200
-    <select id="selectCmcDeviceApprovalListByRange" parameterType="CmcDeviceApproval" resultMap="CmcDeviceApprovalResult">
201
-        <include refid="selectCmcDeviceApprovalVo"/>
202
-        <where>
203
-            <if test="params.beginTime != null and params.beginTime != ''"> and da.apply_date &gt;= #{params.beginTime}</if>
204
-            <if test="params.endTime != null and params.endTime != ''"> and da.apply_date &lt;= #{params.endTime}</if>
205
-        </where>
206
-        order by da.apply_date desc
207
-    </select>
208 196
 </mapper>

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

@@ -131,12 +131,6 @@
131 131
             <if test="entryTime != null "> and p.entry_time = #{entryTime}</if>
132 132
             <if test="exitTime != null "> and p.exit_time = #{exitTime}</if>
133 133
             <if test="participates != null  and participates != ''"> and find_in_set(#{participates}, p.participates)</if>
134
-            <if test="params.beginTime != null and params.beginTime != ''">
135
-                and date_format(p.register_time,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
136
-            </if>
137
-            <if test="params.endTime != null and params.endTime != ''">
138
-                and date_format(p.register_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
139
-            </if>
140 134
         </where>
141 135
         group by p.project_id
142 136
         order by p.register_time desc, p.project_number desc
@@ -320,7 +314,7 @@
320 314
         union
321 315
         select p.project_id, p.project_number, p.project_name, p.project_leader, p.register_time from cmc_declare d
322 316
         left join cmc_project as p on p.project_id = d.project_id
323
-        where d.user_id = #{participates}) as t
317
+        where d.user_id = #{participates} and p.project_number is not null) as t
324 318
         group by t.project_id
325 319
         order by t.register_time desc, t.project_number desc
326 320
     </select>

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

@@ -153,7 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
153 153
             <if test="gmUserId != null "> and s.gm_user_id = #{gmUserId}</if>
154 154
             <if test="gmTime != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', gmTime) == '2000' "> and s.gm_time is not null</if>
155 155
             <if test="gmTime != null and @com.ruoyi.common.utils.DateUtils@parseDateToStr('yyyy', gmTime) != '2000' "> and YEAR(s.gm_time) = YEAR(#{gmTime})</if>
156
-            <if test="params.beginTime != null and params.beginTime != ''"> and MONTH(s.gm_time) = MONTH(#{gmTime})</if>
156
+            <if test="params.beginTime != null and params.beginTime != '' and gmTime != null"> and MONTH(s.gm_time) = MONTH(#{gmTime})</if>
157 157
             <if test="gmComment != null  and gmComment != ''"> and s.gm_comment = #{gmComment}</if>
158 158
         </where>
159 159
         group by s.settle_id
@@ -287,13 +287,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
287 287
         </foreach>
288 288
     </delete>
289 289
 
290
-    <select id="selectCmcSettleListByRange" parameterType="CmcSettle" resultMap="CmcSettleResult">
291
-        <include refid="selectCmcSettleVo"/>
292
-        <where>
293
-            ss.content = '实际结算总金额'
294
-            <if test="params.beginTime != null and params.beginTime != ''"> and s.gm_time &gt;= #{params.beginTime}</if>
295
-            <if test="params.endTime != null and params.endTime != ''"> and s.gm_time &lt;= #{params.endTime}</if>
296
-        </where>
297
-        order by s.gm_time desc
298
-    </select>
299 290
 </mapper>

+ 1
- 1
oa-ui/src/api/oa/contract/contract.js 查看文件

@@ -60,7 +60,7 @@ export function delContract(contractId) {
60 60
 // 合同统计
61 61
 export function getContractStatistic(query) {
62 62
   return request({
63
-    url: '/oa/contract/statistic/',
63
+    url: '/oa/contract/statistic',
64 64
     method: 'get',
65 65
     params: query
66 66
   })

Loading…
取消
儲存