Pārlūkot izejas kodu

报表部分功能

user5 3 gadi atpakaļ
vecāks
revīzija
89b0ffc8bf

+ 4 - 7
src/main/java/com/jeeplus/modules/statement/controller/StatementCompanyComprehensiveController.java

@@ -488,13 +488,10 @@ public class StatementCompanyComprehensiveController extends BaseController {
 
         //判断并只显示七个部门的项目信息
         String sevenOfficeId = statementCompanyComprehensiveService.selectSevenOfficeId();
-        List<StatementCompanyComprehensiveInfo> list = stringListMap.get("reportFormList1");
-        for(int i = 0;i<list.size();i++){
-            if(sevenOfficeId.contains(list.get(i).getOfficeId())){
-                model.addAttribute("showFlag","1");
-            }else {
-                model.addAttribute("showFlag","0");
-            }
+        if(sevenOfficeId.contains(officeId)){
+            model.addAttribute("showFlag","1");
+        }else {
+            model.addAttribute("showFlag","0");
         }
 
         return "modules/statement/departmentCompanyDataView";

+ 2 - 2
src/main/java/com/jeeplus/modules/statement/dao/StatementCompanyComprehensiveDao.java

@@ -201,7 +201,7 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
      * 超期、未超期数据删除
      * @param statementDataInfoList
      */
-    void deleteStatementDataInfo(@Param("dataList")List<StatementDataInfo> statementDataInfoList);
+    void deleteStatementDataInfo(StatementDataInfo statementDataInfoList);
 
     /**
      * 查询公司级需要通知的人员信息
@@ -299,7 +299,7 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
      * 部门级超期、未超期数据删除
      * @param statementDataInfoList
      */
-    void deleteOfficeStatementDataInfo(@Param("dataList")List<StatementDataInfo> statementDataInfoList);
+    void deleteOfficeStatementDataInfo(StatementDataInfo statementDataInfoList);
 
     /**
      * 部门级查询发票信息数量

+ 98 - 74
src/main/java/com/jeeplus/modules/statement/service/StatementCompanyComprehensiveService.java

@@ -7,6 +7,7 @@ import com.jeeplus.modules.statement.entity.StatementCompanyComprehensiveInfo;
 import com.jeeplus.modules.statement.entity.StatementDataInfo;
 import com.jeeplus.modules.sys.entity.Office;
 import com.jeeplus.modules.sys.entity.User;
+import com.jeeplus.modules.sys.utils.UserUtils;
 import com.jeeplus.modules.workprojectnotify.service.WorkProjectNotifyService;
 import com.jeeplus.modules.workprojectnotify.util.UtilNotify;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -178,27 +179,29 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
      * @param bigDateType 状态1(0:年;1:季度;2:月份)
      * @param smallDateType 状态2(针对状态1进行精确所在指定季度或者月份)
      */
-    public void disposeStatementCompany(Integer bigDateType,Integer smallDateType){
+    public void disposeStatementCompany(Integer year,Integer bigDateType,Integer smallDateType){
         Calendar cal = Calendar.getInstance();
         //获取当前年份
-        int year = cal.get(Calendar.YEAR);
+        if(null == year){
+            year = cal.get(Calendar.YEAR);
+        }
 
-        Map<String, String> dateMap = getDate(bigDateType, smallDateType);
+        Map<String, String> dateMap = getDateNew(bigDateType, smallDateType, year);
         //开始时间
         String beginDate = dateMap.get("beginDate");
         //结束时间
         String endDate = dateMap.get("endDate");
         String statementDate = dateMap.get("statementDate");
         //公司级项目处理
-        disposeStatementCompanyProject(beginDate,endDate,statementDate,bigDateType, smallDateType);
+        disposeStatementCompanyProject(year,beginDate,endDate,statementDate,bigDateType, smallDateType);
         //查询部门信息
         List<Office> officeList = dao.getAllOfficeListInfo();
         //公司级开票处理
-        disposeStatementCompanyInvoice(beginDate,endDate,statementDate,bigDateType, smallDateType,officeList);
+        disposeStatementCompanyInvoice(year,beginDate,endDate,statementDate,bigDateType, smallDateType,officeList);
         //公司级报销处理
-        disposeStatementCompanyReimbursement(beginDate,endDate,statementDate,bigDateType, smallDateType,officeList);
+        disposeStatementCompanyReimbursement(year,beginDate,endDate,statementDate,bigDateType, smallDateType,officeList);
         //公司级合同处理
-        disposeStatementCompanyContract(beginDate,endDate,statementDate,bigDateType, smallDateType,officeList);
+        disposeStatementCompanyContract(year,beginDate,endDate,statementDate,bigDateType, smallDateType,officeList);
 
         //创建utilNotifyId参数
         //参数是由 year、bigDateType、smallDateType参数设定
@@ -257,23 +260,42 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
      * @param utilNotifyId
      */
     public void officeNotification(String statementDate,String type,String notificationType,String utilNotifyId){
-        String notifyStr = statementDate + "-部门级 " + type + "报";
-        String titleStr = statementDate + "-部门级 " + type + "报";
 
         //查询公司级需要通知的人员信息
-        List<User> statementCompanyNotificationUserList = dao.getStatementCompanyNotificationUserList();
-        for (User user: statementCompanyNotificationUserList) {
-            workProjectNotifyService
-                    .save(UtilNotify.saveNotify(utilNotifyId,
-                            user,
-                            user.getCompany().getId(),
-                            titleStr,
-                            notifyStr,
-                            notificationType,
-                            "0",
-                            "待通知",
-                            ""));
+        //List<User> statementCompanyNotificationUserList = dao.getStatementCompanyNotificationUserList();
+
+
+        //查询部门信息
+        List<Office> officeList = dao.getAllOfficeListInfo();
+        for (Office office: officeList) {
+            String newUtilNotifyId = utilNotifyId + "," + office.getId();
+            List<User> users = UserUtils.getByRoleActivityEnname("bmzr",2,office.getId(),"ffe5af5b557e46f28b000c94716e228a","8");
+
+            String notifyStr = statementDate + office.getName() + "-部门级 " + type + "报";
+            String titleStr = statementDate + office.getName() + "-部门级 " + type + "报";
+
+            //如果是工程五部,则将信息发送给杨总
+            if("ee4e055e2f074aef934d283880983a38".equals(office.getId())){
+                User user = UserUtils.getByUserName("杨荣华");
+                users = Lists.newArrayList();
+                users.add(user);
+            }
+            for (User user: users) {
+                user = UserUtils.get(user.getId());
+                workProjectNotifyService
+                        .save(UtilNotify.saveNotify(newUtilNotifyId,
+                                user,
+                                user.getCompany().getId(),
+                                titleStr,
+                                notifyStr,
+                                notificationType,
+                                "0",
+                                "待通知",
+                                ""));
+            }
         }
+
+
     }
 
     /**
@@ -285,10 +307,7 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
      * @param smallDateType 状态2(针对状态1进行精确所在指定季度或者月份)
      */
     @Transactional(readOnly = false)
-    public void disposeStatementCompanyProject(String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType){
-        Calendar cal = Calendar.getInstance();
-        //获取当前年份
-        int year = cal.get(Calendar.YEAR);
+    public void disposeStatementCompanyProject(Integer year,String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType){
         StatementCompanyComprehensiveInfo comprehensiveInfo = new StatementCompanyComprehensiveInfo();
         comprehensiveInfo.setType("1");
         comprehensiveInfo.setYear(String.valueOf(year));
@@ -329,7 +348,9 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
             }
             if(overDueNotRecordProjectList.size()>0){
                 //每次删除之前存的数据
-                dao.deleteStatementDataInfo(overDueNotRecordProjectList);
+                for (StatementDataInfo statementDataInfo: overDueNotRecordProjectList) {
+                    dao.deleteStatementDataInfo(statementDataInfo);
+                }
                 dao.insertStatementDataInfo(overDueNotRecordProjectList);
             }
             //查询电子归档超期归档项目数量(保存到数据库)
@@ -350,7 +371,9 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
             }
             if(overDueRecordProjectList.size()>0){
                 //每次删除之前存的数据
-                dao.deleteStatementDataInfo(overDueRecordProjectList);
+                for (StatementDataInfo statementDataInfo: overDueRecordProjectList) {
+                    dao.deleteStatementDataInfo(statementDataInfo);
+                }
                 dao.insertStatementDataInfo(overDueRecordProjectList);
             }
             //查询上报超期未上报项目数量(保存到数据库)
@@ -371,7 +394,9 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
             }
             if(overDueNotReportedProjectList.size()>0){
                 //每次删除之前存的数据
-                dao.deleteStatementDataInfo(overDueNotReportedProjectList);
+                for (StatementDataInfo statementDataInfo: overDueNotReportedProjectList) {
+                    dao.deleteStatementDataInfo(statementDataInfo);
+                }
                 dao.insertStatementDataInfo(overDueNotReportedProjectList);
             }
             //查询上报超期上报项目数量(保存到数据库)
@@ -392,7 +417,9 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
             }
             if(overDueReportedProjectList.size()>0){
                 //每次删除之前存的数据
-                dao.deleteStatementDataInfo(overDueReportedProjectList);
+                for (StatementDataInfo statementDataInfo: overDueReportedProjectList) {
+                    dao.deleteStatementDataInfo(statementDataInfo);
+                }
                 dao.insertStatementDataInfo(overDueReportedProjectList);
             }
 
@@ -414,10 +441,7 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
      * @param officeList 部门信息
      */
     @Transactional(readOnly = false)
-    public void disposeStatementCompanyInvoice(String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType,List<Office> officeList){
-        Calendar cal = Calendar.getInstance();
-        //获取当前年份
-        int year = cal.get(Calendar.YEAR);
+    public void disposeStatementCompanyInvoice(Integer year,String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType,List<Office> officeList){
         StatementCompanyComprehensiveInfo comprehensiveInfo = new StatementCompanyComprehensiveInfo();
         comprehensiveInfo.setType("2");
         comprehensiveInfo.setYear(String.valueOf(year));
@@ -455,10 +479,7 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
      * @param endDate 结束时间
      */
     @Transactional(readOnly = false)
-    public void disposeStatementCompanyReimbursement(String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType,List<Office> officeList){
-        Calendar cal = Calendar.getInstance();
-        //获取当前年份
-        int year = cal.get(Calendar.YEAR);
+    public void disposeStatementCompanyReimbursement(Integer year,String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType,List<Office> officeList){
         StatementCompanyComprehensiveInfo comprehensiveInfo = new StatementCompanyComprehensiveInfo();
         comprehensiveInfo.setType("3");
         comprehensiveInfo.setYear(String.valueOf(year));
@@ -488,10 +509,7 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
      * @param endDate 结束时间
      */
     @Transactional(readOnly = false)
-    public void disposeStatementCompanyContract(String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType,List<Office> officeList){
-        Calendar cal = Calendar.getInstance();
-        //获取当前年份
-        int year = cal.get(Calendar.YEAR);
+    public void disposeStatementCompanyContract(Integer year,String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType,List<Office> officeList){
         StatementCompanyComprehensiveInfo comprehensiveInfo = new StatementCompanyComprehensiveInfo();
         comprehensiveInfo.setType("4");
         comprehensiveInfo.setYear(String.valueOf(year));
@@ -525,7 +543,9 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
             }
             if(overDueNotContractList.size()>0){
                 //每次删除之前存的数据
-                dao.deleteStatementDataInfo(overDueNotContractList);
+                for (StatementDataInfo statementDataInfo: overDueNotContractList) {
+                    dao.deleteStatementDataInfo(statementDataInfo);
+                }
                 dao.insertStatementDataInfo(overDueNotContractList);
             }
 
@@ -547,7 +567,9 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
             }
             if(overDueContractList.size()>0){
                 //每次删除之前存的数据
-                dao.deleteStatementDataInfo(overDueContractList);
+                for (StatementDataInfo statementDataInfo: overDueContractList) {
+                    dao.deleteStatementDataInfo(statementDataInfo);
+                }
                 dao.insertStatementDataInfo(overDueContractList);
             }
 
@@ -722,33 +744,35 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
      * @param bigDateType 状态1(0:年;1:季度;2:月份)
      * @param smallDateType 状态2(针对状态1进行精确所在指定季度或者月份)
      */
-    public void disposeStatementOffice(Integer bigDateType,Integer smallDateType){
+    public void disposeStatementOffice(Integer year,Integer bigDateType,Integer smallDateType){
         Calendar cal = Calendar.getInstance();
         //获取当前年份
-        int year = cal.get(Calendar.YEAR);
+        if(null == year){
+            year = cal.get(Calendar.YEAR);
+        }
 
-        Map<String, String> dateMap = getDate(bigDateType, smallDateType);
+        Map<String, String> dateMap = getDateNew(bigDateType, smallDateType,year);
         //开始时间
         String beginDate = dateMap.get("beginDate");
         //结束时间
         String endDate = dateMap.get("endDate");
         String statementDate = dateMap.get("statementDate");
         //部门级项目处理
-        disposeStatementOfficeProject(beginDate,endDate,statementDate,bigDateType, smallDateType);
+        disposeStatementOfficeProject(year,beginDate,endDate,statementDate,bigDateType, smallDateType);
         //查询部门信息
         List<Office> officeList = dao.getAllOfficeListInfo();
         //部门级开票处理
-        disposeStatementOfficeInvoice(beginDate,endDate,statementDate,bigDateType, smallDateType,officeList);
+        disposeStatementOfficeInvoice(year,beginDate,endDate,statementDate,bigDateType, smallDateType,officeList);
         //部门级报销处理
-        disposeStatementOfficeReimbursement(beginDate,endDate,statementDate,bigDateType, smallDateType,officeList);
+        disposeStatementOfficeReimbursement(year,beginDate,endDate,statementDate,bigDateType, smallDateType,officeList);
         //部门级合同处理
-        disposeStatementOfficeContract(beginDate,endDate,statementDate,bigDateType, smallDateType,officeList);
+        disposeStatementOfficeContract(year,beginDate,endDate,statementDate,bigDateType, smallDateType,officeList);
 
         //创建utilNotifyId参数
         //参数是由 year、bigDateType、smallDateType参数设定
         String utilNotifyId = year + "," + bigDateType + "," + smallDateType;
         //发送通知
-        /*switch (bigDateType){
+        switch (bigDateType){
             //年度汇总
             case 0:
                 officeNotification(statementDate,"年","164",utilNotifyId);
@@ -763,7 +787,7 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                 //smallDateType  为月度时候
                 officeNotification(statementDate,"月","166",utilNotifyId);
                 break;
-        }*/
+        }
     }
 
     /**
@@ -775,10 +799,7 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
      * @param smallDateType 状态2(针对状态1进行精确所在指定季度或者月份)
      */
     @Transactional(readOnly = false)
-    public void disposeStatementOfficeProject(String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType){
-        Calendar cal = Calendar.getInstance();
-        //获取当前年份
-        int year = cal.get(Calendar.YEAR);
+    public void disposeStatementOfficeProject(Integer year,String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType){
         //查询部门信息
         List<Office> officeList = dao.getOfficeListInfo();
         for (Office officeInfo : officeList) {
@@ -830,7 +851,9 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                     }
                     if(overDueNotRecordProjectList.size()>0){
                         //每次删除之前的数据
-                        dao.deleteOfficeStatementDataInfo(overDueNotRecordProjectList);
+                        for (StatementDataInfo statementDataInfo : overDueNotRecordProjectList) {
+                            dao.deleteOfficeStatementDataInfo(statementDataInfo);
+                        }
                         dao.insertOfficeStatementDataInfo(overDueNotRecordProjectList);
                     }
                     //查询电子归档超期归档项目数量(保存到数据库)
@@ -853,7 +876,9 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                     }
                     if(overDueRecordProjectList.size()>0){
                         //每次删除之前的数据
-                        dao.deleteOfficeStatementDataInfo(overDueRecordProjectList);
+                        for (StatementDataInfo statementDataInfo : overDueRecordProjectList) {
+                            dao.deleteOfficeStatementDataInfo(statementDataInfo);
+                        }
                         dao.insertOfficeStatementDataInfo(overDueRecordProjectList);
                     }
                     //查询上报超期未上报项目数量(保存到数据库)
@@ -876,7 +901,9 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                     }
                     if(overDueNotReportedProjectList.size()>0){
                         //每次删除之前的数据
-                        dao.deleteOfficeStatementDataInfo(overDueNotReportedProjectList);
+                        for (StatementDataInfo statementDataInfo : overDueNotReportedProjectList) {
+                            dao.deleteOfficeStatementDataInfo(statementDataInfo);
+                        }
                         dao.insertOfficeStatementDataInfo(overDueNotReportedProjectList);
                     }
                     //查询上报超期上报项目数量(保存到数据库)
@@ -899,7 +926,9 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                     }
                     if(overDueReportedProjectList.size()>0){
                         //每次删除之前的数据
-                        dao.deleteOfficeStatementDataInfo(overDueReportedProjectList);
+                        for (StatementDataInfo statementDataInfo : overDueReportedProjectList) {
+                            dao.deleteOfficeStatementDataInfo(statementDataInfo);
+                        }
                         dao.insertOfficeStatementDataInfo(overDueReportedProjectList);
                     }
                     //数据处理并保存到数据库中
@@ -922,10 +951,7 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
      * @param officeList 部门信息
      */
     @Transactional(readOnly = false)
-    public void disposeStatementOfficeInvoice(String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType,List<Office> officeList){
-        Calendar cal = Calendar.getInstance();
-        //获取当前年份
-        int year = cal.get(Calendar.YEAR);
+    public void disposeStatementOfficeInvoice(Integer year,String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType,List<Office> officeList){
 
         for (Office officeInfo : officeList) {
             //查询该部门的所有子部门
@@ -975,10 +1001,7 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
      * @param endDate 结束时间
      */
     @Transactional(readOnly = false)
-    public void disposeStatementOfficeReimbursement(String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType,List<Office> officeList){
-        Calendar cal = Calendar.getInstance();
-        //获取当前年份
-        int year = cal.get(Calendar.YEAR);
+    public void disposeStatementOfficeReimbursement(Integer year,String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType,List<Office> officeList){
 
         for (Office officeInfo : officeList) {
             //查询该部门的所有子部门
@@ -1020,10 +1043,7 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
      * @param endDate 结束时间
      */
     @Transactional(readOnly = false)
-    public void disposeStatementOfficeContract(String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType,List<Office> officeList){
-        Calendar cal = Calendar.getInstance();
-        //获取当前年份
-        int year = cal.get(Calendar.YEAR);
+    public void disposeStatementOfficeContract(Integer year,String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType,List<Office> officeList){
 
         for (Office officeInfo : officeList) {//查询该部门的所有子部门
             List<Office> childOfficeList = dao.getChildOfficeList(officeInfo.getId());
@@ -1067,7 +1087,9 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                     }
                     if(overDueNotContractList.size()>0){
                         //每次删除之前的数据
-                        dao.deleteOfficeStatementDataInfo(overDueNotContractList);
+                        for (StatementDataInfo statementDataInfo : overDueNotContractList) {
+                            dao.deleteOfficeStatementDataInfo(statementDataInfo);
+                        }
                         dao.insertOfficeStatementDataInfo(overDueNotContractList);
                     }
 
@@ -1091,7 +1113,9 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                     }
                     if(overDueContractList.size()>0){
                         //每次删除之前的数据
-                        dao.deleteOfficeStatementDataInfo(overDueContractList);
+                        for (StatementDataInfo statementDataInfo : overDueContractList) {
+                            dao.deleteOfficeStatementDataInfo(statementDataInfo);
+                        }
                         dao.insertOfficeStatementDataInfo(overDueContractList);
                     }
 

+ 17 - 10
src/main/java/com/jeeplus/modules/workcalendar/service/WorkCalendarTaskService.java

@@ -147,10 +147,11 @@ public class WorkCalendarTaskService  {
      */
     //每个月最后一天晚上23点推送
     //@Scheduled(cron= "0 0 23 28-31 * ?")
-    //@Scheduled(cron= "0 0/2 * * * ?")
+    @Scheduled(cron= "0 0/2 * * * ?")
     @Transactional(readOnly = false)
     public void getStatementCompanyComprehensiveOnMonth() {
         final Calendar c = Calendar.getInstance();
+        Integer year = c.get(Calendar.YEAR);
         System.out.println(c.get(Calendar.DATE));
         System.out.println(c.getActualMaximum(Calendar.DATE));
         //if (c.get(Calendar.DATE) == c.getActualMaximum(Calendar.DATE)){
@@ -158,10 +159,10 @@ public class WorkCalendarTaskService  {
             Integer month = c.get(Calendar.MONTH)+1; //第一个月从0开始,所以得到月份+1
             //当月最后一天
             logger.info("-----------公司级—月度报表(开始)------------------");
-            statementCompanyComprehensiveService.disposeStatementCompany(2,month);
+            statementCompanyComprehensiveService.disposeStatementCompany(2021,2,12);
             logger.info("------------公司级—月度报表(结束)------------------");
             logger.info("-----------部门级—月度报表(开始)------------------");
-            //statementCompanyComprehensiveService.disposeStatementOffice(2,month);
+            statementCompanyComprehensiveService.disposeStatementOffice(2021,2,12);
             logger.info("------------部门级—月度报表(结束)------------------");
         //}
 
@@ -172,20 +173,22 @@ public class WorkCalendarTaskService  {
      */
     //每个季度最后一天晚上23点推送
     //@Scheduled(cron= "0 0 23 28-31 3,6,9,12 ?")
-    //@Scheduled(cron= "0 0/2 * * * ?")
+    @Scheduled(cron= "0 0/2 * * * ?")
+    @Transactional(readOnly = false)
     public void getStatementCompanyComprehensiveOnQuarter() {
         final Calendar c = Calendar.getInstance();
+        Integer year = c.get(Calendar.YEAR);
         Integer month = c.get(Calendar.MONTH)+3; //第一个月从0开始,所以得到月份+1
         Integer quarter = month/3;
-        if (c.get(Calendar.DATE) == c.getActualMaximum(Calendar.DATE)){
+        //if (c.get(Calendar.DATE) == c.getActualMaximum(Calendar.DATE)){
             //当月最后一天
             logger.info("-----------公司级—季度报表(开始)------------------");
-            statementCompanyComprehensiveService.disposeStatementCompany(1,quarter);
+            statementCompanyComprehensiveService.disposeStatementCompany(2021,1,4);
             logger.info("------------公司级—季度报表(结束)------------------");
             logger.info("-----------部门级—季度报表(开始)------------------");
-            //projectRecordsService.saveProjectRecordListByAdvent();
+            statementCompanyComprehensiveService.disposeStatementOffice(2021,1,4);
             logger.info("------------部门级—季度报表(结束)------------------");
-        }
+        //}
     }
 
     /**
@@ -193,12 +196,16 @@ public class WorkCalendarTaskService  {
      */
     //每年最后一天晚上23点推送
     //@Scheduled(cron= "0 0 23 31 12 ?")
+    @Scheduled(cron= "0 0/2 * * * ?")
+    @Transactional(readOnly = false)
     public void getStatementCompanyComprehensiveOnYear() {
+        final Calendar c = Calendar.getInstance();
+        Integer year = c.get(Calendar.YEAR);
         logger.info("-----------公司级—年度报表(开始)------------------");
-        statementCompanyComprehensiveService.disposeStatementCompany(0,0);
+        statementCompanyComprehensiveService.disposeStatementCompany(2021,0,0);
         logger.info("------------公司级—年度报表(结束)------------------");
         logger.info("-----------部门级—年度报表(开始)------------------");
-        //projectRecordsService.saveProjectRecordListByAdvent();
+        statementCompanyComprehensiveService.disposeStatementOffice(2021,0,0);
         logger.info("------------部门级—年度报表(结束)------------------");
     }
 

+ 43 - 0
src/main/java/com/jeeplus/modules/workprojectnotify/web/WorkProjectNotifyController.java

@@ -6970,6 +6970,49 @@ public class WorkProjectNotifyController extends BaseController {
 					if (workProjectNotify.getRemarks().contains("待通知") || "view".equals(workProjectNotify.getView())) {
 						return "modules/statement/companyDataView";
 					}
+				}else if ("164".equals(workProjectNotify.getType())
+						|| "165".equals(workProjectNotify.getType())
+						|| "166".equals(workProjectNotify.getType())) {//公司级报表展示操作
+					switch (workProjectNotify.getType()){
+						case "164":	//年报
+							model.addAttribute("nyr", "年");
+							break;
+						case "165":	//季报
+							model.addAttribute("nyr", "季");
+							break;
+						case "166":	//月报
+							model.addAttribute("nyr", "月");
+							break;
+
+					}
+
+					String[] arguments = workProjectNotify.getNotifyId().split(",");
+					//获取年份
+					String year = arguments[0];
+					//获取状态1(0:年;1:季度;2:月份)
+					String bigDateType = arguments[1];
+					//获取状态2(针对状态1进行精确所在指定季度或者月份)
+					String smallDateType = arguments[2];
+					//获取officeId
+					String officeId = arguments[3];
+
+
+					Map<String, List<StatementCompanyComprehensiveInfo>> stringListMap = statementCompanyComprehensiveService.departmentViewList(year,bigDateType,smallDateType,officeId);
+					model.addAttribute("reportFormList1",stringListMap.get("reportFormList1"));//项目报表
+					model.addAttribute("reportFormList2",stringListMap.get("reportFormList2"));//开票报表
+					model.addAttribute("reportFormList3",stringListMap.get("reportFormList3"));//报销报表
+					model.addAttribute("reportFormList4",stringListMap.get("reportFormList4"));//合同报表
+					//判断并只显示七个部门的项目信息
+					String sevenOfficeId = statementCompanyComprehensiveService.selectSevenOfficeId();
+
+					if(sevenOfficeId.contains(officeId)){
+						model.addAttribute("showFlag","1");
+					}else {
+						model.addAttribute("showFlag","0");
+					}
+					if (workProjectNotify.getRemarks().contains("待通知") || "view".equals(workProjectNotify.getView())) {
+						return "modules/statement/departmentCompanyDataView";
+					}
 				}
 			}
 		}

+ 27 - 26
src/main/resources/mappings/modules/statement/StatementCompanyComprehensiveDao.xml

@@ -103,7 +103,7 @@
 
 		)
 	</insert>
-	
+
 	<delete id="delete">
 		delete from statement_company_comprehensive_info
 		where type = #{type}
@@ -151,6 +151,7 @@
 		select a.id,a.name from sys_office a
 		<where>
 			a.parent_id = 'ffe5af5b557e46f28b000c94716e228a'
+			and a.del_flag = 0
 		</where>
 		ORDER BY a.code
 	</select>
@@ -326,12 +327,13 @@
 
 	<select id="getInsertContractCountByOffice" resultType="java.lang.Integer">
 		select count(1) from work_contract_info a
+		left join work_contract_record wcr on wcr.contract_info_id = a.id
 		<where>
 			and a.del_flag=0
 			and a.contract_state = 5
 			and a.office_id in(select id  from sys_office where id = #{officeId} or parent_ids like concat('%',#{officeId},'%'))
-			and a.accomplish_date >= #{beginDate}
-			and a.accomplish_date &lt;= #{endDate}
+			and wcr.accomplish_date >= #{beginDate}
+			and wcr.accomplish_date &lt;= #{endDate}
 		</where>
 	</select>
 
@@ -353,7 +355,7 @@
 		<where>
 			and a.del_flag=0
 			and a.contract_state = 5
-			and a.contract_record_state = 6
+			and a.contract_record_state != 7
 			and a.over_due_status = 1
 			and a.office_id in(select id  from sys_office where id = #{officeId} or parent_ids like concat('%',#{officeId},'%'))
 		</where>
@@ -361,14 +363,15 @@
 
 	<select id="getOverDueContractRecordCountByOffice" resultType="java.lang.String">
 		select a.id from work_contract_info a
+		left join work_contract_record wcr on wcr.contract_info_id = a.id
 		<where>
 			and a.del_flag=0
 			and a.contract_state = 5
 			and a.contract_record_state = 7
 			and a.over_due_status = 1
 			and a.office_id in(select id  from sys_office where id = #{officeId} or parent_ids like concat('%',#{officeId},'%'))
-			and a.accomplish_date >= #{beginDate}
-			and a.accomplish_date &lt;= #{endDate}
+			and wcr.accomplish_date >= #{beginDate}
+			and wcr.accomplish_date &lt;= #{endDate}
 		</where>
 	</select>
 
@@ -410,13 +413,11 @@
 	<delete id="deleteStatementDataInfo">
 		delete from statement_data_info
 		<where >
-		      <foreach collection="dataList" item="data" separator=",">
-				  type = #{data.type}
-				  and year = #{data.year}
-				  and big_date_type = #{data.bigDateType}
-				  and small_date_type = #{data.smallDateType}
-				  and office_id = #{data.officeId}
-				</foreach>
+			type = #{type}
+			and year = #{year}
+			and big_date_type = #{bigDateType}
+			and small_date_type = #{smallDateType}
+			and office_id = #{officeId}
 		</where>
 	</delete>
 
@@ -622,14 +623,12 @@
 	<delete id="deleteOfficeStatementDataInfo">
 		delete from statement_office_data_info
 		<where>
-			<foreach collection="dataList" item="data" separator=",">
-				type = #{data.type}
-				and year = #{data.year}
-				and big_date_type = #{data.bigDateType}
-				and small_date_type = #{data.smallDateType}
-				and office_id = #{data.officeId}
-				and user_id = #{data.userId}
-			</foreach>
+			type = #{type}
+			and year = #{year}
+			and big_date_type = #{bigDateType}
+			and small_date_type = #{smallDateType}
+			and office_id = #{officeId}
+			and user_id = #{userId}
 		</where>
 	</delete>
 
@@ -718,14 +717,15 @@
 
 	<select id="getInsertOfficeContractRecordCountByOffice" resultType="java.lang.Integer">
 		select count(1) from work_contract_info a
+		left join work_contract_record wcr on wcr.contract_info_id = a.id
 		<where>
 			and a.del_flag=0
 			and a.contract_state = 5
 			and a.contract_record_state = 5
 			and a.over_due_status = 0
 			and a.create_by = #{userId}
-			and a.accomplish_date >= #{beginDate}
-			and a.accomplish_date &lt;= #{endDate}
+			and awcr.accomplish_date >= #{beginDate}
+			and awcr.accomplish_date &lt;= #{endDate}
 		</where>
 	</select>
 
@@ -734,7 +734,7 @@
 		<where>
 			and a.del_flag=0
 			and a.contract_state = 5
-			and a.contract_record_state = 6
+			and a.contract_record_state != 7
 			and a.over_due_status = 1
 			and a.create_by = #{userId}
 		</where>
@@ -742,14 +742,15 @@
 
 	<select id="getOfficeOverDueContractRecordCountByOffice" resultType="java.lang.String">
 		select a.id from work_contract_info a
+		left join work_contract_record wcr on wcr.contract_info_id = a.id
 		<where>
 			and a.del_flag=0
 			and a.contract_state = 5
 			and a.contract_record_state = 7
 			and a.over_due_status = 1
 			and a.create_by = #{userId}
-			and a.accomplish_date >= #{beginDate}
-			and a.accomplish_date &lt;= #{endDate}
+			and wcr.accomplish_date >= #{beginDate}
+			and wcr.accomplish_date &lt;= #{endDate}
 		</where>
 	</select>