Selaa lähdekoodia

1.纸质归档超过40天和批量归档超过6个月通知功能开发
2.其他微调

user5 3 vuotta sitten
vanhempi
commit
ad40861eba

+ 17 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/dao/RuralProjectRecordsDao.java

@@ -375,4 +375,21 @@ public interface RuralProjectRecordsDao extends CrudDao<RuralProjectRecords> {
     List<RuralProjectRecordsExport> findExportList(RuralProjectRecords projectRecords);
 
 
+    /**
+     * 查询A类纸质归档即将超期归档的项目数据信息
+     * @param records
+     * @return
+     */
+    List<RuralProjectRecords> getPaperArchiveProjectReportedList(RuralProjectRecords records);
+
+
+
+    /**
+     * 查询B类批量归档即将超期归档的项目数据信息
+     * @param records
+     * @return
+     */
+    List<RuralProjectRecords> getBatchArchiveProjectReportedList(RuralProjectRecords records);
+
+
 }

+ 132 - 0
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java

@@ -4650,6 +4650,138 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 		}
 	}
 
+	/**
+	 * A类项目纸质归档签发后40天提醒通知
+	 * B类项目批量归档 质量复核后6个月提醒通知
+	 * @return
+	 */
+	@Transactional(readOnly = false)
+	public void getPaperArchiveNotify(){
+		RuralProjectRecords projectRecords = new RuralProjectRecords();
+		//查询归档超期时间天数
+		List<MainDictDetail> adventCount = DictUtils.getMainDictListOnProjectAdvent("advent_record_count");
+		if(adventCount.size()>0){
+			//获取超期时间天数转int
+			Integer endingCount = Integer.parseInt(adventCount.get(0).getLabel());
+			//设置开始时间为还有7天开始通知
+			projectRecords.setStartCount(endingCount-7);
+			projectRecords.setEndingCount(endingCount);
+		}
+		//查询A类项目纸质未进行归档的项目信息(签发后40天)
+		List<RuralProjectRecords> paperArchiveProjectReportedList = dao.getPaperArchiveProjectReportedList(projectRecords);
+
+		//计算两日期之间的天数
+		Date newDate = stepMonth(new Date(), -6);
+		Integer interval = Integer.valueOf(this.getInterval(newDate,new Date()));
+
+		//设置开始时间为还有7天开始通知
+		projectRecords.setStartCount(interval-7);
+		projectRecords.setEndingCount(interval);
+		//查询B类项目未进行批量归档的项目(质量复核后6个月)
+		List<RuralProjectRecords> batchArchiveProjectReportedList = dao.getBatchArchiveProjectReportedList(projectRecords);
+
+
+		for (RuralProjectRecords info: paperArchiveProjectReportedList) {
+			String notifyStr = null;
+			String titleStr = null;
+			//如果当前时间大于过期时间
+			//Date类的一个方法,如果info.getAdventDateDate()早于 new Date() 返回true,否则返回false
+			if(info.getAdventDateDate().before(new Date())){
+				notifyStr = "项目【"+ info.getProjectName()+"】纸质归档已超期";
+				titleStr = "项目【"+ info.getProjectName()+"】纸质归档已超期。超期时间:"+info.getAdventDate() +"。";
+			}else{
+				notifyStr = "项目【"+ info.getProjectName()+"】纸质归档即将超期";
+				titleStr = "项目【"+ info.getProjectName()+"】纸质归档即将超期。超期时间:"+info.getAdventDate();
+			}
+
+			//查询项目的登记人和责任人的id
+			List<User> projectLeaders = dao.getProjectCreateUserAndChargeUser(info.getId());
+			for (User user: projectLeaders) {
+				//根据标题查询通知信息中是否存在未读的信息,有则进行更新并对重复数量进行+1操作
+				WorkProjectNotify byTitleAndUnread = workProjectNotifyService.getByTitleAndUnread(titleStr,user.getId());
+
+				//计算两日期之间的天数
+				Integer advent = Integer.valueOf(this.getInterval(java.sql.Date.valueOf(info.getAdventDate()), new Date()));
+				if(advent > 0){
+					titleStr = titleStr + "已超期:" + advent + "天。请尽快纸质归档";
+				}
+
+				if(null != byTitleAndUnread){
+					byTitleAndUnread.setExigency("1");
+					workProjectNotifyService.updateOverDueInfo(byTitleAndUnread);
+				}else{
+					workProjectNotifyService
+							.save(UtilNotify.saveNotify(info.getId(),
+									user,
+									info.getCompany().getId(),
+									titleStr,
+									notifyStr,
+									"94",
+									"0",
+									"待通知",
+									""));
+				}
+
+
+			}
+
+		}
+
+		for (RuralProjectRecords info: batchArchiveProjectReportedList) {
+			String notifyStr = null;
+			String titleStr = null;
+			//如果当前时间大于过期时间
+			//Date类的一个方法,如果info.getAdventDateDate()早于 new Date() 返回true,否则返回false
+			if(info.getAdventDateDate().before(new Date())){
+				notifyStr = "项目【"+ info.getProjectName()+"】批量归档已超期";
+				titleStr = "项目【"+ info.getProjectName()+"】批量归档已超期。超期时间:"+info.getAdventDate() +"。";
+			}else{
+				notifyStr = "项目【"+ info.getProjectName()+"】批量归档即将超期";
+				titleStr = "项目【"+ info.getProjectName()+"】批量归档即将超期。超期时间:"+info.getAdventDate();
+			}
+
+			//查询项目的登记人和责任人的id
+			List<User> projectLeaders = dao.getProjectCreateUserAndChargeUser(info.getId());
+			for (User user: projectLeaders) {
+				//根据标题查询通知信息中是否存在未读的信息,有则进行更新并对重复数量进行+1操作
+				WorkProjectNotify byTitleAndUnread = workProjectNotifyService.getByTitleAndUnread(titleStr,user.getId());
+
+				//计算两日期之间的天数
+				Integer advent = Integer.valueOf(this.getInterval(java.sql.Date.valueOf(info.getAdventDate()), new Date()));
+				if(advent > 0){
+					titleStr = titleStr + "已超期:" + advent + "天。请尽快批量归档";
+				}
+
+				if(null != byTitleAndUnread){
+					byTitleAndUnread.setExigency("1");
+					workProjectNotifyService.updateOverDueInfo(byTitleAndUnread);
+				}else{
+					workProjectNotifyService
+							.save(UtilNotify.saveNotify(info.getId(),
+									user,
+									info.getCompany().getId(),
+									titleStr,
+									notifyStr,
+									"94",
+									"0",
+									"待通知",
+									""));
+				}
+
+
+			}
+
+		}
+	}
+
+	public static Date stepMonth(Date sourceDate, int month) {
+
+		Calendar c = Calendar.getInstance();
+		c.setTime(sourceDate);
+		c.add(Calendar.MONTH, month);
+
+		return c.getTime();
+	}
 
 
 }

+ 22 - 4
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralProjectSignatureOldMessageDisposeController.java

@@ -3,7 +3,6 @@ package com.jeeplus.modules.ruralprojectrecords.web;
 import com.alibaba.fastjson.JSON;
 import com.google.common.collect.Lists;
 import com.jeeplus.common.config.Global;
-import com.jeeplus.common.oss.OSSClientUtil;
 import com.jeeplus.common.utils.FreemarkerUtil;
 import com.jeeplus.common.utils.ResponseUtil;
 import com.jeeplus.common.utils.StringUtils;
@@ -34,12 +33,13 @@ import freemarker.template.Template;
 import org.activiti.engine.HistoryService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
-import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.multipart.MultipartFile;
 
-import javax.servlet.http.HttpServletResponse;
 import java.io.File;
 import java.io.IOException;
 import java.util.*;
@@ -236,6 +236,24 @@ public class RuralProjectSignatureOldMessageDisposeController extends BaseContro
     }
 
 
+    /**
+     * A类项目纸质归档签发后40天提醒通知
+     * B类项目批量归档 质量复核后6个月提醒通知
+     */
+    //设置每日凌晨20分调用通知方法
+    @Transactional(readOnly = false)
+    @ResponseBody
+    @RequestMapping(value = "/getPaperArchiveNotify")
+    public  Map<String,Object> getPaperArchiveNotify() {
+        Map<String,Object> map = new HashMap<>();
+        logger.info("-----------项目纸质归档和批量归档长期未处理通知(开始)------------------");
+        projectRecordsService.getPaperArchiveNotify();
+        logger.info("-----------项目纸质归档和批量归档长期未处理通知(结束)------------------");
+        map.put("msg","处理完成");
+        return map;
+    }
+
+
 
     /**
      * 物理签章申请demo

+ 15 - 2
src/main/java/com/jeeplus/modules/workcalendar/service/WorkCalendarTaskService.java

@@ -8,7 +8,6 @@ import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectRecordsServic
 import com.jeeplus.modules.ruralprojectrecords.service.RuralProjectSignatureOldMessageDisposeService;
 import com.jeeplus.modules.statement.service.StatementCompanyComprehensiveService;
 import com.jeeplus.modules.workcalendar.entity.WorkCalendar;
-import com.jeeplus.modules.workcontractrecord.service.WorkContractRecordService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -17,7 +16,8 @@ import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
-import java.util.*;
+import java.util.Calendar;
+import java.util.List;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 
@@ -209,4 +209,17 @@ public class WorkCalendarTaskService  {
         logger.info("------------部门级—年度报表(结束)------------------");
     }
 
+    /**
+     * A类项目纸质归档签发后40天提醒通知
+     * B类项目批量归档 质量复核后6个月提醒通知
+     */
+    //设置每日凌晨20分调用通知方法
+    @Scheduled(cron= "0 20 0 * * ?")
+    @Transactional(readOnly = false)
+    public void getPaperArchiveNotify() {
+        logger.info("-----------项目纸质归档和批量归档长期未处理通知(开始)------------------");
+        projectRecordsService.getPaperArchiveNotify();
+        logger.info("-----------项目纸质归档和批量归档长期未处理通知(结束)------------------");
+    }
+
 }

+ 1 - 4
src/main/java/com/jeeplus/modules/workcontent/web/WorkContentCtrlpriceController.java

@@ -3,17 +3,14 @@
  */
 package com.jeeplus.modules.workcontent.web;
 
-import com.google.common.collect.Lists;
 import com.jeeplus.common.config.Global;
 import com.jeeplus.common.utils.StringUtils;
 import com.jeeplus.common.utils.ThisLocalityDownloadUtil;
-import com.jeeplus.common.utils.excel.ExportExcel;
 import com.jeeplus.common.utils.excel.ImportExcel;
 import com.jeeplus.common.web.BaseController;
 import com.jeeplus.modules.sys.entity.MainDictDetail;
 import com.jeeplus.modules.sys.utils.DictUtils;
 import com.jeeplus.modules.workcontent.entity.WorkContentCtrlprice;
-import com.jeeplus.modules.workcontent.entity.WorkContentInvestmentCost;
 import com.jeeplus.modules.workcontent.service.WorkContentCtrlpriceService;
 import com.jeeplus.modules.workreceiptsregister.entity.ResponseEntity;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -123,7 +120,7 @@ public class WorkContentCtrlpriceController extends BaseController {
     public ResponseEntity importFile(MultipartFile file, RedirectAttributes redirectAttributes) {
         ResponseEntity<WorkContentCtrlprice> responseEntity = new ResponseEntity<>();
 		try {
-			ImportExcel ei = new ImportExcel(file, 1, 0);
+			ImportExcel ei = new ImportExcel(file, 2, 0);
 			List<WorkContentCtrlprice> list = ei.getDataList(WorkContentCtrlprice.class);
 			List<WorkContentCtrlprice> listAll = new ArrayList<>();
 			for (WorkContentCtrlprice ctrlprice : list) {

+ 54 - 0
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -315,6 +315,7 @@
 		wct.name AS "workContractInfo.client.name",
 		o.top_company AS "office.name",
 		o.name AS "createByOffice",
+		(case when ifnull(prd.number ,'0') = '0' then 0 else 1 end) as reportDataFlag,
 		ifnull(prd.number ,"") as "projectReportNumber"
 		,ifnull(prd.status,0) as "projectReportStatus"
 		,ifnull(prd.name,"") as "projectReportName"
@@ -3803,4 +3804,57 @@
 	</insert>
 
 
+	<select id="getPaperArchiveProjectReportedList" resultType="com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords" >
+		SELECT
+		<include refid="projectRecordsColumns"/>
+		,date_add(date_format(prd.audit_pass_date, '%Y-%m-%d'),interval #{endingCount} day) as adventDate
+		,date_add(date_format(prd.audit_pass_date, '%Y-%m-%d'),interval #{endingCount} day) as adventDateDate
+		,a.project_type as "projectType"
+		FROM rural_project_records a
+		left join project_paper_filing ppf on ppf.project_id = a.id
+		left join work_contract_info wci on a.contract_id = wci.id
+		left join project_report_data_two prd on prd.project_id = a.id
+		left join rural_project_report_record prr on prr.report_id = prd.id
+		left join sys_user u on u.id = a.create_by
+		left join sys_office o on o.id = a.office_id
+		LEFT JOIN sys_area area ON area.id = a.area_id
+		LEFT JOIN work_project_user w1 on a.id = w1.project_id
+		left join sys_user su on su.id = w1.user_id
+		left join sys_office so on so.id = su.office_id
+		<where>
+			a.del_flag = 0
+			and a.submit_money = 2
+			and a.status = 5
+			and (ppf.status is null or ppf.status = 1)
+			and now() > date_add(prd.audit_pass_date,interval #{startCount} day)
+		</where>
+	</select>
+
+	<select id="getBatchArchiveProjectReportedList" resultType="com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords" >
+		SELECT
+		<include refid="projectRecordsColumns"/>
+		,date_add(date_format(prd.audit_pass_date, '%Y-%m-%d'),interval #{endingCount} day) as adventDate
+		,date_add(date_format(prd.audit_pass_date, '%Y-%m-%d'),interval #{endingCount} day) as adventDateDate
+		,a.project_type as "projectType"
+		FROM rural_project_records a
+		LEFT JOIN project_flingbatch_relation pfp on pfp.project_id=a.id
+		left join work_contract_info wci on a.contract_id = wci.id
+		left join project_report_data prd on prd.project_id = a.id
+		left join rural_project_report_record prr on prr.report_id = prd.id
+		left join sys_user u on u.id = a.create_by
+		left join sys_office o on o.id = a.office_id
+		LEFT JOIN sys_area area ON area.id = a.area_id
+		LEFT JOIN work_project_user w1 on a.id = w1.project_id
+		left join sys_user su on su.id = w1.user_id
+		left join sys_office so on so.id = su.office_id
+		<where>
+			a.del_flag = 0
+			AND a.STATUS = 5
+			AND prd.STATUS = 5
+			AND a.submit_money = 1
+			AND pfp.STATUS IS NULL
+			and now() > date_add(prd.audit_pass_date,interval #{startCount} day)
+		</where>
+	</select>
+
 </mapper>

BIN
src/main/webapp/dot/工程量清单、招标控制价审核表.xlsx


+ 10 - 0
src/main/webapp/static/oss/ossupload.js

@@ -62,6 +62,7 @@ function ftlUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPath,d
     fileName = fileName.replace(/%/g,"")
     fileName = fileName.replace(/Π/g,"")
     fileName = fileName.replace(/π/g,"")
+    fileName = fileName.replace(/·/g,".")
     var dfl=new File([file],fileName,{type:file.type});
     file = dfl
     /*console.log(file.name.indexOf("—")!=-1);
@@ -88,6 +89,7 @@ function multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,upload
     fileName = fileName.replace(/%/g,"")
     fileName = fileName.replace(/Π/g,"")
     fileName = fileName.replace(/π/g,"")
+    fileName = fileName.replace(/·/g,".")
     var dfl=new File([file],fileName,{type:file.type});
     file = dfl
     /*console.log(file.name.indexOf("—")!=-1);
@@ -120,6 +122,7 @@ function CollectUploadWithSts(storeAs, file,attachmentId,attachmentFlag,uploadPa
     fileName = fileName.replace(/%/g,"")
     fileName = fileName.replace(/Π/g,"")
     fileName = fileName.replace(/π/g,"")
+    fileName = fileName.replace(/·/g,".")
     var dfl=new File([file],fileName,{type:file.type});
     file = dfl
 
@@ -181,6 +184,7 @@ function multipartUploadWithStsOnProcessAccessory(storeAs, file,attachmentId,att
     fileName = fileName.replace(/%/g,"")
     fileName = fileName.replace(/Π/g,"")
     fileName = fileName.replace(/π/g,"")
+    fileName = fileName.replace(/·/g,".")
     var dfl=new File([file],fileName,{type:file.type});
     file = dfl
 
@@ -242,6 +246,7 @@ function multipartUploadWithSts(storeAs, file,attachmentId,attachmentFlag,upload
     fileName = fileName.replace(/%/g,"")
     fileName = fileName.replace(/Π/g,"")
     fileName = fileName.replace(/π/g,"")
+    fileName = fileName.replace(/·/g,".")
     var dfl=new File([file],fileName,{type:file.type});
     file = dfl
 
@@ -304,6 +309,7 @@ function multipartUploadWorkOrder(storeAs, file,attachmentId,attachmentFlag,uplo
     fileName = fileName.replace(/%/g,"")
     fileName = fileName.replace(/Π/g,"")
     fileName = fileName.replace(/π/g,"")
+    fileName = fileName.replace(/·/g,".")
     var dfl=new File([file],fileName,{type:file.type});
     file = dfl
 
@@ -549,6 +555,7 @@ function multipartUploadWithStsCollection(storeAs, file,attachmentId,attachmentF
     fileName = fileName.replace(/%/g,"")
     fileName = fileName.replace(/Π/g,"")
     fileName = fileName.replace(/π/g,"")
+    fileName = fileName.replace(/·/g,".")
     var dfl=new File([file],fileName,{type:file.type});
     file = dfl
 
@@ -613,6 +620,7 @@ function multipartUploadWithStsCollectionCollect(storeAs, file,attachmentId,atta
     fileName = fileName.replace(/%/g,"")
     fileName = fileName.replace(/Π/g,"")
     fileName = fileName.replace(/π/g,"")
+    fileName = fileName.replace(/·/g,".")
     var dfl=new File([file],fileName,{type:file.type});
     file = dfl
 
@@ -1469,6 +1477,7 @@ function multipartUploadWithStsRecordsReported(storeAs, file,attachmentId,attach
     fileName = fileName.replace(/%/g,"")
     fileName = fileName.replace(/Π/g,"")
     fileName = fileName.replace(/π/g,"")
+    fileName = fileName.replace(/·/g,".")
     var dfl=new File([file],fileName,{type:file.type});
     file = dfl
 
@@ -2077,6 +2086,7 @@ function fileCollectAccessory(storeAs, file,attachmentId,attachmentFlag,uploadPa
     fileName = fileName.replace(/%/g,"")
     fileName = fileName.replace(/Π/g,"")
     fileName = fileName.replace(/π/g,"")
+    fileName = fileName.replace(/·/g,".")
     var dfl=new File([file],fileName,{type:file.type});
     file = dfl
     requestUrl = realPath+"/previewController/getAccess";

+ 2 - 2
src/main/webapp/webpage/include/head.jsp

@@ -98,7 +98,7 @@
         {
              document.write('<script src="http://gosspublic.alicdn.com/aliyun-oss-sdk-4.4.4.min.js"><\/script>');
             document.write('<script src="${ctxStatic}/bos/node_modules/@baiducloud/sdk/dist/baidubce-sdk.bundle.min.js"><\/script>');
-            document.write('<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?9"><\/script>');
+            document.write('<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?10"><\/script>');
             /*document.write('<script type="text/javascript" src="${ctxStatic}/bos/bosupload.js"><\/script>');*/
         }
     }
@@ -106,7 +106,7 @@
     {
          document.write('<script src="http://gosspublic.alicdn.com/aliyun-oss-sdk-4.4.4.min.js"><\/script>');
         document.write('<script src="${ctxStatic}/bos/node_modules/@baiducloud/sdk/dist/baidubce-sdk.bundle.min.js"><\/script>');
-        document.write('<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?9"><\/script>');
+        document.write('<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?10"><\/script>');
         /*document.write('<script type="text/javascript" src="${ctxStatic}/bos/bosupload.js"><\/script>');*/
     }
 

+ 1 - 1
src/main/webapp/webpage/include/ossTools.jsp

@@ -9,4 +9,4 @@
 <script type="text/javascript" src="${ctxStatic}/oss/lib/plupload-2.3.6/plupload-2.3.6/js/jquery.plupload.queue/jquery.plupload.queue.js"></script>
 <script type="text/javascript" src="${ctxStatic}/oss/lib/plupload-2.3.6/plupload-2.3.6/js/plupload.dev.js"></script>
 <script type="text/javascript" src="${ctxStatic}/oss/upload.js"></script>
-<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?9"></script>
+<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?10"></script>

+ 1 - 1
src/main/webapp/webpage/modules/projectcontentinfo/achievementFileDataForm.jsp

@@ -6,7 +6,7 @@
 	<meta name="decorator" content="default"/>
 	<link href="${ctxStatic}/bootstrap-select-1.12.4/css/bootstrap-select.min.css" rel="stylesheet" />
 	<script src="${ctxStatic}/bootstrap-select-1.12.4/js/bootstrap-select.min.js"></script>
-	<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?9"></script>
+	<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?10"></script>
 	<style>
 		label.error{
 			top:40px;

+ 1 - 1
src/main/webapp/webpage/modules/projectcontentinfo/basedDataForm.jsp

@@ -6,7 +6,7 @@
 	<meta name="decorator" content="default"/>
 	<link href="${ctxStatic}/bootstrap-select-1.12.4/css/bootstrap-select.min.css" rel="stylesheet" />
 	<script src="${ctxStatic}/bootstrap-select-1.12.4/js/bootstrap-select.min.js"></script>
-	<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?9"></script>
+	<script type="text/javascript" src="${ctxStatic}/oss/ossupload.js?10"></script>
 	<style>
 		label.error{
 			top:40px;