|
@@ -24,6 +24,7 @@ import com.jeeplus.modules.ruralprojectrecords.dao.RuralWorkProjectUserDao;
|
|
|
import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
|
|
|
import com.jeeplus.modules.ruralprojectrecords.enums.ProjectStatusEnum;
|
|
|
import com.jeeplus.modules.serialnum.service.SerialNumTplService;
|
|
|
+import com.jeeplus.modules.sys.entity.MainDictDetail;
|
|
|
import com.jeeplus.modules.sys.entity.Office;
|
|
|
import com.jeeplus.modules.sys.entity.User;
|
|
|
import com.jeeplus.modules.sys.service.OfficeService;
|
|
@@ -1298,4 +1299,42 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
|
|
|
page.setList(recordsList);
|
|
|
return page;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取项目即将超期还未上报并进行通知
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public void saveProjectReportedListByAdvent(){
|
|
|
+ RuralProjectRecords projectRecords = new RuralProjectRecords();
|
|
|
+ //查询超期时间天数
|
|
|
+ List<MainDictDetail> adventCount = DictUtils.getMainDictListOnProjectAdvent("advent_count");
|
|
|
+ if(adventCount.size()>0){
|
|
|
+ //获取超期时间天数转int
|
|
|
+ Integer endingCount = Integer.parseInt(adventCount.get(0).getLabel());
|
|
|
+ //设置开始时间为还有3天即将超期
|
|
|
+ projectRecords.setStartCount(endingCount-3);
|
|
|
+ projectRecords.setEndingCount(endingCount);
|
|
|
+ }
|
|
|
+ //获取项目数据
|
|
|
+ List<RuralProjectRecords> projectRecordsList = dao.getProjectReportedListByAdvent(projectRecords);
|
|
|
+ for (RuralProjectRecords info: projectRecordsList) {
|
|
|
+ String notifyStr = "项目编号:"+info.getProjectId()+",项目名称:"+ info.getProjectName();
|
|
|
+ String titleStr = "项目名称:"+ info.getProjectName()+"上报即将超期。超期时间为:"+info.getAdventDate();
|
|
|
+ List<User> projectLeaders = workProjectUserDao.queryProjectUsers(info.getId(), "1");
|
|
|
+ for (User user: projectLeaders) {
|
|
|
+ workProjectNotifyService
|
|
|
+ .save(UtilNotify.saveNotify(info.getId(),
|
|
|
+ user,
|
|
|
+ info.getCompany().getId(),
|
|
|
+ titleStr,
|
|
|
+ notifyStr,
|
|
|
+ "94",
|
|
|
+ "0",
|
|
|
+ "待通知",
|
|
|
+ ""));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|