|
|
@@ -1,7 +1,6 @@
|
|
|
package com.jeeplus.modules.supply.projectInformation.service;
|
|
|
|
|
|
import com.jeeplus.common.config.Global;
|
|
|
-import com.jeeplus.common.utils.IdGen;
|
|
|
import com.jeeplus.common.utils.StringUtils;
|
|
|
import com.jeeplus.core.persistence.Page;
|
|
|
import com.jeeplus.core.service.CrudService;
|
|
|
@@ -250,15 +249,15 @@ public class ProjectInformationService extends CrudService<ProjectInformationMap
|
|
|
for (int i = 0; i < part; i++) {
|
|
|
//100条
|
|
|
List<String> listPage = projectBasicsList.subList(0, pointsDataLimit);
|
|
|
- projectInformationMapper.deleteAll(listPage);
|
|
|
+ projectInformationMapper.deleteAllByCodList(listPage);
|
|
|
//剔除
|
|
|
projectBasicsList.subList(0, pointsDataLimit).clear();
|
|
|
}
|
|
|
if(!projectBasicsList.isEmpty()){
|
|
|
- projectInformationMapper.deleteAll(projectBasicsList);
|
|
|
+ projectInformationMapper.deleteAllByCodList(projectBasicsList);
|
|
|
}
|
|
|
}else{
|
|
|
- projectInformationMapper.deleteAll(projectBasicsList);
|
|
|
+ projectInformationMapper.deleteAllByCodList(projectBasicsList);
|
|
|
}
|
|
|
}
|
|
|
return null;
|
|
|
@@ -379,42 +378,19 @@ public class ProjectInformationService extends CrudService<ProjectInformationMap
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 定时任务删除两天前的数据 待验证
|
|
|
+ * 查询审定单信息表中项目定义号的count
|
|
|
+ * @param projectInformation
|
|
|
+ * @return
|
|
|
*/
|
|
|
- @Scheduled(cron = "0 0/2 * * * ?")
|
|
|
- public void deleteFileByCron(){
|
|
|
- try{
|
|
|
- System.out.println("开始了!");
|
|
|
- if(StringUtils.isNotBlank(host) && ("127.0.0.1".equals(host) || "localhost".equals(host))){
|
|
|
- String path = null;
|
|
|
- if(System.getProperty("os.name").toLowerCase().contains("win")){
|
|
|
- path = Global.getConfig("remoteServer.winDirectory");
|
|
|
- }else{
|
|
|
- path = Global.getConfig("remoteServer.directory");
|
|
|
- }
|
|
|
- //删除 路径名
|
|
|
- File file = new File(path);
|
|
|
- File[] files = file.listFiles();
|
|
|
- //获取要删除的时间
|
|
|
- Calendar date = Calendar.getInstance();
|
|
|
- date.add(Calendar.DAY_OF_MONTH,-1);
|
|
|
- String oldOneTime = new SimpleDateFormat("yyyy_MM_dd").format(date.getTime());
|
|
|
- date.add(Calendar.DAY_OF_MONTH,-1);
|
|
|
- String oldTwoTime = new SimpleDateFormat("yyyy_MM_dd").format(date.getTime());
|
|
|
- //遍历获取全部文件名
|
|
|
- for(File fi:files){
|
|
|
- if(fi.isFile()){ //如果是文件 取到名称集合
|
|
|
- String fileName = fi.getName();
|
|
|
- if(fileName.contains(oldOneTime) || fileName.contains(oldTwoTime)){ //删除前两天的文件
|
|
|
- fi.delete();
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- System.out.println("结束了!");
|
|
|
- }catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public int getProjectDefinitionNumberCountBySubmissionId(ProjectInformation projectInformation){
|
|
|
+ int count = projectInformationMapper.getProjectDefinitionNumberCountBySubmissionId(projectInformation);
|
|
|
+ return count;
|
|
|
}
|
|
|
|
|
|
+ //关联删除项目信息表和审定单信息表
|
|
|
+ @Transactional(readOnly = false)
|
|
|
+ public void deleteAllById(ProjectInformation projectInformation){
|
|
|
+ projectInformationMapper.deleteAllById(projectInformation);
|
|
|
+ }
|
|
|
}
|