|
@@ -1,7 +1,10 @@
|
|
|
package com.ruoyi.web.controller.agreement;
|
|
|
|
|
|
-import java.util.List;
|
|
|
+import java.text.ParseException;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.*;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
|
|
import com.ruoyi.anpin.domain.TContractManagement;
|
|
|
import com.ruoyi.anpin.service.ITContractManagementService;
|
|
|
import com.ruoyi.common.annotation.RepeatSubmit;
|
|
@@ -107,4 +110,43 @@ public class TContractManagementController extends BaseController
|
|
|
{
|
|
|
return toAjax(tContractManagementService.deleteTContractManagementByIds(fIds));
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询需要提醒的合同管理列表
|
|
|
+ */
|
|
|
+ @GetMapping("/expirationReminderDaysList")
|
|
|
+ public AjaxResult expirationReminderDaysList()
|
|
|
+ {
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat();// 格式化时间
|
|
|
+ sdf.applyPattern("yyyy-MM-dd");
|
|
|
+ Date date = new Date();// 获取当前时间
|
|
|
+
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ List<TContractManagement> tContractManagementList = new ArrayList<>();
|
|
|
+ List<TContractManagement> list = tContractManagementService.selectTContractManagementList(new TContractManagement());
|
|
|
+ if (ObjectUtils.isNotNull(list)){
|
|
|
+ list.forEach(e -> {
|
|
|
+ //获得到期时间
|
|
|
+ if (ObjectUtils.isNotNull(e.getCreationDate()) && ObjectUtils.isNotNull(e.getExpirationReminderDays())){
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
|
+ c.setTime(e.getCreationDate());
|
|
|
+ c.add(Calendar.DATE, e.getExpirationReminderDays());
|
|
|
+ Date newDate = c.getTime();
|
|
|
+ SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ try {
|
|
|
+ Date date1 = format.parse(format.format(date));
|
|
|
+ Date date2 = format.parse(format.format(newDate));
|
|
|
+ boolean before = date1.before(date2);
|
|
|
+ if (!before){
|
|
|
+ tContractManagementList.add(e);
|
|
|
+ }
|
|
|
+ } catch (ParseException parseException) {
|
|
|
+ parseException.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ map.put("tContractManagementList", tContractManagementList);
|
|
|
+ return AjaxResult.success("成功", map);
|
|
|
+ }
|
|
|
}
|