فهرست منبع

Merge remote-tracking branch 'origin/master'

[user3] 3 سال پیش
والد
کامیت
fd7a23c809

+ 2 - 2
src/main/java/com/jeeplus/modules/ruralprojectrecords/entity/RuralProjectRecords.java

@@ -1810,7 +1810,7 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 		this.projectMasterOffice = projectMasterOffice;
 	}
 
-	@ExcelField(title="项目汇总开票金额", align=2, sort=17)
+	//@ExcelField(title="项目汇总开票金额", align=2, sort=17)
 	public String getProjectinvoiceMoney() {
 		return projectinvoiceMoney;
 	}
@@ -1888,7 +1888,7 @@ public class RuralProjectRecords extends ActEntity<RuralProjectRecords> {
 	public void setCompletionStatus(String completionStatus) {
 		this.completionStatus = completionStatus;
 	}
-	@ExcelField(title="咨询营业收入(万元)", align=2, sort=20)
+	//@ExcelField(title="咨询营业收入(万元)", align=2, sort=20)
 	public String getMoney() {
 		return money;
 	}

+ 39 - 1
src/main/java/com/jeeplus/modules/ruralprojectrecords/service/RuralProjectRecordsService.java

@@ -338,6 +338,44 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 		return page;
 	}
 
+	public Page<RuralProjectRecords> findPageExport(Page<RuralProjectRecords> page, RuralProjectRecords projectRecords) {
+		//设置数据权限
+        if(!UserUtils.getUser().isAdmin()) {
+			String dataScopeSql = null;
+			//判断查询为工程咨询信息
+			if("1".equals(projectRecords.getProjectType())){
+				dataScopeSql = dataScopeFilterOR(projectRecords.getCurrentUser(), "o", "u", "s", MenuStatusEnum.OVERALL_WORK_RECORDS.getValue());
+			} else if("2".equals(projectRecords.getProjectType())){//判断查询为造价审核信息
+				dataScopeSql = dataScopeFilterOR(projectRecords.getCurrentUser(), "o", "u", "s", MenuStatusEnum.OVERALL_COST_WORK_RECORDS.getValue());
+			}else{
+				dataScopeSql = dataScopeFilterOR(projectRecords.getCurrentUser(), "o", "u", "s", MenuStatusEnum.OVERALL_WORK_RECORDS.getValue());
+			}
+            projectRecords.getSqlMap().put("dsf", dataScopeSql);
+			projectRecords.getSqlMap().put("delFlag", "AND a.del_flag = 0");
+        }
+        if(null!= projectRecords.getOffice() && StringUtils.isNotBlank(projectRecords.getOffice().getId())){
+        	//查询该选择节点下所有的部门Id
+			List<String> officeIdList = officeService.getChildrenOffice(projectRecords.getOffice().getId());
+			officeIdList.add(projectRecords.getOffice().getId());
+			projectRecords.setOfficeIdList(officeIdList);
+		}
+        int count = dao.queryCount(projectRecords);
+        page.setCount(count);
+        page.setCountFlag(false);
+        projectRecords.setPage(page);
+		List<RuralProjectRecords> recordsList = findList(projectRecords);
+		//查询负责人信息
+		/*for (RuralProjectRecords records : recordsList) {
+			this.queryContractInfos(records);
+			List<User> users = workProjectUserDao.queryProjectUsers(records.getId(), "1");
+			records.setProjectLeaders(users);
+			records.setLeaderNameStr(Collections3.extractToString(users, "name", ","));
+			records.setLeaderIds(Collections3.extractToString(users, "id", ","));
+		}*/
+		page.setList(recordsList);
+		return page;
+	}
+
 	/**
 	 * 项目计划查询数据信息
 	 * @param page
@@ -2937,7 +2975,7 @@ public class RuralProjectRecordsService extends CrudService<RuralProjectRecordsD
 	/**
 	 * 根据报告号查询项目信息
 	 * @param dataList
-	 * @return
+	 * @returndataMessageDispose
 	 */
 	public Map<String, List<ProjectFilingBatchImportInfo>> dataMessageDispose(List<ProjectFilingBatchImportInfo> dataList) {
 		//所有有效数据均添加到list中,下边将list中的数据根据店号和收银员的id进行分割处理

+ 1 - 1
src/main/java/com/jeeplus/modules/ruralprojectrecords/web/RuralCostProjectRecordsController.java

@@ -596,7 +596,7 @@ public class RuralCostProjectRecordsController extends BaseController {
 			//添加查询类型(造价审核)
 			projectRecords.setProjectType("2");
             String fileName = "项目"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
-            Page<RuralProjectRecords> page = projectRecordsService.findPage(new Page<RuralProjectRecords>(request, response, -1), projectRecords);
+            Page<RuralProjectRecords> page = projectRecordsService.findPageExport(new Page<RuralProjectRecords>(request, response, -1), projectRecords);
     		new ExportExcel("项目", RuralProjectRecords.class).setDataList(page.getList()).write(response, fileName).dispose();
     		return null;
 		} catch (Exception e) {

+ 0 - 1
src/main/java/com/jeeplus/modules/statement/controller/StatementCompanyComprehensiveController.java

@@ -312,7 +312,6 @@ public class StatementCompanyComprehensiveController extends BaseController {
         model.addAttribute("field3",statementCompanyComprehensiveInfo.getField3());
         model.addAttribute("field4",statementCompanyComprehensiveInfo.getField4());
 
-        statementCompanyComprehensiveInfo.setField3("0");
 
         //进行查询之后进行任何操作,返回还是查询之后的数据页面
         if (StringUtils.isNotBlank(workContractInfo.getToflag())){

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

@@ -1,8 +1,10 @@
 package com.jeeplus.modules.statement.dao;
 
 import com.jeeplus.common.persistence.CrudDao;
+import com.jeeplus.common.persistence.DataEntity;
 import com.jeeplus.common.persistence.annotation.MyBatisDao;
 import com.jeeplus.modules.ruralprojectrecords.entity.RuralProjectRecords;
+import com.jeeplus.modules.statement.entity.ReportDataEntity;
 import com.jeeplus.modules.statement.entity.StatementCompanyComprehensiveInfo;
 import com.jeeplus.modules.statement.entity.StatementDataInfo;
 import com.jeeplus.modules.sys.entity.Office;
@@ -46,6 +48,15 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
      */
     Integer getInsertProjectCountByGrade(@Param("officeId") String officeId, @Param("grade")String grade, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
+    /**
+     * 公司级根据项目等级查询所有项目信息数量(根据部门分组)
+     * @param grade
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getInsertProjectCountByGradeAll(@Param("grade")String grade, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
 
     /**
      * 公司级查询项目归档信息数量
@@ -57,6 +68,14 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     Integer getProjectCountByRecord(@Param("officeId") String officeId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
+     * 公司级查询所有项目归档信息数量(根据部门分组)
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getProjectCountByRecordAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
+    /**
      * 公司级查询项目上报信息数量
      * @param officeId 部门id
      * @param beginDate 开始时间
@@ -66,11 +85,25 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     Integer getProjectCountByReported(@Param("officeId") String officeId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
+     * 公司级查询所有项目上报信息数量(根据部门分组)
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getProjectCountByReportedAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
+    /**
      * 公司级查询项目归档超期未归档项目id
      * @param officeId 部门id
      * @return
      */
     List<String> getOverDueNotRecordProject(@Param("officeId") String officeId);
+
+    /**
+     * 公司级查询所有项目归档超期未归档项目id(根据部门分组)
+     * @return
+     */
+    List<ReportDataEntity> getOverDueNotRecordProjectAll();
     /**
      * 公司级查询项目归档超期归档项目id
      * @param officeId 部门id
@@ -81,11 +114,25 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     List<String> getOverDueRecordProject(@Param("officeId") String officeId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
+     * 公司级查询项目归档超期归档项目id(根据部门分组)
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getOverDueRecordProjectAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
+    /**
      * 公司级查询项目上报超期未上报项目id
      * @param officeId 部门id
      * @return
      */
     List<String> getOverDueNotReportedProject(@Param("officeId") String officeId);
+
+    /**
+     * 公司级查询项目归档超期归档项目id(根据部门分组)
+     * @return
+     */
+    List<ReportDataEntity> getOverDueNotReportedProjectAll();
     /**
      * 公司级查询项目上报超期上报项目id
      * @param officeId 部门id
@@ -95,6 +142,11 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
      */
     List<String> getOverDueReportedProject(@Param("officeId") String officeId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
+    /**
+     * 公司级查询项目归档超期归档项目id(根据部门分组)
+     * @return
+     */
+    List<ReportDataEntity> getOverDueReportedProjectAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
 
 
@@ -109,6 +161,12 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     Integer getInsertInvoiceCountByOffice(@Param("officeId") String officeId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
+     * 公司级查询发票信息数量(根据部门分组)
+     * @return
+     */
+    List<ReportDataEntity> getInsertInvoiceCountByOfficeAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
+    /**
      * 公司级查询发票信息开票金额总和
      * @param officeId
      * @param beginDate
@@ -118,6 +176,12 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     String getInsertInvoiceSumMoneyByOffice(@Param("officeId") String officeId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
+     * 公司级查询发票信息开票金额总和(根据部门分组)
+     * @return
+     */
+    List<ReportDataEntity> getInsertInvoiceSumMoneyByOfficeAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
+    /**
      * 公司级查询收款发票数量
      * @param officeId
      * @param beginDate
@@ -126,6 +190,11 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
      */
     Integer getInsertInvoiceDetailsCountByOffice(@Param("officeId") String officeId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
+    /**
+     * 公司级查询收款发票数量(根据部门分组)
+     * @return
+     */
+    List<ReportDataEntity> getInsertInvoiceDetailsCountByOfficeAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
      * 公司级查询收款发票金额总和
@@ -136,6 +205,13 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
      */
     String getInsertInvoiceDetailsSumMoneyByOffice(@Param("officeId") String officeId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
+    /**
+     * 公司级查询收款发票金额总和(根据部门分组)
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getInsertInvoiceDetailsSumMoneyByOfficeAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
      * 查询新增报销信息
@@ -146,6 +222,13 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
      */
     Integer getInsertReimbursementCountByOffice(@Param("officeId") String officeId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
+    /**
+     * 查询新增报销信息(根据部门分组)
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getInsertReimbursementCountByOfficeAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
      * 查询报销金额总额
@@ -157,6 +240,14 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     String getInsertReimbursementSumMoneyByOffice(@Param("officeId") String officeId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
+     * 查询报销金额总额(根据部门分组)
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getInsertReimbursementSumMoneyByOfficeAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
+    /**
      * 公司级新增合同信息数量
      * @param officeId
      * @param beginDate
@@ -166,6 +257,14 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     Integer getInsertContractCountByOffice(@Param("officeId") String officeId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
+     * 公司级新增合同信息数量(根据部门分组)
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getInsertContractCountByOfficeAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
+    /**
      * 公司级合同纸质归档数量
      * @param officeId
      * @param beginDate
@@ -174,6 +273,13 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
      */
     Integer getInsertContractRecordCountByOffice(@Param("officeId") String officeId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
+    /**
+     * 公司级合同纸质归档数量(根据部门分组)
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getInsertContractRecordCountByOfficeAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
      * 公司级合同纸质归档超期未归档合同id信息
@@ -183,6 +289,12 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     List<String> getOverDueNotContractRecordCountByOffice(@Param("officeId") String officeId);
 
     /**
+     * 公司级合同纸质归档超期未归档合同id信息(根据部门分组)
+     * @return
+     */
+    List<ReportDataEntity> getOverDueNotContractRecordCountByOfficeAll();
+
+    /**
      * 公司级合同纸质归档超期归档合同id信息
      * @param officeId
      * @param beginDate
@@ -192,6 +304,14 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     List<String> getOverDueContractRecordCountByOffice(@Param("officeId") String officeId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
+     * 公司级合同纸质归档超期归档合同id信息(根据部门分组)
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getOverDueContractRecordCountByOfficeAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
+    /**
      * 超期、未超期数据存储
      * @param statementDataInfoList
      */
@@ -226,6 +346,13 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
      */
     Integer getOfficeInsertProjectCountByGrade(@Param("userId") String userId, @Param("grade")String grade, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
+    /**
+     * 公司级合同纸质归档超期归档合同id信息(根据部门分组)
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getOfficeInsertProjectCountByGradeAll(@Param("grade")String grade, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
      * 部门级查询项目归档信息数量
@@ -237,6 +364,14 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     Integer getOfficeProjectCountByRecord(@Param("userId") String userId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
+     * 公司级合同纸质归档超期归档合同id信息(根据部门分组)
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getOfficeProjectCountByRecordAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
+    /**
      * 部门级查询项目上报信息数量
      * @param userId 人员id
      * @param beginDate 开始时间
@@ -246,12 +381,25 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     Integer getOfficeProjectCountByReported(@Param("userId") String userId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
+     * 公司级合同纸质归档超期归档合同id信息(根据部门分组)
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getOfficeProjectCountByReportedAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
+    /**
      * 部门级查询项目归档超期未归档项目id
      * @param userId 人员id
      * @return
      */
     List<String> getOfficeOverDueNotRecordProject(@Param("userId") String userId);
     /**
+     * 部门级查询项目归档超期未归档项目id
+     * @return
+     */
+    List<ReportDataEntity> getOfficeOverDueNotRecordProjectAll();
+    /**
      * 部门级查询项目归档超期归档项目id
      * @param userId 人员id
      * @param beginDate 开始时间
@@ -261,12 +409,26 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     List<String> getOfficeOverDueRecordProject(@Param("userId") String userId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
+     * 部门级查询项目归档超期归档项目id
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getOfficeOverDueRecordProjectAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
+    /**
      * 部门级查询项目上报超期未上报项目id
      * @param userId 人员id
      * @return
      */
     List<String> getOfficeOverDueNotReportedProject(@Param("userId") String userId);
     /**
+     * 部门级查询项目上报超期未上报项目id
+     * @return
+     */
+    List<ReportDataEntity> getOfficeOverDueNotReportedProjectAll();
+
+    /**
      * 部门级查询项目上报超期上报项目id
      * @param userId 人员id
      * @param beginDate 开始时间
@@ -276,6 +438,14 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     List<String> getOfficeOverDueReportedProject(@Param("userId") String userId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
+     * 部门级查询项目上报超期上报项目id
+     * @param beginDate 开始时间
+     * @param endDate 结束时间
+     * @return
+     */
+    List<ReportDataEntity> getOfficeOverDueReportedProjectAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
+    /**
      * 保存部门级数据信息
      * @param info
      * @return
@@ -311,6 +481,14 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     Integer getInsertOfficeInvoiceCountByOffice(@Param("userId") String userId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
+     * 部门级查询发票信息数量
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getInsertOfficeInvoiceCountByOfficeAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
+    /**
      * 部门级查询发票信息开票金额总和
      * @param userId
      * @param beginDate
@@ -320,6 +498,14 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     String getInsertOfficeInvoiceSumMoneyByOffice(@Param("userId") String userId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
+     * 部门级查询发票信息开票金额总和
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getInsertOfficeInvoiceSumMoneyByOfficeAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
+    /**
      * 部门级查询收款发票数量
      * @param userId
      * @param beginDate
@@ -328,6 +514,14 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
      */
     Integer getInsertOfficeInvoiceDetailsCountByOffice(@Param("userId") String userId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
+    /**
+     * 部门级查询收款发票数量
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getInsertOfficeInvoiceDetailsCountByOfficeAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
 
     /**
      * 部门级查询收款发票金额总和
@@ -339,6 +533,14 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     String getInsertOfficeInvoiceDetailsSumMoneyByOffice(@Param("userId") String userId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
+     * 部门级查询收款发票金额总和
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getInsertOfficeInvoiceDetailsSumMoneyByOfficeAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
+    /**
      * 按照类型查询公司级所有报表信息
      * @param statementCompanyComprehensiveInfo
      * @return
@@ -354,6 +556,14 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
      */
     Integer getInsertOfficeReimbursementCountByOffice(@Param("userId") String userId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
+    /**
+     * 部门级查询新增报销信息
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getInsertOfficeReimbursementCountByOfficeAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
 //    List<RuralProjectRecords> findAllList(RuralProjectRecords ruralProjectRecords,@Param("officeId") String officeId);
 
     /**
@@ -366,6 +576,14 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     String getInsertOfficeReimbursementSumMoneyByOffice(@Param("userId") String userId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
+     * 部门级查询报销金额总额
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getInsertOfficeReimbursementSumMoneyByOfficeAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
+    /**
      * 部门级新增合同信息数量
      * @param userId
      * @param beginDate
@@ -375,6 +593,14 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     Integer getInsertOfficeContractCountByOffice(@Param("userId") String userId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
     /**
+     * 部门级新增合同信息数量
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getInsertOfficeContractCountByOfficeAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
+    /**
      * 部门级合同纸质归档数量
      * @param userId
      * @param beginDate
@@ -383,6 +609,14 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
      */
     Integer getInsertOfficeContractRecordCountByOffice(@Param("userId") String userId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
+    /**
+     * 部门级合同纸质归档数量
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getInsertOfficeContractRecordCountByOfficeAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
 
     /**
      * 部门级合同纸质归档超期未归档合同id信息
@@ -392,6 +626,12 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
     List<String> getOfficeOverDueNotContractRecordCountByOffice(@Param("userId") String userId);
 
     /**
+     * 部门级合同纸质归档超期未归档合同id信息
+     * @return
+     */
+    List<ReportDataEntity> getOfficeOverDueNotContractRecordCountByOfficeAll();
+
+    /**
      * 部门级合同纸质归档超期归档合同id信息
      * @param userId
      * @param beginDate
@@ -400,6 +640,14 @@ public interface StatementCompanyComprehensiveDao  extends CrudDao<StatementComp
      */
     List<String> getOfficeOverDueContractRecordCountByOffice(@Param("userId") String userId, @Param("beginDate")String beginDate, @Param("endDate")String endDate);
 
+    /**
+     * 部门级合同纸质归档超期归档合同id信息
+     * @param beginDate
+     * @param endDate
+     * @return
+     */
+    List<ReportDataEntity> getOfficeOverDueContractRecordCountByOfficeAll(@Param("beginDate")String beginDate, @Param("endDate")String endDate);
+
 
     /**
      * 按照big,small,year,type,office_id查询部门级所有报表信息

+ 62 - 0
src/main/java/com/jeeplus/modules/statement/entity/ReportDataEntity.java

@@ -0,0 +1,62 @@
+package com.jeeplus.modules.statement.entity;
+
+/**
+ * @author: 大猫
+ * @create: 2022-01-21 17:28
+ **/
+public class ReportDataEntity {
+    private String officeId;
+    private Integer count;
+    private String officeParentIds;
+    private String fieldId; //可变参数
+    private String variableElement; //可变参数
+    private String userId; //人员id
+
+    public String getOfficeId() {
+        return officeId;
+    }
+
+    public void setOfficeId(String officeId) {
+        this.officeId = officeId;
+    }
+
+    public Integer getCount() {
+        return count;
+    }
+
+    public void setCount(Integer count) {
+        this.count = count;
+    }
+
+    public String getOfficeParentIds() {
+        return officeParentIds;
+    }
+
+    public void setOfficeParentIds(String officeParentIds) {
+        this.officeParentIds = officeParentIds;
+    }
+
+    public String getFieldId() {
+        return fieldId;
+    }
+
+    public void setFieldId(String fieldId) {
+        this.fieldId = fieldId;
+    }
+
+    public String getVariableElement() {
+        return variableElement;
+    }
+
+    public void setVariableElement(String variableElement) {
+        this.variableElement = variableElement;
+    }
+
+    public String getUserId() {
+        return userId;
+    }
+
+    public void setUserId(String userId) {
+        this.userId = userId;
+    }
+}

+ 24 - 0
src/main/java/com/jeeplus/modules/statement/entity/StatementCompanyComprehensiveInfo.java

@@ -86,6 +86,9 @@ public class StatementCompanyComprehensiveInfo extends DataEntity<StatementCompa
     }
 
     public String getField1() {
+        if("".equals(field1)||field1==null){
+            return "0";
+        }
         return field1;
     }
 
@@ -94,6 +97,9 @@ public class StatementCompanyComprehensiveInfo extends DataEntity<StatementCompa
     }
 
     public String getField2() {
+        if("".equals(field2)||field2==null){
+            return "0";
+        }
         return field2;
     }
 
@@ -102,6 +108,9 @@ public class StatementCompanyComprehensiveInfo extends DataEntity<StatementCompa
     }
 
     public String getField3() {
+        if("".equals(field3)||field3==null){
+            return "0";
+        }
         return field3;
     }
 
@@ -110,6 +119,9 @@ public class StatementCompanyComprehensiveInfo extends DataEntity<StatementCompa
     }
 
     public String getField4() {
+        if("".equals(field4)||field4==null){
+            return "0";
+        }
         return field4;
     }
 
@@ -118,6 +130,9 @@ public class StatementCompanyComprehensiveInfo extends DataEntity<StatementCompa
     }
 
     public String getField5() {
+        if("".equals(field5)||field5==null){
+            return "0";
+        }
         return field5;
     }
 
@@ -126,6 +141,9 @@ public class StatementCompanyComprehensiveInfo extends DataEntity<StatementCompa
     }
 
     public String getField6() {
+        if("".equals(field6)||field6==null){
+            return "0";
+        }
         return field6;
     }
 
@@ -134,6 +152,9 @@ public class StatementCompanyComprehensiveInfo extends DataEntity<StatementCompa
     }
 
     public String getField7() {
+        if("".equals(field7)||field7==null){
+            return "0";
+        }
         return field7;
     }
 
@@ -142,6 +163,9 @@ public class StatementCompanyComprehensiveInfo extends DataEntity<StatementCompa
     }
 
     public String getField8() {
+        if("".equals(field8)||field8==null){
+            return "0";
+        }
         return field8;
     }
 

+ 544 - 114
src/main/java/com/jeeplus/modules/statement/service/StatementCompanyComprehensiveService.java

@@ -1,8 +1,12 @@
 package com.jeeplus.modules.statement.service;
 
 import com.google.common.collect.Lists;
+import com.jeeplus.common.persistence.DataEntity;
 import com.jeeplus.common.service.CrudService;
+import com.jeeplus.common.utils.StringUtils;
+import com.jeeplus.modules.projectFilingBatch.entity.ProjectFilingBatchImportInfo;
 import com.jeeplus.modules.statement.dao.StatementCompanyComprehensiveDao;
+import com.jeeplus.modules.statement.entity.ReportDataEntity;
 import com.jeeplus.modules.statement.entity.StatementCompanyComprehensiveInfo;
 import com.jeeplus.modules.statement.entity.StatementDataInfo;
 import com.jeeplus.modules.sys.entity.Office;
@@ -10,6 +14,7 @@ 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.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -308,33 +313,89 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
      */
     @Transactional(readOnly = false)
     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));
-        comprehensiveInfo.setBigDateType(bigDateType.toString());
-        comprehensiveInfo.setSmallDateType(smallDateType.toString());
-        comprehensiveInfo.setStatementDate(statementDate);
+
+
+        //查询新增A类项目数量
+        List<ReportDataEntity> projectCountByAAll = dao.getInsertProjectCountByGradeAll( "2", beginDate, endDate);
+        List<ReportDataEntity> projectCountByBAll = dao.getInsertProjectCountByGradeAll( "1", beginDate, endDate);
+        List<ReportDataEntity> getProjectCountByRecordAll = dao.getProjectCountByRecordAll(beginDate, endDate);
+        List<ReportDataEntity> getProjectCountByReportedAll = dao.getProjectCountByReportedAll(beginDate, endDate);
+        //超期未归档
+        List<ReportDataEntity> overDueNotRecordProjectIdListAll = dao.getOverDueNotRecordProjectAll();
+        //超期归档
+        List<ReportDataEntity> overDueRecordProjectIdListAll = dao.getOverDueRecordProjectAll(beginDate, endDate);
+        //超期未上报
+        List<ReportDataEntity> overDueNotReportedProjectIdListAll = dao.getOverDueNotReportedProjectAll();
+        //超期上报
+        List<ReportDataEntity> overDueReportedProjectIdListAll = dao.getOverDueReportedProjectAll(beginDate, endDate);
+        //查询电子归档超期未归档项目数量(分组)
+        Map<String, List<ReportDataEntity>> overDueNotRecordProjectIdListAllMap = dataMessageDispose(overDueNotRecordProjectIdListAll);
+        //分组
+        Map<String, List<ReportDataEntity>> overDueRecordProjectIdListAllMap = dataMessageDispose(overDueRecordProjectIdListAll);
+        //分组
+        Map<String, List<ReportDataEntity>> overDueNotReportedProjectIdListAllMap = dataMessageDispose(overDueNotReportedProjectIdListAll);
+        //分组
+        Map<String, List<ReportDataEntity>> overDueReportedProjectIdListAllMap = dataMessageDispose(overDueReportedProjectIdListAll);
+
         //查询部门信息
         List<Office> officeList = dao.getOfficeListInfo();
         for (Office officeInfo : officeList) {
+            StatementCompanyComprehensiveInfo comprehensiveInfo = new StatementCompanyComprehensiveInfo();
+            comprehensiveInfo.setType("1");
+            comprehensiveInfo.setYear(String.valueOf(year));
+            comprehensiveInfo.setBigDateType(bigDateType.toString());
+            comprehensiveInfo.setSmallDateType(smallDateType.toString());
+            comprehensiveInfo.setStatementDate(statementDate);
             comprehensiveInfo.setOfficeId(officeInfo.getId());
             //查询新增A类项目数量
-            Integer projectCountByA = dao.getInsertProjectCountByGrade(officeInfo.getId(), "2", beginDate, endDate);
-            comprehensiveInfo.setField1(projectCountByA.toString());
+            /*Integer projectCountByA = dao.getInsertProjectCountByGrade(officeInfo.getId(), "2", beginDate, endDate);
+            comprehensiveInfo.setField1(projectCountByA.toString());*/
+            //遍历添加新增A类项目数量
+            for (ReportDataEntity reportData: projectCountByAAll) {
+                if(officeInfo.getId().equals(reportData.getOfficeId()) || reportData.getOfficeParentIds().contains(officeInfo.getId())){
+                    comprehensiveInfo.setField1(String.valueOf(Integer.parseInt(comprehensiveInfo.getField1()) + reportData.getCount()));
+                }
+            }
             //查询新增B类项目数量
-            Integer projectCountByB = dao.getInsertProjectCountByGrade(officeInfo.getId(), "1", beginDate, endDate);
-            comprehensiveInfo.setField2(projectCountByB.toString());
+            /*Integer projectCountByB = dao.getInsertProjectCountByGrade(officeInfo.getId(), "1", beginDate, endDate);
+            comprehensiveInfo.setField2(projectCountByB.toString());*/
+            for (ReportDataEntity reportData: projectCountByBAll) {
+                if(officeInfo.getId().equals(reportData.getOfficeId()) || reportData.getOfficeParentIds().contains(officeInfo.getId())){
+                    comprehensiveInfo.setField2(String.valueOf(Integer.parseInt(comprehensiveInfo.getField2()) + reportData.getCount()));
+                }
+            }
             //查询本月电子归档项目数量
-            Integer getProjectCountByRecord = dao.getProjectCountByRecord(officeInfo.getId(), beginDate, endDate);
-            comprehensiveInfo.setField3(getProjectCountByRecord.toString());
+            /*Integer getProjectCountByRecord = dao.getProjectCountByRecord(officeInfo.getId(), beginDate, endDate);
+            comprehensiveInfo.setField3(getProjectCountByRecord.toString());*/
+            for (ReportDataEntity reportData: getProjectCountByRecordAll) {
+                if(officeInfo.getId().equals(reportData.getOfficeId()) || reportData.getOfficeParentIds().contains(officeInfo.getId())){
+                    comprehensiveInfo.setField3(String.valueOf(Integer.parseInt(comprehensiveInfo.getField3()) + reportData.getCount()));
+                }
+            }
             //查询本月上报项目数量
-            Integer getProjectCountByReported = dao.getProjectCountByReported(officeInfo.getId(), beginDate, endDate);
-            comprehensiveInfo.setField4(getProjectCountByReported.toString());
+            /*Integer getProjectCountByReported = dao.getProjectCountByReported(officeInfo.getId(), beginDate, endDate);
+            comprehensiveInfo.setField4(getProjectCountByReported.toString());*/
+            for (ReportDataEntity reportData: getProjectCountByReportedAll) {
+                if(officeInfo.getId().equals(reportData.getOfficeId()) || reportData.getOfficeParentIds().contains(officeInfo.getId())){
+                    comprehensiveInfo.setField4(String.valueOf(Integer.parseInt(comprehensiveInfo.getField4()) + reportData.getCount()));
+                }
+            }
             //查询电子归档超期未归档项目数量(保存到数据库)
-            List<String> overDueNotRecordProjectIdList = dao.getOverDueNotRecordProject(officeInfo.getId());
-            comprehensiveInfo.setField5(String.valueOf(overDueNotRecordProjectIdList.size()));
+            //List<String> overDueNotRecordProjectIdList = dao.getOverDueNotRecordProject(officeInfo.getId());
+            List<ReportDataEntity> overDueNotRecordProjectListAll = Lists.newArrayList();
+            for (String key : overDueNotRecordProjectIdListAllMap.keySet()) {
+                if(officeInfo.getId().equals(key) || key.contains(officeInfo.getId())){
+                    List<ReportDataEntity> reportDataEntities = overDueNotRecordProjectIdListAllMap.get(key);
+                    overDueNotRecordProjectListAll.addAll(reportDataEntities);
+                    comprehensiveInfo.setField5(String.valueOf(Integer.parseInt(comprehensiveInfo.getField5()) + reportDataEntities.size()));
+                }
+
+            }
+
+
             List<StatementDataInfo> overDueNotRecordProjectList = Lists.newArrayList();
-            for (String projectId : overDueNotRecordProjectIdList) {
+            for (ReportDataEntity peportDataEntity : overDueNotRecordProjectListAll) {
+                String projectId = peportDataEntity.getFieldId();
                 StatementDataInfo info = new StatementDataInfo();
                 info.setStatementDate(statementDate);
                 info.setGradeType("1");
@@ -353,11 +414,24 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                 }
                 dao.insertStatementDataInfo(overDueNotRecordProjectList);
             }
+
+
             //查询电子归档超期归档项目数量(保存到数据库)
-            List<String> overDueRecordProjectIdList = dao.getOverDueRecordProject(officeInfo.getId(), beginDate, endDate);
-            comprehensiveInfo.setField6(String.valueOf(overDueRecordProjectIdList.size()));
+            //List<String> overDueRecordProjectIdList = dao.getOverDueRecordProject(officeInfo.getId(), beginDate, endDate);
+            List<ReportDataEntity> overDueRecordProjectListAll = Lists.newArrayList();
+            for (String key : overDueRecordProjectIdListAllMap.keySet()) {
+                if(officeInfo.getId().equals(key) || key.contains(officeInfo.getId())){
+                    List<ReportDataEntity> reportDataEntities = overDueRecordProjectIdListAllMap.get(key);
+                    overDueRecordProjectListAll.addAll(reportDataEntities);
+                    comprehensiveInfo.setField6(String.valueOf(Integer.parseInt(comprehensiveInfo.getField6()) + reportDataEntities.size()));
+                }
+
+            }
+
+            //comprehensiveInfo.setField6(String.valueOf(overDueRecordProjectIdList.size()));
             List<StatementDataInfo> overDueRecordProjectList = Lists.newArrayList();
-            for (String projectId : overDueRecordProjectIdList) {
+            for (ReportDataEntity peportDataEntity : overDueRecordProjectListAll) {
+                String projectId = peportDataEntity.getFieldId();
                 StatementDataInfo info = new StatementDataInfo();
                 info.setStatementDate(statementDate);
                 info.setGradeType("1");
@@ -377,10 +451,21 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                 dao.insertStatementDataInfo(overDueRecordProjectList);
             }
             //查询上报超期未上报项目数量(保存到数据库)
-            List<String> overDueNotReportedProjectIdList = dao.getOverDueNotReportedProject(officeInfo.getId());
-            comprehensiveInfo.setField7(String.valueOf(overDueNotReportedProjectIdList.size()));
+            //List<String> overDueNotReportedProjectIdList = dao.getOverDueNotReportedProject(officeInfo.getId());
+            List<ReportDataEntity> overDueNotReportedProjectListAll = Lists.newArrayList();
+            for (String key : overDueNotReportedProjectIdListAllMap.keySet()) {
+                if(officeInfo.getId().equals(key) || key.contains(officeInfo.getId())){
+                    List<ReportDataEntity> reportDataEntities = overDueNotReportedProjectIdListAllMap.get(key);
+                    overDueNotReportedProjectListAll.addAll(reportDataEntities);
+                    comprehensiveInfo.setField7(String.valueOf(Integer.parseInt(comprehensiveInfo.getField7()) + reportDataEntities.size()));
+                }
+
+            }
+
+            //comprehensiveInfo.setField7(String.valueOf(overDueNotReportedProjectIdListAll.size()));
             List<StatementDataInfo> overDueNotReportedProjectList = Lists.newArrayList();
-            for (String projectId : overDueNotReportedProjectIdList) {
+            for (ReportDataEntity peportDataEntity : overDueNotReportedProjectListAll) {
+                String projectId = peportDataEntity.getFieldId();
                 StatementDataInfo info = new StatementDataInfo();
                 info.setStatementDate(statementDate);
                 info.setGradeType("1");
@@ -400,10 +485,21 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                 dao.insertStatementDataInfo(overDueNotReportedProjectList);
             }
             //查询上报超期上报项目数量(保存到数据库)
-            List<String> overDueReportedProjectIdList = dao.getOverDueReportedProject(officeInfo.getId(), beginDate, endDate);
-            comprehensiveInfo.setField8(String.valueOf(overDueReportedProjectIdList.size()));
+            //List<String> overDueReportedProjectIdList = dao.getOverDueReportedProject(officeInfo.getId(), beginDate, endDate);
+            List<ReportDataEntity> overDueReportedProjectListAll = Lists.newArrayList();
+            for (String key : overDueReportedProjectIdListAllMap.keySet()) {
+                if(officeInfo.getId().equals(key) || key.contains(officeInfo.getId())){
+                    List<ReportDataEntity> reportDataEntities = overDueReportedProjectIdListAllMap.get(key);
+                    overDueReportedProjectListAll.addAll(reportDataEntities);
+                    comprehensiveInfo.setField8(String.valueOf(Integer.parseInt(comprehensiveInfo.getField8()) + reportDataEntities.size()));
+                }
+
+            }
+
+            //comprehensiveInfo.setField8(String.valueOf(overDueReportedProjectIdList.size()));
             List<StatementDataInfo> overDueReportedProjectList = Lists.newArrayList();
-            for (String projectId : overDueReportedProjectIdList) {
+            for (ReportDataEntity peportDataEntity : overDueReportedProjectListAll) {
+                String projectId = peportDataEntity.getFieldId();
                 StatementDataInfo info = new StatementDataInfo();
                 info.setStatementDate(statementDate);
                 info.setGradeType("1");
@@ -432,6 +528,72 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
     }
 
     /**
+     * 公司级数据分组
+     * @param dataList
+     * @return
+     */
+    public Map<String, List<ReportDataEntity>> dataMessageDispose(List<ReportDataEntity> dataList) {
+        //所有有效数据均添加到list中,下边将list中的数据根据店号和收银员的id进行分割处理
+        Map<String, List<ReportDataEntity>> result = listGroup2MapTwo(dataList);
+        return result;
+    }
+
+    private Map<String, List<ReportDataEntity>> listGroup2MapTwo(List<ReportDataEntity> list) {
+        Map<String, List<ReportDataEntity>> userSignSerialMap = new HashMap<>();
+        if (CollectionUtils.isNotEmpty(list)) {
+            // 分组
+            for (ReportDataEntity vo : list) {
+
+                List<ReportDataEntity> tempList = userSignSerialMap.get(vo.getOfficeParentIds()+","+vo.getOfficeId());
+                /*如果取不到数据,那么直接new一个空的ArrayList**/
+                if (tempList == null) {
+                    tempList = new ArrayList<>();
+                    tempList.add(vo);
+                    userSignSerialMap.put(vo.getOfficeParentIds()+","+vo.getOfficeId(), tempList);
+                }
+                else {
+                    /*某个vo之前已经存放过了,则直接追加数据到原来的List里**/
+                    tempList.add(vo);
+                }
+            }
+        }
+        return userSignSerialMap;
+    }
+
+    /**
+     * 部门级数据分组
+     * @param dataList
+     * @return
+     */
+    public Map<String, List<ReportDataEntity>> officeDataMessageDispose(List<ReportDataEntity> dataList) {
+        //所有有效数据均添加到list中,下边将list中的数据根据店号和收银员的id进行分割处理
+        Map<String, List<ReportDataEntity>> result = officeListGroup2MapTwo(dataList);
+        return result;
+    }
+
+    private Map<String, List<ReportDataEntity>> officeListGroup2MapTwo(List<ReportDataEntity> list) {
+        Map<String, List<ReportDataEntity>> userSignSerialMap = new HashMap<>();
+        if (CollectionUtils.isNotEmpty(list)) {
+            // 分组
+            for (ReportDataEntity vo : list) {
+
+                List<ReportDataEntity> tempList = userSignSerialMap.get(vo.getUserId());
+                /*如果取不到数据,那么直接new一个空的ArrayList**/
+                if (tempList == null) {
+                    tempList = new ArrayList<>();
+                    tempList.add(vo);
+                    userSignSerialMap.put(vo.getUserId(), tempList);
+                }
+                else {
+                    /*某个vo之前已经存放过了,则直接追加数据到原来的List里**/
+                    tempList.add(vo);
+                }
+            }
+        }
+        return userSignSerialMap;
+    }
+
+    /**
      * 公司级开票记录月报/季报/年报汇总方法
      * @param beginDate 开始时间
      * @param endDate 结束时间
@@ -442,27 +604,66 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
      */
     @Transactional(readOnly = false)
     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));
-        comprehensiveInfo.setBigDateType(bigDateType.toString());
-        comprehensiveInfo.setSmallDateType(smallDateType.toString());
-        comprehensiveInfo.setStatementDate(statementDate);
+        //查询新增发票信息
+        List<ReportDataEntity> field1All = dao.getInsertInvoiceCountByOfficeAll(beginDate, endDate);
+        //查询开票金额总额
+        List<ReportDataEntity> field2All = dao.getInsertInvoiceSumMoneyByOfficeAll(beginDate, endDate);
+        //查询本月收款发票
+        List<ReportDataEntity> field3All = dao.getInsertInvoiceDetailsCountByOfficeAll(beginDate, endDate);
+        //查询本月收款
+        List<ReportDataEntity> field4All = dao.getInsertInvoiceDetailsSumMoneyByOfficeAll(beginDate, endDate);
 
         for (Office officeInfo : officeList) {
+            StatementCompanyComprehensiveInfo comprehensiveInfo = new StatementCompanyComprehensiveInfo();
+            comprehensiveInfo.setType("2");
+            comprehensiveInfo.setYear(String.valueOf(year));
+            comprehensiveInfo.setBigDateType(bigDateType.toString());
+            comprehensiveInfo.setSmallDateType(smallDateType.toString());
+            comprehensiveInfo.setStatementDate(statementDate);
             comprehensiveInfo.setOfficeId(officeInfo.getId());
+
             //查询新增发票信息
-            Integer field1 = dao.getInsertInvoiceCountByOffice(officeInfo.getId(), beginDate, endDate);
-            comprehensiveInfo.setField1(field1.toString());
+            /*Integer field1 = dao.getInsertInvoiceCountByOffice(officeInfo.getId(), beginDate, endDate);
+            comprehensiveInfo.setField1(field1.toString());*/
+            for (ReportDataEntity reportData: field1All) {
+                if(officeInfo.getId().equals(reportData.getOfficeId()) || reportData.getOfficeParentIds().contains(officeInfo.getId())){
+                    comprehensiveInfo.setField1(String.valueOf(Integer.parseInt(comprehensiveInfo.getField1()) + reportData.getCount()));
+                }
+            }
             //查询开票金额总额
-            String field2 = dao.getInsertInvoiceSumMoneyByOffice(officeInfo.getId(), beginDate, endDate);
-            comprehensiveInfo.setField2(field2);
+            /*String field2 = dao.getInsertInvoiceSumMoneyByOffice(officeInfo.getId(), beginDate, endDate);
+            comprehensiveInfo.setField2(field2);*/
+            for (ReportDataEntity reportData: field2All) {
+                if(officeInfo.getId().equals(reportData.getOfficeId()) || reportData.getOfficeParentIds().contains(officeInfo.getId())){
+                    comprehensiveInfo.setField2(String.valueOf(new BigDecimal(comprehensiveInfo.getField2()).add(new BigDecimal(reportData.getVariableElement()))));
+                }
+            }
             //查询本月收款发票
-            Integer field3 = dao.getInsertInvoiceDetailsCountByOffice(officeInfo.getId(), beginDate, endDate);
-            comprehensiveInfo.setField3(field3.toString());
+            /*Integer field3 = dao.getInsertInvoiceDetailsCountByOffice(officeInfo.getId(), beginDate, endDate);
+            comprehensiveInfo.setField3(field3.toString());*/
+            for (ReportDataEntity reportData: field3All) {
+                if(officeInfo.getId().equals(reportData.getOfficeId()) || reportData.getOfficeParentIds().contains(officeInfo.getId())){
+                    comprehensiveInfo.setField3(String.valueOf(Integer.parseInt(comprehensiveInfo.getField3()) + reportData.getCount()));
+                }
+            }
             //查询本月收款
-            String field4 = dao.getInsertInvoiceDetailsSumMoneyByOffice(officeInfo.getId(), beginDate, endDate);
-            comprehensiveInfo.setField4(field4);
+            /*String field4 = dao.getInsertInvoiceDetailsSumMoneyByOffice(officeInfo.getId(), beginDate, endDate);
+            comprehensiveInfo.setField4(field4);*/
+            for (ReportDataEntity reportData: field4All) {
+                if(officeInfo.getId().equals(reportData.getOfficeId()) || reportData.getOfficeParentIds().contains(officeInfo.getId())){
+                    comprehensiveInfo.setField4(String.valueOf(new BigDecimal(comprehensiveInfo.getField4()).add(new BigDecimal(reportData.getVariableElement()))));
+                }
+            }
+            //对金额数据进行处理和四舍五入
+            if(StringUtils.isNotBlank(comprehensiveInfo.getField2())){
+                BigDecimal b = new BigDecimal(comprehensiveInfo.getField2());
+                comprehensiveInfo.setField2(String.valueOf(b.setScale(2, BigDecimal.ROUND_HALF_UP)));
+            }
+            if(StringUtils.isNotBlank(comprehensiveInfo.getField4())){
+                BigDecimal b = new BigDecimal(comprehensiveInfo.getField4());
+                comprehensiveInfo.setField4(String.valueOf(b.setScale(2, BigDecimal.ROUND_HALF_UP)));
+            }
+
 
             //数据处理并保存到数据库中
             comprehensiveInfo.preInsert();
@@ -480,21 +681,42 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
      */
     @Transactional(readOnly = false)
     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));
-        comprehensiveInfo.setBigDateType(bigDateType.toString());
-        comprehensiveInfo.setSmallDateType(smallDateType.toString());
-        comprehensiveInfo.setStatementDate(statementDate);
+
+        //查询新增报销信息
+        List<ReportDataEntity> field1All = dao.getInsertReimbursementCountByOfficeAll(beginDate, endDate);
+        //查询报销金额总额
+        List<ReportDataEntity> field2All = dao.getInsertReimbursementSumMoneyByOfficeAll(beginDate, endDate);
 
         for (Office officeInfo : officeList) {
+            StatementCompanyComprehensiveInfo comprehensiveInfo = new StatementCompanyComprehensiveInfo();
+            comprehensiveInfo.setType("3");
+            comprehensiveInfo.setYear(String.valueOf(year));
+            comprehensiveInfo.setBigDateType(bigDateType.toString());
+            comprehensiveInfo.setSmallDateType(smallDateType.toString());
+            comprehensiveInfo.setStatementDate(statementDate);
             comprehensiveInfo.setOfficeId(officeInfo.getId());
             //查询新增报销信息
-            Integer field1 = dao.getInsertReimbursementCountByOffice(officeInfo.getId(), beginDate, endDate);
-            comprehensiveInfo.setField1(field1.toString());
+            /*Integer field1 = dao.getInsertReimbursementCountByOffice(officeInfo.getId(), beginDate, endDate);
+            comprehensiveInfo.setField1(field1.toString());*/
+            for (ReportDataEntity reportData: field1All) {
+                if(officeInfo.getId().equals(reportData.getOfficeId()) || reportData.getOfficeParentIds().contains(officeInfo.getId())){
+                    comprehensiveInfo.setField1(String.valueOf(Integer.parseInt(comprehensiveInfo.getField1()) + reportData.getCount()));
+                }
+            }
             //查询报销金额总额
-            String field2 = dao.getInsertReimbursementSumMoneyByOffice(officeInfo.getId(), beginDate, endDate);
-            comprehensiveInfo.setField2(field2);
+            /*String field2 = dao.getInsertReimbursementSumMoneyByOffice(officeInfo.getId(), beginDate, endDate);
+            comprehensiveInfo.setField2(field2);*/
+            for (ReportDataEntity reportData: field2All) {
+                if(officeInfo.getId().equals(reportData.getOfficeId()) || reportData.getOfficeParentIds().contains(officeInfo.getId())){
+                    comprehensiveInfo.setField2(String.valueOf(new BigDecimal(comprehensiveInfo.getField2()).add(new BigDecimal(reportData.getVariableElement()))));
+                }
+            }
+            //对金额数据进行处理和四舍五入
+            if(StringUtils.isNotBlank(comprehensiveInfo.getField2())){
+                BigDecimal b = new BigDecimal(comprehensiveInfo.getField2());
+                comprehensiveInfo.setField2(String.valueOf(b.setScale(2, BigDecimal.ROUND_HALF_UP)));
+            }
+
             //数据处理并保存到数据库中
             comprehensiveInfo.preInsert();
             //每次都要删除之前的数据
@@ -510,26 +732,60 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
      */
     @Transactional(readOnly = false)
     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));
-        comprehensiveInfo.setBigDateType(bigDateType.toString());
-        comprehensiveInfo.setSmallDateType(smallDateType.toString());
-        comprehensiveInfo.setStatementDate(statementDate);
+
+        //查询新增合同信息
+        List<ReportDataEntity> field1All = dao.getInsertContractCountByOfficeAll( beginDate, endDate);
+        //查询本月纸质归档合同信息
+        List<ReportDataEntity> field2All = dao.getInsertContractRecordCountByOfficeAll( beginDate, endDate);
+        //查询超期未归档合同信息
+        List<ReportDataEntity> field3All = dao.getOverDueNotContractRecordCountByOfficeAll();
+        //查询超期归档合同信息
+        List<ReportDataEntity> field4All = dao.getOverDueContractRecordCountByOfficeAll( beginDate, endDate);
+        //查询电子归档超期未归档项目数量(分组)
+        Map<String, List<ReportDataEntity>> field3AllMap = dataMessageDispose(field3All);
+        //分组
+        Map<String, List<ReportDataEntity>> field4AllMap = dataMessageDispose(field4All);
 
         for (Office officeInfo : officeList) {
+            StatementCompanyComprehensiveInfo comprehensiveInfo = new StatementCompanyComprehensiveInfo();
+            comprehensiveInfo.setType("4");
+            comprehensiveInfo.setYear(String.valueOf(year));
+            comprehensiveInfo.setBigDateType(bigDateType.toString());
+            comprehensiveInfo.setSmallDateType(smallDateType.toString());
+            comprehensiveInfo.setStatementDate(statementDate);
             comprehensiveInfo.setOfficeId(officeInfo.getId());
+
             //查询新增合同信息
-            Integer field1 = dao.getInsertContractCountByOffice(officeInfo.getId(), beginDate, endDate);
-            comprehensiveInfo.setField1(field1.toString());
+            /*Integer field1 = dao.getInsertContractCountByOffice(officeInfo.getId(), beginDate, endDate);
+            comprehensiveInfo.setField1(field1.toString());*/
+            for (ReportDataEntity reportData: field1All) {
+                if(officeInfo.getId().equals(reportData.getOfficeId()) || reportData.getOfficeParentIds().contains(officeInfo.getId())){
+                    comprehensiveInfo.setField1(String.valueOf(Integer.parseInt(comprehensiveInfo.getField1()) + reportData.getCount()));
+                }
+            }
             //查询本月纸质归档合同信息
-            Integer field2 = dao.getInsertContractRecordCountByOffice(officeInfo.getId(), beginDate, endDate);
-            comprehensiveInfo.setField2(field2.toString());
+            /*Integer field2 = dao.getInsertContractRecordCountByOffice(officeInfo.getId(), beginDate, endDate);
+            comprehensiveInfo.setField2(field2.toString());*/
+            for (ReportDataEntity reportData: field2All) {
+                if(officeInfo.getId().equals(reportData.getOfficeId()) || reportData.getOfficeParentIds().contains(officeInfo.getId())){
+                    comprehensiveInfo.setField2(String.valueOf(Integer.parseInt(comprehensiveInfo.getField2()) + reportData.getCount()));
+                }
+            }
             //查询超期未归档合同信息
-            List<String> overDueNotContractIdList = dao.getOverDueNotContractRecordCountByOffice(officeInfo.getId());
-            comprehensiveInfo.setField3(String.valueOf(overDueNotContractIdList.size()));
+            /*List<String> overDueNotContractIdList = dao.getOverDueNotContractRecordCountByOffice(officeInfo.getId());
+            comprehensiveInfo.setField3(String.valueOf(overDueNotContractIdList.size()));*/
+            List<ReportDataEntity> field3ListAll = Lists.newArrayList();
+            for (String key : field3AllMap.keySet()) {
+                if(officeInfo.getId().equals(key) || key.contains(officeInfo.getId())){
+                    List<ReportDataEntity> reportDataEntities = field3AllMap.get(key);
+                    field3ListAll.addAll(reportDataEntities);
+                    comprehensiveInfo.setField3(String.valueOf(Integer.parseInt(comprehensiveInfo.getField3()) + reportDataEntities.size()));
+                }
+            }
+
             List<StatementDataInfo> overDueNotContractList = Lists.newArrayList();
-            for (String contract : overDueNotContractIdList) {
+            for (ReportDataEntity peportDataEntity : field3ListAll) {
+                String contract = peportDataEntity.getFieldId();
                 StatementDataInfo info = new StatementDataInfo();
                 info.setStatementDate(statementDate);
                 info.setGradeType("1");
@@ -550,10 +806,19 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
             }
 
             //查询超期归档合同信息
-            List<String> overDueContractIdList = dao.getOverDueContractRecordCountByOffice(officeInfo.getId(), beginDate, endDate);
-            comprehensiveInfo.setField4(String.valueOf(overDueContractIdList.size()));
+            /*List<String> overDueContractIdList = dao.getOverDueContractRecordCountByOffice(officeInfo.getId(), beginDate, endDate);
+            comprehensiveInfo.setField4(String.valueOf(overDueContractIdList.size()));*/
+            List<ReportDataEntity> field4ListAll = Lists.newArrayList();
+            for (String key : field4AllMap.keySet()) {
+                if(officeInfo.getId().equals(key) || key.contains(officeInfo.getId())){
+                    List<ReportDataEntity> reportDataEntities = field4AllMap.get(key);
+                    field4ListAll.addAll(reportDataEntities);
+                    comprehensiveInfo.setField4(String.valueOf(Integer.parseInt(comprehensiveInfo.getField4()) + reportDataEntities.size()));
+                }
+            }
             List<StatementDataInfo> overDueContractList = Lists.newArrayList();
-            for (String contract : overDueContractIdList) {
+            for (ReportDataEntity peportDataEntity : field4ListAll) {
+                String contract = peportDataEntity.getFieldId();
                 StatementDataInfo info = new StatementDataInfo();
                 info.setStatementDate(statementDate);
                 info.setGradeType("1");
@@ -800,6 +1065,29 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
      */
     @Transactional(readOnly = false)
     public void disposeStatementOfficeProject(Integer year,String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType){
+
+        //查询新增A类项目数量
+        List<ReportDataEntity> field1All = dao.getOfficeInsertProjectCountByGradeAll("2", beginDate, endDate);
+        List<ReportDataEntity> field2All = dao.getOfficeInsertProjectCountByGradeAll( "1", beginDate, endDate);
+        List<ReportDataEntity> field3All = dao.getOfficeProjectCountByRecordAll(beginDate, endDate);
+        List<ReportDataEntity> field4All = dao.getOfficeProjectCountByReportedAll(beginDate, endDate);
+        //超期未归档
+        List<ReportDataEntity> field5All = dao.getOfficeOverDueNotRecordProjectAll();
+        //超期归档
+        List<ReportDataEntity> field6All = dao.getOfficeOverDueRecordProjectAll(beginDate, endDate);
+        //超期未上报
+        List<ReportDataEntity> field7All = dao.getOfficeOverDueNotReportedProjectAll();
+        //超期上报
+        List<ReportDataEntity> field8All = dao.getOfficeOverDueReportedProjectAll(beginDate, endDate);
+        //查询电子归档超期未归档项目数量(分组)
+        Map<String, List<ReportDataEntity>> field5AllMap = officeDataMessageDispose(field5All);
+        //分组
+        Map<String, List<ReportDataEntity>> field6AllMap = officeDataMessageDispose(field6All);
+        //分组
+        Map<String, List<ReportDataEntity>> field7AllMap = officeDataMessageDispose(field7All);
+        //分组
+        Map<String, List<ReportDataEntity>> field8AllMap = officeDataMessageDispose(field8All);
+
         //查询部门信息
         List<Office> officeList = dao.getOfficeListInfo();
         for (Office officeInfo : officeList) {
@@ -820,22 +1108,52 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                     comprehensiveInfo.setOfficeParentIds(office.getParentIds());
                     comprehensiveInfo.setUserId(user.getId());
                     //查询新增A类项目数量
-                    Integer projectCountByA = dao.getOfficeInsertProjectCountByGrade(user.getId(), "2", beginDate, endDate);
-                    comprehensiveInfo.setField1(projectCountByA.toString());
+                    /*Integer projectCountByA = dao.getOfficeInsertProjectCountByGrade(user.getId(), "2", beginDate, endDate);
+                    comprehensiveInfo.setField1(projectCountByA.toString());*/
+                    for (ReportDataEntity reportData: field1All) {
+                        if(user.getId().equals(reportData.getUserId())){
+                            comprehensiveInfo.setField1(String.valueOf(Integer.parseInt(comprehensiveInfo.getField1()) + reportData.getCount()));
+                        }
+                    }
                     //查询新增B类项目数量
-                    Integer projectCountByB = dao.getOfficeInsertProjectCountByGrade(user.getId(), "1", beginDate, endDate);
-                    comprehensiveInfo.setField2(projectCountByB.toString());
+                    /*Integer projectCountByB = dao.getOfficeInsertProjectCountByGrade(user.getId(), "1", beginDate, endDate);
+                    comprehensiveInfo.setField2(projectCountByB.toString());*/
+                    for (ReportDataEntity reportData: field2All) {
+                        if(user.getId().equals(reportData.getUserId())){
+                            comprehensiveInfo.setField2(String.valueOf(Integer.parseInt(comprehensiveInfo.getField2()) + reportData.getCount()));
+                        }
+                    }
                     //查询本月电子归档项目数量
-                    Integer getProjectCountByRecord = dao.getOfficeProjectCountByRecord(user.getId(), beginDate, endDate);
-                    comprehensiveInfo.setField3(getProjectCountByRecord.toString());
+                    /*Integer getProjectCountByRecord = dao.getOfficeProjectCountByRecord(user.getId(), beginDate, endDate);
+                    comprehensiveInfo.setField3(getProjectCountByRecord.toString());*/
+                    for (ReportDataEntity reportData: field3All) {
+                        if(user.getId().equals(reportData.getUserId())){
+                            comprehensiveInfo.setField3(String.valueOf(Integer.parseInt(comprehensiveInfo.getField3()) + reportData.getCount()));
+                        }
+                    }
                     //查询本月上报项目数量
-                    Integer getProjectCountByReported = dao.getOfficeProjectCountByReported(user.getId(), beginDate, endDate);
-                    comprehensiveInfo.setField4(getProjectCountByReported.toString());
+                    /*Integer getProjectCountByReported = dao.getOfficeProjectCountByReported(user.getId(), beginDate, endDate);
+                    comprehensiveInfo.setField4(getProjectCountByReported.toString());*/
+                    for (ReportDataEntity reportData: field4All) {
+                        if(user.getId().equals(reportData.getUserId())){
+                            comprehensiveInfo.setField4(String.valueOf(Integer.parseInt(comprehensiveInfo.getField4()) + reportData.getCount()));
+                        }
+                    }
                     //查询电子归档超期未归档项目数量(保存到数据库)
-                    List<String> overDueNotRecordProjectIdList = dao.getOfficeOverDueNotRecordProject(user.getId());
-                    comprehensiveInfo.setField5(String.valueOf(overDueNotRecordProjectIdList.size()));
+                    /*List<String> overDueNotRecordProjectIdList = dao.getOfficeOverDueNotRecordProject(user.getId());
+                    comprehensiveInfo.setField5(String.valueOf(overDueNotRecordProjectIdList.size()));*/
+
+                    List<ReportDataEntity> field5ListAll = Lists.newArrayList();
+                    for (String key : field5AllMap.keySet()) {
+                        if(user.getId().equals(key)){
+                            List<ReportDataEntity> reportDataEntities = field5AllMap.get(key);
+                            field5ListAll.addAll(reportDataEntities);
+                            comprehensiveInfo.setField5(String.valueOf(Integer.parseInt(comprehensiveInfo.getField5()) + reportDataEntities.size()));
+                        }
+                    }
+
                     List<StatementDataInfo> overDueNotRecordProjectList = Lists.newArrayList();
-                    for (String projectId : overDueNotRecordProjectIdList) {
+                    for (ReportDataEntity reportDataEntity : field5ListAll) {
                         StatementDataInfo info = new StatementDataInfo();
                         info.setStatementDate(statementDate);
                         info.setGradeType("1");
@@ -844,7 +1162,7 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                         info.setBigDateType(bigDateType.toString());
                         info.setSmallDateType(smallDateType.toString());
                         info.setOfficeId(user.getOffice().getId());
-                        info.setField1(projectId);
+                        info.setField1(reportDataEntity.getFieldId());
                         info.setUserId(user.getId());
                         info.setOfficeParentIds(office.getParentIds());
                         overDueNotRecordProjectList.add(info);
@@ -857,10 +1175,18 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                         dao.insertOfficeStatementDataInfo(overDueNotRecordProjectList);
                     }
                     //查询电子归档超期归档项目数量(保存到数据库)
-                    List<String> overDueRecordProjectIdList = dao.getOfficeOverDueRecordProject(user.getId(), beginDate, endDate);
-                    comprehensiveInfo.setField6(String.valueOf(overDueRecordProjectIdList.size()));
+                    /*List<String> overDueRecordProjectIdList = dao.getOfficeOverDueRecordProject(user.getId(), beginDate, endDate);
+                    comprehensiveInfo.setField6(String.valueOf(overDueRecordProjectIdList.size()));*/
+                    List<ReportDataEntity> field6ListAll = Lists.newArrayList();
+                    for (String key : field6AllMap.keySet()) {
+                        if(user.getId().equals(key)){
+                            List<ReportDataEntity> reportDataEntities = field6AllMap.get(key);
+                            field6ListAll.addAll(reportDataEntities);
+                            comprehensiveInfo.setField6(String.valueOf(Integer.parseInt(comprehensiveInfo.getField6()) + reportDataEntities.size()));
+                        }
+                    }
                     List<StatementDataInfo> overDueRecordProjectList = Lists.newArrayList();
-                    for (String projectId : overDueRecordProjectIdList) {
+                    for (ReportDataEntity reportDataEntity : field6ListAll) {
                         StatementDataInfo info = new StatementDataInfo();
                         info.setStatementDate(statementDate);
                         info.setGradeType("1");
@@ -869,7 +1195,7 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                         info.setBigDateType(bigDateType.toString());
                         info.setSmallDateType(smallDateType.toString());
                         info.setOfficeId(user.getOffice().getId());
-                        info.setField2(projectId);
+                        info.setField2(reportDataEntity.getFieldId());
                         info.setUserId(user.getId());
                         info.setOfficeParentIds(office.getParentIds());
                         overDueRecordProjectList.add(info);
@@ -882,10 +1208,18 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                         dao.insertOfficeStatementDataInfo(overDueRecordProjectList);
                     }
                     //查询上报超期未上报项目数量(保存到数据库)
-                    List<String> overDueNotReportedProjectIdList = dao.getOfficeOverDueNotReportedProject(user.getId());
-                    comprehensiveInfo.setField7(String.valueOf(overDueNotReportedProjectIdList.size()));
+                    /*List<String> overDueNotReportedProjectIdList = dao.getOfficeOverDueNotReportedProject(user.getId());
+                    comprehensiveInfo.setField7(String.valueOf(overDueNotReportedProjectIdList.size()));*/
+                    List<ReportDataEntity> field7ListAll = Lists.newArrayList();
+                    for (String key : field7AllMap.keySet()) {
+                        if(user.getId().equals(key)){
+                            List<ReportDataEntity> reportDataEntities = field7AllMap.get(key);
+                            field7ListAll.addAll(reportDataEntities);
+                            comprehensiveInfo.setField7(String.valueOf(Integer.parseInt(comprehensiveInfo.getField7()) + reportDataEntities.size()));
+                        }
+                    }
                     List<StatementDataInfo> overDueNotReportedProjectList = Lists.newArrayList();
-                    for (String projectId : overDueNotReportedProjectIdList) {
+                    for (ReportDataEntity reportDataEntity : field7ListAll) {
                         StatementDataInfo info = new StatementDataInfo();
                         info.setStatementDate(statementDate);
                         info.setGradeType("1");
@@ -894,7 +1228,7 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                         info.setBigDateType(bigDateType.toString());
                         info.setSmallDateType(smallDateType.toString());
                         info.setOfficeId(user.getOffice().getId());
-                        info.setField3(projectId);
+                        info.setField3(reportDataEntity.getFieldId());
                         info.setUserId(user.getId());
                         info.setOfficeParentIds(office.getParentIds());
                         overDueNotReportedProjectList.add(info);
@@ -907,10 +1241,18 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                         dao.insertOfficeStatementDataInfo(overDueNotReportedProjectList);
                     }
                     //查询上报超期上报项目数量(保存到数据库)
-                    List<String> overDueReportedProjectIdList = dao.getOfficeOverDueReportedProject(user.getId(), beginDate, endDate);
-                    comprehensiveInfo.setField8(String.valueOf(overDueReportedProjectIdList.size()));
+                    /*List<String> overDueReportedProjectIdList = dao.getOfficeOverDueReportedProject(user.getId(), beginDate, endDate);
+                    comprehensiveInfo.setField8(String.valueOf(overDueReportedProjectIdList.size()));*/
+                    List<ReportDataEntity> field8ListAll = Lists.newArrayList();
+                    for (String key : field8AllMap.keySet()) {
+                        if(user.getId().equals(key)){
+                            List<ReportDataEntity> reportDataEntities = field8AllMap.get(key);
+                            field8ListAll.addAll(reportDataEntities);
+                            comprehensiveInfo.setField8(String.valueOf(Integer.parseInt(comprehensiveInfo.getField8()) + reportDataEntities.size()));
+                        }
+                    }
                     List<StatementDataInfo> overDueReportedProjectList = Lists.newArrayList();
-                    for (String projectId : overDueReportedProjectIdList) {
+                    for (ReportDataEntity reportDataEntity : field8ListAll) {
                         StatementDataInfo info = new StatementDataInfo();
                         info.setStatementDate(statementDate);
                         info.setGradeType("1");
@@ -919,7 +1261,7 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                         info.setBigDateType(bigDateType.toString());
                         info.setSmallDateType(smallDateType.toString());
                         info.setOfficeId(user.getOffice().getId());
-                        info.setField4(projectId);
+                        info.setField4(reportDataEntity.getFieldId());
                         info.setUserId(user.getId());
                         info.setOfficeParentIds(office.getParentIds());
                         overDueReportedProjectList.add(info);
@@ -953,6 +1295,11 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
     @Transactional(readOnly = false)
     public void disposeStatementOfficeInvoice(Integer year,String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType,List<Office> officeList){
 
+        List<ReportDataEntity> field1All = dao.getInsertOfficeInvoiceCountByOfficeAll(beginDate, endDate);
+        List<ReportDataEntity> field2All = dao.getInsertOfficeInvoiceSumMoneyByOfficeAll(beginDate, endDate);
+        List<ReportDataEntity> field3All = dao.getInsertOfficeInvoiceDetailsCountByOfficeAll(beginDate, endDate);
+        List<ReportDataEntity> field4All = dao.getInsertOfficeInvoiceDetailsSumMoneyByOfficeAll(beginDate, endDate);
+
         for (Office officeInfo : officeList) {
             //查询该部门的所有子部门
             List<Office> childOfficeList = dao.getChildOfficeList(officeInfo.getId());
@@ -971,17 +1318,46 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                     comprehensiveInfo.setOfficeParentIds(office.getParentIds());
                     comprehensiveInfo.setUserId(user.getId());
                     //查询新增发票信息
-                    Integer field1 = dao.getInsertOfficeInvoiceCountByOffice(user.getId(), beginDate, endDate);
-                    comprehensiveInfo.setField1(field1.toString());
+                    /*Integer field1 = dao.getInsertOfficeInvoiceCountByOffice(user.getId(), beginDate, endDate);
+                    comprehensiveInfo.setField1(field1.toString());*/
+                    for (ReportDataEntity reportData: field1All) {
+                        if(user.getId().equals(reportData.getUserId())){
+                            comprehensiveInfo.setField1(String.valueOf(Integer.parseInt(comprehensiveInfo.getField1()) + reportData.getCount()));
+                        }
+                    }
                     //查询开票金额总额
-                    String field2 = dao.getInsertOfficeInvoiceSumMoneyByOffice(user.getId(), beginDate, endDate);
-                    comprehensiveInfo.setField2(field2);
+                    /*String field2 = dao.getInsertOfficeInvoiceSumMoneyByOffice(user.getId(), beginDate, endDate);
+                    comprehensiveInfo.setField2(field2);*/
+                    for (ReportDataEntity reportData: field2All) {
+                        if(user.getId().equals(reportData.getUserId())){
+                            comprehensiveInfo.setField2(String.valueOf(new BigDecimal(comprehensiveInfo.getField2()).add(new BigDecimal(reportData.getVariableElement()))));
+                        }
+                    }
                     //查询本月收款发票
-                    Integer field3 = dao.getInsertOfficeInvoiceDetailsCountByOffice(user.getId(), beginDate, endDate);
-                    comprehensiveInfo.setField3(field3.toString());
+                    /*Integer field3 = dao.getInsertOfficeInvoiceDetailsCountByOffice(user.getId(), beginDate, endDate);
+                    comprehensiveInfo.setField3(field3.toString());*/
+                    for (ReportDataEntity reportData: field3All) {
+                        if(user.getId().equals(reportData.getUserId())){
+                            comprehensiveInfo.setField3(String.valueOf(Integer.parseInt(comprehensiveInfo.getField3()) + reportData.getCount()));
+                        }
+                    }
                     //查询本月收款
-                    String field4 = dao.getInsertOfficeInvoiceDetailsSumMoneyByOffice(user.getId(), beginDate, endDate);
-                    comprehensiveInfo.setField4(field4);
+                    /*String field4 = dao.getInsertOfficeInvoiceDetailsSumMoneyByOffice(user.getId(), beginDate, endDate);
+                    comprehensiveInfo.setField4(field4);*/
+                    for (ReportDataEntity reportData: field4All) {
+                        if(user.getId().equals(reportData.getUserId())){
+                            comprehensiveInfo.setField4(String.valueOf(new BigDecimal(comprehensiveInfo.getField4()).add(new BigDecimal(reportData.getVariableElement()))));
+                        }
+                    }
+                    //对金额数据进行处理和四舍五入
+                    if(StringUtils.isNotBlank(comprehensiveInfo.getField2())){
+                        BigDecimal b = new BigDecimal(comprehensiveInfo.getField2());
+                        comprehensiveInfo.setField2(String.valueOf(b.setScale(2, BigDecimal.ROUND_HALF_UP)));
+                    }
+                    if(StringUtils.isNotBlank(comprehensiveInfo.getField4())){
+                        BigDecimal b = new BigDecimal(comprehensiveInfo.getField4());
+                        comprehensiveInfo.setField4(String.valueOf(b.setScale(2, BigDecimal.ROUND_HALF_UP)));
+                    }
 
                     //数据处理并保存到数据库中
                     comprehensiveInfo.preInsert();
@@ -1003,6 +1379,9 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
     @Transactional(readOnly = false)
     public void disposeStatementOfficeReimbursement(Integer year,String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType,List<Office> officeList){
 
+        List<ReportDataEntity> field1All = dao.getInsertOfficeReimbursementCountByOfficeAll(beginDate, endDate);
+        List<ReportDataEntity> field2All = dao.getInsertOfficeReimbursementSumMoneyByOfficeAll(beginDate, endDate);
+
         for (Office officeInfo : officeList) {
             //查询该部门的所有子部门
             List<Office> childOfficeList = dao.getChildOfficeList(officeInfo.getId());
@@ -1021,11 +1400,26 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                     comprehensiveInfo.setOfficeParentIds(office.getParentIds());
                     comprehensiveInfo.setUserId(user.getId());
                     //查询新增报销信息
-                    Integer field1 = dao.getInsertOfficeReimbursementCountByOffice(user.getId(), beginDate, endDate);
-                    comprehensiveInfo.setField1(field1.toString());
+                    /*Integer field1 = dao.getInsertOfficeReimbursementCountByOffice(user.getId(), beginDate, endDate);
+                    comprehensiveInfo.setField1(field1.toString());*/
+                    for (ReportDataEntity reportData: field1All) {
+                        if(user.getId().equals(reportData.getUserId())){
+                            comprehensiveInfo.setField1(String.valueOf(Integer.parseInt(comprehensiveInfo.getField1()) + reportData.getCount()));
+                        }
+                    }
                     //查询报销金额总额
-                    String field2 = dao.getInsertOfficeReimbursementSumMoneyByOffice(user.getId(), beginDate, endDate);
-                    comprehensiveInfo.setField2(field2);
+                    /*String field2 = dao.getInsertOfficeReimbursementSumMoneyByOffice(user.getId(), beginDate, endDate);
+                    comprehensiveInfo.setField2(field2);*/
+                    for (ReportDataEntity reportData: field2All) {
+                        if(user.getId().equals(reportData.getUserId())){
+                            comprehensiveInfo.setField2(String.valueOf(new BigDecimal(comprehensiveInfo.getField2()).add(new BigDecimal(reportData.getVariableElement()))));
+                        }
+                    }
+                    //对金额数据进行处理和四舍五入
+                    if(StringUtils.isNotBlank(comprehensiveInfo.getField2())){
+                        BigDecimal b = new BigDecimal(comprehensiveInfo.getField2());
+                        comprehensiveInfo.setField2(String.valueOf(b.setScale(2, BigDecimal.ROUND_HALF_UP)));
+                    }
                     //数据处理并保存到数据库中
                     comprehensiveInfo.preInsert();
                     //每次删除对应条件的数据   比部门多了userId
@@ -1045,6 +1439,16 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
     @Transactional(readOnly = false)
     public void disposeStatementOfficeContract(Integer year,String beginDate,String endDate,String statementDate,Integer bigDateType,Integer smallDateType,List<Office> officeList){
 
+        List<ReportDataEntity> field1All = dao.getInsertOfficeContractCountByOfficeAll(beginDate, endDate);
+        List<ReportDataEntity> field2All = dao.getInsertOfficeContractRecordCountByOfficeAll(beginDate, endDate);
+        List<ReportDataEntity> field3All = dao.getOfficeOverDueNotContractRecordCountByOfficeAll();
+        List<ReportDataEntity> field4All = dao.getOfficeOverDueContractRecordCountByOfficeAll(beginDate, endDate);
+
+        //查询电子归档超期未归档项目数量(分组)
+        Map<String, List<ReportDataEntity>> field3AllMap = officeDataMessageDispose(field3All);
+        //分组
+        Map<String, List<ReportDataEntity>> field4AllMap = officeDataMessageDispose(field4All);
+
         for (Office officeInfo : officeList) {//查询该部门的所有子部门
             List<Office> childOfficeList = dao.getChildOfficeList(officeInfo.getId());
             for (Office office : childOfficeList) {
@@ -1062,16 +1466,34 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                     comprehensiveInfo.setOfficeParentIds(office.getParentIds());
                     comprehensiveInfo.setUserId(user.getId());
                     //查询新增合同信息
-                    Integer field1 = dao.getInsertOfficeContractCountByOffice(user.getId(), beginDate, endDate);
-                    comprehensiveInfo.setField1(field1.toString());
+                    /*Integer field1 = dao.getInsertOfficeContractCountByOffice(user.getId(), beginDate, endDate);
+                    comprehensiveInfo.setField1(field1.toString());*/
+                    for (ReportDataEntity reportData: field1All) {
+                        if(user.getId().equals(reportData.getUserId())){
+                            comprehensiveInfo.setField1(String.valueOf(Integer.parseInt(comprehensiveInfo.getField1()) + reportData.getCount()));
+                        }
+                    }
                     //查询本月纸质归档合同信息
-                    Integer field2 = dao.getInsertOfficeContractRecordCountByOffice(user.getId(), beginDate, endDate);
-                    comprehensiveInfo.setField2(field2.toString());
+                    /*Integer field2 = dao.getInsertOfficeContractRecordCountByOffice(user.getId(), beginDate, endDate);
+                    comprehensiveInfo.setField2(field2.toString());*/
+                    for (ReportDataEntity reportData: field2All) {
+                        if(user.getId().equals(reportData.getUserId())){
+                            comprehensiveInfo.setField2(String.valueOf(Integer.parseInt(comprehensiveInfo.getField2()) + reportData.getCount()));
+                        }
+                    }
                     //查询超期未归档合同信息
-                    List<String> overDueNotContractIdList = dao.getOfficeOverDueNotContractRecordCountByOffice(user.getId());
-                    comprehensiveInfo.setField3(String.valueOf(overDueNotContractIdList.size()));
+                    /*List<String> overDueNotContractIdList = dao.getOfficeOverDueNotContractRecordCountByOffice(user.getId());
+                    comprehensiveInfo.setField3(String.valueOf(overDueNotContractIdList.size()));*/
+                    List<ReportDataEntity> field3ListAll = Lists.newArrayList();
+                    for (String key : field3AllMap.keySet()) {
+                        if(user.getId().equals(key)){
+                            List<ReportDataEntity> reportDataEntities = field3AllMap.get(key);
+                            field3ListAll.addAll(reportDataEntities);
+                            comprehensiveInfo.setField3(String.valueOf(Integer.parseInt(comprehensiveInfo.getField3()) + reportDataEntities.size()));
+                        }
+                    }
                     List<StatementDataInfo> overDueNotContractList = Lists.newArrayList();
-                    for (String contract : overDueNotContractIdList) {
+                    for (ReportDataEntity reportDataEntity : field3ListAll) {
                         StatementDataInfo info = new StatementDataInfo();
                         info.setStatementDate(statementDate);
                         info.setGradeType("1");
@@ -1082,7 +1504,7 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                         info.setOfficeId(officeInfo.getId());
                         info.setUserId(user.getId());
                         info.setOfficeParentIds(office.getParentIds());
-                        info.setField1(contract);
+                        info.setField1(reportDataEntity.getFieldId());
                         overDueNotContractList.add(info);
                     }
                     if(overDueNotContractList.size()>0){
@@ -1094,10 +1516,18 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                     }
 
                     //查询超期归档合同信息
-                    List<String> overDueContractIdList = dao.getOfficeOverDueContractRecordCountByOffice(user.getId(), beginDate, endDate);
-                    comprehensiveInfo.setField4(String.valueOf(overDueContractIdList.size()));
+                    /*List<String> overDueContractIdList = dao.getOfficeOverDueContractRecordCountByOffice(user.getId(), beginDate, endDate);
+                    comprehensiveInfo.setField4(String.valueOf(overDueContractIdList.size()));*/
+                    List<ReportDataEntity> field4ListAll = Lists.newArrayList();
+                    for (String key : field4AllMap.keySet()) {
+                        if(user.getId().equals(key)){
+                            List<ReportDataEntity> reportDataEntities = field4AllMap.get(key);
+                            field4ListAll.addAll(reportDataEntities);
+                            comprehensiveInfo.setField4(String.valueOf(Integer.parseInt(comprehensiveInfo.getField4()) + reportDataEntities.size()));
+                        }
+                    }
                     List<StatementDataInfo> overDueContractList = Lists.newArrayList();
-                    for (String contract : overDueContractIdList) {
+                    for (ReportDataEntity reportDataEntity : field4ListAll) {
                         StatementDataInfo info = new StatementDataInfo();
                         info.setStatementDate(statementDate);
                         info.setGradeType("1");
@@ -1108,7 +1538,7 @@ public class StatementCompanyComprehensiveService extends CrudService<StatementC
                         info.setOfficeId(officeInfo.getId());
                         info.setUserId(user.getId());
                         info.setOfficeParentIds(office.getParentIds());
-                        info.setField2(contract);
+                        info.setField2(reportDataEntity.getFieldId());
                         overDueContractList.add(info);
                     }
                     if(overDueContractList.size()>0){

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

@@ -146,7 +146,7 @@ public class WorkCalendarTaskService  {
      * 月度报表
      */
     //每个月最后一天晚上23点推送
-    //@Scheduled(cron= "0 0 23 28-31 * ?")
+    @Scheduled(cron= "0 0 23 28-31 * ?")
     //@Scheduled(cron= "0 0/2 * * * ?")
     @Transactional(readOnly = false)
     public void getStatementCompanyComprehensiveOnMonth() {
@@ -154,17 +154,17 @@ public class WorkCalendarTaskService  {
         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)){
+        if (c.get(Calendar.DATE) == c.getActualMaximum(Calendar.DATE)){
 
             Integer month = c.get(Calendar.MONTH)+1; //第一个月从0开始,所以得到月份+1
             //当月最后一天
             logger.info("-----------公司级—月度报表(开始)------------------");
-            statementCompanyComprehensiveService.disposeStatementCompany(2021,2,12);
+            statementCompanyComprehensiveService.disposeStatementCompany(year,2,month);
             logger.info("------------公司级—月度报表(结束)------------------");
             logger.info("-----------部门级—月度报表(开始)------------------");
-            statementCompanyComprehensiveService.disposeStatementOffice(2021,2,12);
+            statementCompanyComprehensiveService.disposeStatementOffice(year,2,month);
             logger.info("------------部门级—月度报表(结束)------------------");
-        //}
+        }
 
     }
 
@@ -172,7 +172,7 @@ public class WorkCalendarTaskService  {
      * 季度报表
      */
     //每个季度最后一天晚上23点推送
-    //@Scheduled(cron= "0 0 23 28-31 3,6,9,12 ?")
+    @Scheduled(cron= "0 0 23 28-31 3,6,9,12 ?")
     //@Scheduled(cron= "0 0/2 * * * ?")
     @Transactional(readOnly = false)
     public void getStatementCompanyComprehensiveOnQuarter() {
@@ -180,32 +180,32 @@ public class WorkCalendarTaskService  {
         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(2021,1,4);
+            statementCompanyComprehensiveService.disposeStatementCompany(year,1,quarter);
             logger.info("------------公司级—季度报表(结束)------------------");
             logger.info("-----------部门级—季度报表(开始)------------------");
-            statementCompanyComprehensiveService.disposeStatementOffice(2021,1,4);
+            statementCompanyComprehensiveService.disposeStatementOffice(year,1,quarter);
             logger.info("------------部门级—季度报表(结束)------------------");
-        //}
+        }
     }
 
     /**
      * 年度报表
      */
     //每年最后一天晚上23点推送
-    //@Scheduled(cron= "0 0 23 31 12 ?")
-   // @Scheduled(cron= "0 0/2 * * * ?")
+    @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(2021,0,0);
+        statementCompanyComprehensiveService.disposeStatementCompany(year,0,0);
         logger.info("------------公司级—年度报表(结束)------------------");
         logger.info("-----------部门级—年度报表(开始)------------------");
-        statementCompanyComprehensiveService.disposeStatementOffice(2021,0,0);
+        statementCompanyComprehensiveService.disposeStatementOffice(year,0,0);
         logger.info("------------部门级—年度报表(结束)------------------");
     }
 

+ 10 - 1
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectMessageDao.xml

@@ -379,7 +379,16 @@
 		FROM rural_project_records a
 		LEFT JOIN sys_area area ON area.id = a.area_id
 		left join rural_project_records_reported rprr on rprr.id = a.id
-		LEFT JOIN project_flingbatch_relation pfp on pfp.project_id=a.id
+		/*LEFT JOIN project_flingbatch_relation pfp on pfp.project_id=a.id*/
+		left join
+		(select id,status,project_id,filing_batch from
+		(
+		select id,create_date,status,project_id,filing_batch
+		from project_flingbatch_relation order by create_date desc
+		)z
+		group by z.project_id desc
+		) pfp ON pfp.project_id = a.id
+
 		LEFT JOIN project_filingbatch pfb on pfb.id=pfp.filing_batch
 		LEFT JOIN sys_user sua on a.create_by = sua.id
         <if test="leaderNameStr !=null and leaderNameStr !=''">

+ 2 - 1
src/main/resources/mappings/modules/ruralprojectrecords/RuralProjectRecordsDao.xml

@@ -293,6 +293,7 @@
 			<include refid="projectRecordsColumnss"/>
 		,a.record_state as "recordState"
 		,a.submit_money as "submitMoney"
+		,a.submit_scale as "submitScale"
 		,(case when a.submit_money = '1' then 'B级' when a.submit_money = '2' then 'A级' else '' end) as projectScale
 		,(case
 		when a.submit_money = '1' and prd.status = '5' then
@@ -2793,7 +2794,7 @@
 			and big_date_type = #{bigDateType}
 			and small_date_type = #{smallDateType}
 			and office_id = #{officeId}
-			<if test="field5 == '5'.toString() ">
+			<if test="field5 == '5'.toString()">
 				and field1 IS NOT NULL and field1 != ''
 			</if>
 			<if test="field6 == '5'.toString() ">

+ 479 - 1
src/main/resources/mappings/modules/statement/StatementCompanyComprehensiveDao.xml

@@ -168,6 +168,19 @@
 		</where>
 	</select>
 
+	<select id="getInsertProjectCountByGradeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",so.parent_ids as "officeParentIds",count(1) as "count" from rural_project_records a
+		left join sys_office so on so.id = a.office_id
+		<where>
+			a.del_flag=0
+			and a.status = 5
+			and a.submit_money = #{grade}
+			and a.create_date >= #{beginDate}
+			and a.create_date &lt;= #{endDate}
+		</where>
+		group by a.office_id
+	</select>
+
 	<select id="getProjectCountByRecord" resultType="java.lang.Integer">
 		select count(1) from rural_project_records a
 		left join project_report_data prd on a.id = prd.project_id
@@ -184,6 +197,23 @@
 		</where>
 	</select>
 
+	<select id="getProjectCountByRecordAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",so.parent_ids as "officeParentIds",count(1) as "count" from rural_project_records a
+		left join project_report_data prd on a.id = prd.project_id
+		left join rural_project_report_record rprr on prd.id = rprr.report_id
+		left join sys_office so on so.id = a.office_id
+		<where>
+			a.del_flag=0
+			and a.record_state = 5
+			and a.over_record_status = 0
+			and rprr.status = 5
+			and rprr.del_flag = 0
+			and rprr.accomplish_date >= #{beginDate}
+			and rprr.accomplish_date &lt;= #{endDate}
+		</where>
+		group by a.office_id
+	</select>
+
 	<select id="getOverDueNotRecordProject" resultType="java.lang.String">
 		select id from rural_project_records a
 		<where>
@@ -194,6 +224,16 @@
 		</where>
 	</select>
 
+	<select id="getOverDueNotRecordProjectAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.id as "fieldId",a.office_id as "officeId",so.parent_ids as "officeParentIds" from rural_project_records a
+		left join sys_office so on so.id = a.office_id
+		<where>
+			a.del_flag=0
+			and a.record_state = 6
+			and a.over_record_status = 1
+		</where>
+	</select>
+
 	<select id="getOverDueRecordProject" resultType="java.lang.String">
 		select a.id from rural_project_records a
 		left join project_report_data prd on a.id = prd.project_id
@@ -210,6 +250,22 @@
 		</where>
 	</select>
 
+	<select id="getOverDueRecordProjectAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.id as "fieldId",a.office_id as "officeId",so.parent_ids as "officeParentIds" from rural_project_records a
+		left join sys_office so on so.id = a.office_id
+		left join project_report_data prd on a.id = prd.project_id
+		left join rural_project_report_record rprr on prd.id = rprr.report_id
+		<where>
+			a.del_flag=0
+			and a.record_state = 7
+			and a.over_record_status = 1
+			and rprr.status = 5
+			and rprr.del_flag = 0
+			and rprr.accomplish_date >= #{beginDate}
+			and rprr.accomplish_date &lt;= #{endDate}
+		</where>
+	</select>
+
 	<select id="getOverDueNotReportedProject" resultType="java.lang.String">
 		select a.id from rural_project_records a
 		<where>
@@ -220,6 +276,16 @@
 		</where>
 	</select>
 
+	<select id="getOverDueNotReportedProjectAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.id as "fieldId",a.office_id as "officeId",so.parent_ids as "officeParentIds" from rural_project_records a
+		left join sys_office so on so.id = a.office_id
+		<where>
+			a.del_flag=0
+			and a.reported_state != 7
+			and a.over_due_status = 1
+		</where>
+	</select>
+
 	<select id="getOverDueReportedProject" resultType="java.lang.String">
 		select a.id from rural_project_records a
 		left join project_report_data prd on a.id = prd.project_id
@@ -236,6 +302,22 @@
 		</where>
 	</select>
 
+	<select id="getOverDueReportedProjectAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.id as "fieldId",a.office_id as "officeId",so.parent_ids as "officeParentIds" from rural_project_records a
+		left join sys_office so on so.id = a.office_id
+		left join project_report_data prd on a.id = prd.project_id
+		left join rural_project_records_reported rprr on prd.id = rprr.id
+		<where>
+			a.del_flag=0
+			and a.reported_state = 7
+			and a.over_due_status = 1
+			and rprr.report_status = 5
+			and rprr.del_flag = 0
+			and rprr.accomplish_date >= #{beginDate}
+			and rprr.accomplish_date &lt;= #{endDate}
+		</where>
+	</select>
+
 	<select id="getProjectCountByReported" resultType="java.lang.Integer">
 		select count(1) from rural_project_records a
 		left join rural_project_records_reported rprr on a.id = rprr.id
@@ -251,6 +333,22 @@
 		</where>
 	</select>
 
+	<select id="getProjectCountByReportedAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",so.parent_ids as "officeParentIds",count(1) as "count" from rural_project_records a
+		left join rural_project_records_reported rprr on a.id = rprr.id
+		left join sys_office so on so.id = a.office_id
+		<where>
+			a.del_flag=0
+			and a.reported_state = 5
+			and a.over_due_status = 0
+			and rprr.report_status = 5
+			and rprr.del_flag = 0
+			and rprr.accomplish_date >= #{beginDate}
+			and rprr.accomplish_date &lt;= #{endDate}
+		</where>
+		group by a.office_id
+	</select>
+
 
 
 	<select id="getInsertInvoiceCountByOffice" resultType="java.lang.Integer">
@@ -264,6 +362,18 @@
 		</where>
 	</select>
 
+	<select id="getInsertInvoiceCountByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",so.parent_ids as "officeParentIds",count(1) as "count" from work_invoice a
+		left join sys_office so on so.id = a.office_id
+		<where>
+			a.del_flag=0
+			and a.invoice_state = 5
+			and a.invoice_date >= #{beginDate}
+			and a.invoice_date &lt;= #{endDate}
+		</where>
+		group by a.office_id
+	</select>
+
 	<select id="getInsertInvoiceSumMoneyByOffice" resultType="java.lang.String">
 		select ifnull(round(sum(money),2),0) from work_invoice a
 		<where>
@@ -275,6 +385,19 @@
 		</where>
 	</select>
 
+	<select id="getInsertInvoiceSumMoneyByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",so.parent_ids as "officeParentIds",ifnull(round(sum(money),2),0) as 'variableElement'
+		from work_invoice a
+		left join sys_office so on so.id = a.office_id
+		<where>
+			a.del_flag=0
+			and a.invoice_state = 5
+			and a.invoice_date >= #{beginDate}
+			and a.invoice_date &lt;= #{endDate}
+		</where>
+		group by a.office_id
+	</select>
+
 	<select id="getInsertInvoiceDetailsCountByOffice" resultType="java.lang.Integer">
 		select count(1) from work_invoice_detail a
 		left join work_invoice wi on a.invoice_id = wi.id
@@ -289,6 +412,21 @@
 		</where>
 	</select>
 
+	<select id="getInsertInvoiceDetailsCountByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",so.parent_ids as "officeParentIds",count(1) as "count" from work_invoice_detail a
+		left join work_invoice wi on a.invoice_id = wi.id
+		left join sys_office so on so.id = a.office_id
+		<where>
+			wi.del_flag=0
+			and a.del_flag=0
+			and wi.invoice_state = 5
+			and wi.receipt_money = '1'
+			and wi.receipt_money_date >= #{beginDate}
+			and wi.receipt_money_date &lt;= #{endDate}
+		</where>
+		group by wi.office_id
+	</select>
+
 	<select id="getInsertInvoiceDetailsSumMoneyByOffice" resultType="java.lang.String">
 		select ifnull(round(sum(a.total_money),2),0) from work_invoice_detail a
 		left join work_invoice wi on a.invoice_id = wi.id
@@ -303,6 +441,22 @@
 		</where>
 	</select>
 
+	<select id="getInsertInvoiceDetailsSumMoneyByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",so.parent_ids as "officeParentIds",ifnull(round(sum(a.total_money),2),0) as 'variableElement'
+		from work_invoice_detail a
+		left join work_invoice wi on a.invoice_id = wi.id
+		left join sys_office so on so.id = a.office_id
+		<where>
+			wi.del_flag=0
+			and a.del_flag=0
+			and wi.invoice_state = 5
+			and wi.receipt_money = '1'
+			and wi.receipt_money_date >= #{beginDate}
+			and wi.receipt_money_date &lt;= #{endDate}
+		</where>
+		group by wi.office_id
+	</select>
+
 	<select id="getInsertReimbursementCountByOffice" resultType="java.lang.Integer">
 		select count(1) from work_reimbursement a
 		<where>
@@ -314,6 +468,18 @@
 		</where>
 	</select>
 
+	<select id="getInsertReimbursementCountByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",so.parent_ids as "officeParentIds",count(1) as "count" from work_reimbursement a
+		left join sys_office so on so.id = a.office_id
+		<where>
+			and a.del_flag=0
+			and a.status = 5
+			and a.accomplish_date >= #{beginDate}
+			and a.accomplish_date &lt;= #{endDate}
+		</where>
+		group by a.office_id
+	</select>
+
 	<select id="getInsertReimbursementSumMoneyByOffice" resultType="java.lang.String">
 		select ifnull(round(sum(a.money),2),0) from work_reimbursement a
 		<where>
@@ -325,6 +491,19 @@
 		</where>
 	</select>
 
+	<select id="getInsertReimbursementSumMoneyByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",so.parent_ids as "officeParentIds",ifnull(round(sum(a.money),2),0) as 'variableElement'
+		from work_reimbursement a
+		left join sys_office so on so.id = a.office_id
+		<where>
+			a.del_flag=0
+			and a.status = 5
+			and a.accomplish_date >= #{beginDate}
+			and a.accomplish_date &lt;= #{endDate}
+		</where>
+		group by a.office_id
+	</select>
+
 	<select id="getInsertContractCountByOffice" resultType="java.lang.Integer">
 		select count(1) from work_contract_info a
 		<where>
@@ -336,6 +515,18 @@
 		</where>
 	</select>
 
+	<select id="getInsertContractCountByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",so.parent_ids as "officeParentIds",count(1) as "count" from work_contract_info a
+		left join sys_office so on so.id = a.office_id
+		<where>
+			and a.del_flag=0
+			and a.contract_state = 5
+			and a.accomplish_date >= #{beginDate}
+			and a.accomplish_date &lt;= #{endDate}
+		</where>
+		group by a.office_id
+	</select>
+
 	<select id="getInsertContractRecordCountByOffice" 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
@@ -350,6 +541,21 @@
 		</where>
 	</select>
 
+	<select id="getInsertContractRecordCountByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",so.parent_ids as "officeParentIds",count(1) as "count" from work_contract_info a
+		left join work_contract_record wcr on wcr.contract_info_id = a.id
+		left join sys_office so on so.id = a.office_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 wcr.accomplish_date >= #{beginDate}
+			and wcr.accomplish_date &lt;= #{endDate}
+		</where>
+		group by a.office_id
+	</select>
+
 	<select id="getOverDueNotContractRecordCountByOffice" resultType="java.lang.String">
 		select a.id from work_contract_info a
 		<where>
@@ -361,6 +567,17 @@
 		</where>
 	</select>
 
+	<select id="getOverDueNotContractRecordCountByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.id as "fieldId",a.office_id as "officeId",so.parent_ids as "officeParentIds" from work_contract_info a
+		left join sys_office so on so.id = a.office_id
+		<where>
+			and a.del_flag=0
+			and a.contract_state = 5
+			and a.contract_record_state != 7
+			and a.over_due_status = 1
+		</where>
+	</select>
+
 	<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
@@ -375,6 +592,21 @@
 		</where>
 	</select>
 
+	<select id="getOverDueContractRecordCountByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.id as "fieldId",a.office_id as "officeId",so.parent_ids as "officeParentIds" from work_contract_info a
+		left join work_contract_record wcr on wcr.contract_info_id = a.id
+		left join sys_office so on so.id = a.office_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 wcr.accomplish_date >= #{beginDate}
+			and wcr.accomplish_date &lt;= #{endDate}
+		</where>
+		group by a.office_id
+	</select>
+
 	<insert id="insertStatementDataInfo">
 		INSERT INTO statement_data_info
 		(
@@ -461,6 +693,20 @@
 		</where>
 	</select>
 
+	<select id="getOfficeInsertProjectCountByGradeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",a.create_by as "userId",so.parent_ids as "officeParentIds",count(1) as "count"
+		from rural_project_records a
+		left join sys_office so on so.id = a.office_id
+		<where>
+			a.del_flag=0
+			and a.status = 5
+			and a.submit_money = #{grade}
+			and a.create_date >= #{beginDate}
+			and a.create_date &lt;= #{endDate}
+		</where>
+		group by a.create_by
+	</select>
+
 
 	<select id="getOfficeProjectCountByRecord" resultType="java.lang.Integer">
 		select count(1) from rural_project_records a
@@ -478,6 +724,24 @@
 		</where>
 	</select>
 
+	<select id="getOfficeProjectCountByRecordAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",a.create_by as "userId",so.parent_ids as "officeParentIds",count(1) as "count"
+		from rural_project_records a
+		left join project_report_data prd on a.id = prd.project_id
+		left join rural_project_report_record rprr on prd.id = rprr.report_id
+		left join sys_office so on so.id = a.office_id
+		<where>
+			a.del_flag=0
+			and a.record_state = 5
+			and a.over_record_status = 0
+			and rprr.status = 5
+			and rprr.del_flag = 0
+			and rprr.accomplish_date >= #{beginDate}
+			and rprr.accomplish_date &lt;= #{endDate}
+		</where>
+		group by a.create_by
+	</select>
+
 	<select id="getOfficeProjectCountByReported" resultType="java.lang.Integer">
 		select count(1) from rural_project_records a
 		left join rural_project_records_reported rprr on a.id = rprr.id
@@ -492,6 +756,24 @@
 			and rprr.accomplish_date &lt;= #{endDate}
 		</where>
 	</select>
+
+	<select id="getOfficeProjectCountByReportedAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",a.create_by as "userId",so.parent_ids as "officeParentIds",count(1) as "count"
+		from rural_project_records a
+		left join rural_project_records_reported rprr on a.id = rprr.id
+		left join sys_office so on so.id = a.office_id
+		<where>
+			a.del_flag=0
+			and a.reported_state = 5
+			and a.over_due_status = 0
+			and rprr.report_status = 5
+			and rprr.del_flag = 0
+			and rprr.accomplish_date >= #{beginDate}
+			and rprr.accomplish_date &lt;= #{endDate}
+		</where>
+		group by a.create_by
+	</select>
+
 	<select id="getOfficeOverDueNotRecordProject" resultType="java.lang.String">
 		select id from rural_project_records a
 		<where>
@@ -502,6 +784,17 @@
 		</where>
 	</select>
 
+	<select id="getOfficeOverDueNotRecordProjectAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.id as "fieldId",a.create_by as "userId",a.office_id as "officeId",so.parent_ids as "officeParentIds"
+		from rural_project_records a
+		left join sys_office so on so.id = a.office_id
+		<where>
+			a.del_flag=0
+			and a.record_state = 6
+			and a.over_record_status = 1
+		</where>
+	</select>
+
 	<select id="getOfficeOverDueRecordProject" resultType="java.lang.String">
 		select a.id from rural_project_records a
 		left join project_report_data prd on a.id = prd.project_id
@@ -518,6 +811,23 @@
 		</where>
 	</select>
 
+	<select id="getOfficeOverDueRecordProjectAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.id as "fieldId",a.create_by as "userId",a.office_id as "officeId",so.parent_ids as "officeParentIds"
+		from rural_project_records a
+		left join project_report_data prd on a.id = prd.project_id
+		left join rural_project_report_record rprr on prd.id = rprr.report_id
+		left join sys_office so on so.id = a.office_id
+		<where>
+			a.del_flag=0
+			and a.record_state = 7
+			and a.over_record_status = 1
+			and rprr.status = 5
+			and rprr.del_flag = 0
+			and rprr.accomplish_date >= #{beginDate}
+			and rprr.accomplish_date &lt;= #{endDate}
+		</where>
+	</select>
+
 	<select id="getOfficeOverDueNotReportedProject" resultType="java.lang.String">
 		select a.id from rural_project_records a
 		<where>
@@ -528,6 +838,17 @@
 		</where>
 	</select>
 
+	<select id="getOfficeOverDueNotReportedProjectAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.id as "fieldId",a.create_by as "userId",a.office_id as "officeId",so.parent_ids as "officeParentIds"
+		from rural_project_records a
+		left join sys_office so on so.id = a.office_id
+		<where>
+			a.del_flag=0
+			and a.reported_state != 7
+			and a.over_due_status = 1
+		</where>
+	</select>
+
 	<select id="getOfficeOverDueReportedProject" resultType="java.lang.String">
 		select a.id from rural_project_records a
 		left join project_report_data prd on a.id = prd.project_id
@@ -544,6 +865,23 @@
 		</where>
 	</select>
 
+	<select id="getOfficeOverDueReportedProjectAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.id as "fieldId",a.create_by as "userId",a.office_id as "officeId",so.parent_ids as "officeParentIds"
+		from rural_project_records a
+		left join project_report_data prd on a.id = prd.project_id
+		left join rural_project_records_reported rprr on prd.id = rprr.id
+		left join sys_office so on so.id = a.office_id
+		<where>
+			a.del_flag=0
+			and a.reported_state = 7
+			and a.over_due_status = 1
+			and rprr.report_status = 5
+			and rprr.del_flag = 0
+			and rprr.accomplish_date >= #{beginDate}
+			and rprr.accomplish_date &lt;= #{endDate}
+		</where>
+	</select>
+
 
 	<insert id="insertOfficeComprehensive">
 		INSERT INTO statement_office_comprehensive_info(
@@ -675,6 +1013,19 @@
 		</where>
 	</select>
 
+	<select id="getInsertOfficeInvoiceCountByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",a.create_by as "userId",so.parent_ids as "officeParentIds",count(1) as "count"
+		from work_invoice a
+		left join sys_office so on so.id = a.office_id
+		<where>
+			a.del_flag=0
+			and a.invoice_state = 5
+			and a.invoice_date >= #{beginDate}
+			and a.invoice_date &lt;= #{endDate}
+		</where>
+		group by a.create_by
+	</select>
+
 	<select id="getInsertOfficeInvoiceSumMoneyByOffice" resultType="java.lang.String">
 		select ifnull(round(sum(money),2),0) from work_invoice a
 		<where>
@@ -686,6 +1037,19 @@
 		</where>
 	</select>
 
+	<select id="getInsertOfficeInvoiceSumMoneyByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",a.create_by as "userId",so.parent_ids as "officeParentIds",ifnull(round(sum(money),2),0) as 'variableElement'
+		from work_invoice a
+		left join sys_office so on so.id = a.office_id
+		<where>
+			a.del_flag=0
+			and a.invoice_state = 5
+			and a.invoice_date >= #{beginDate}
+			and a.invoice_date &lt;= #{endDate}
+		</where>
+		group by a.create_by
+	</select>
+
 	<select id="getInsertOfficeInvoiceDetailsCountByOffice" resultType="java.lang.Integer">
 		select count(1) from work_invoice_detail a
 		left join work_invoice wi on a.invoice_id = wi.id
@@ -700,6 +1064,22 @@
 		</where>
 	</select>
 
+	<select id="getInsertOfficeInvoiceDetailsCountByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select wi.office_id as "officeId",wi.create_by as "userId",so.parent_ids as "officeParentIds",count(1) as "count"
+		from work_invoice_detail a
+		left join work_invoice wi on a.invoice_id = wi.id
+		left join sys_office so on so.id = a.office_id
+		<where>
+			wi.del_flag=0
+			and a.del_flag=0
+			and wi.invoice_state = 5
+			and wi.receipt_money = '1'
+			and wi.receipt_money_date >= #{beginDate}
+			and wi.receipt_money_date &lt;= #{endDate}
+		</where>
+		group by wi.create_by
+	</select>
+
 	<select id="getInsertOfficeInvoiceDetailsSumMoneyByOffice" resultType="java.lang.String">
 		select ifnull(round(sum(a.total_money),2),0) from work_invoice_detail a
 		left join work_invoice wi on a.invoice_id = wi.id
@@ -714,6 +1094,22 @@
 		</where>
 	</select>
 
+	<select id="getInsertOfficeInvoiceDetailsSumMoneyByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select wi.office_id as "officeId",wi.create_by as "userId",so.parent_ids as "officeParentIds",ifnull(round(sum(a.total_money),2),0) as 'variableElement'
+		from work_invoice_detail a
+		left join work_invoice wi on a.invoice_id = wi.id
+		left join sys_office so on so.id = wi.office_id
+		<where>
+			wi.del_flag=0
+			and a.del_flag=0
+			and wi.invoice_state = 5
+			and wi.receipt_money = '1'
+			and wi.receipt_money_date >= #{beginDate}
+			and wi.receipt_money_date &lt;= #{endDate}
+		</where>
+		group by wi.create_by
+	</select>
+
 	<select id="getInsertOfficeReimbursementCountByOffice" resultType="java.lang.Integer">
 		select count(1) from work_reimbursement a
 		<where>
@@ -725,6 +1121,19 @@
 		</where>
 	</select>
 
+	<select id="getInsertOfficeReimbursementCountByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",a.create_by as "userId",so.parent_ids as "officeParentIds",count(1) as "count"
+		from work_reimbursement a
+		left join sys_office so on so.id = a.office_id
+		<where>
+			and a.del_flag=0
+			and a.status = 5
+			and a.accomplish_date >= #{beginDate}
+			and a.accomplish_date &lt;= #{endDate}
+		</where>
+		group by a.create_by
+	</select>
+
 	<select id="getInsertOfficeReimbursementSumMoneyByOffice" resultType="java.lang.String">
 		select ifnull(round(sum(a.money),2),0) from work_reimbursement a
 		<where>
@@ -736,6 +1145,19 @@
 		</where>
 	</select>
 
+	<select id="getInsertOfficeReimbursementSumMoneyByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",a.create_by as "userId",so.parent_ids as "officeParentIds",ifnull(round(sum(a.money),2),0) as 'variableElement'
+		from work_reimbursement a
+		left join sys_office so on so.id = a.office_id
+		<where>
+			a.del_flag=0
+			and a.status = 5
+			and a.accomplish_date >= #{beginDate}
+			and a.accomplish_date &lt;= #{endDate}
+		</where>
+		group by a.create_by
+	</select>
+
 	<select id="getInsertOfficeContractCountByOffice" resultType="java.lang.Integer">
 		select count(1) from work_contract_info a
 		<where>
@@ -747,6 +1169,19 @@
 		</where>
 	</select>
 
+	<select id="getInsertOfficeContractCountByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",a.create_by as "userId",so.parent_ids as "officeParentIds",count(1) as "count"
+		from work_contract_info a
+		left join sys_office so on so.id = a.office_id
+		<where>
+			and a.del_flag=0
+			and a.contract_state = 5
+			and a.accomplish_date >= #{beginDate}
+			and a.accomplish_date &lt;= #{endDate}
+		</where>
+		group by a.create_by
+	</select>
+
 	<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
@@ -761,6 +1196,22 @@
 		</where>
 	</select>
 
+	<select id="getInsertOfficeContractRecordCountByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.office_id as "officeId",a.create_by as "userId",so.parent_ids as "officeParentIds",count(1) as "count"
+		from work_contract_info a
+		left join work_contract_record wcr on wcr.contract_info_id = a.id
+		left join sys_office so on so.id = a.office_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 wcr.accomplish_date >= #{beginDate}
+			and wcr.accomplish_date &lt;= #{endDate}
+		</where>
+		group by a.create_by
+	</select>
+
 	<select id="getOfficeOverDueNotContractRecordCountByOffice" resultType="java.lang.String">
 		select a.id from work_contract_info a
 		<where>
@@ -772,6 +1223,18 @@
 		</where>
 	</select>
 
+	<select id="getOfficeOverDueNotContractRecordCountByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.id as "fieldId",a.create_by as "userId",a.office_id as "officeId",so.parent_ids as "officeParentIds"
+		from work_contract_info a
+		left join sys_office so on so.id = a.office_id
+		<where>
+			and a.del_flag=0
+			and a.contract_state = 5
+			and a.contract_record_state != 7
+			and a.over_due_status = 1
+		</where>
+	</select>
+
 	<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
@@ -786,6 +1249,21 @@
 		</where>
 	</select>
 
+	<select id="getOfficeOverDueContractRecordCountByOfficeAll" resultType="com.jeeplus.modules.statement.entity.ReportDataEntity">
+		select a.id as "fieldId",a.create_by as "userId",a.office_id as "officeId",so.parent_ids as "officeParentIds"
+		from work_contract_info a
+		left join work_contract_record wcr on wcr.contract_info_id = a.id
+		left join sys_office so on so.id = a.office_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 wcr.accomplish_date >= #{beginDate}
+			and wcr.accomplish_date &lt;= #{endDate}
+		</where>
+	</select>
+
 	<select id="selectAllByType" parameterType="StatementCompanyComprehensiveInfo" resultType="StatementCompanyComprehensiveInfo">
 		select
 		       a.id as "id",
@@ -838,7 +1316,7 @@
 			a.field5 as "field5",
 			a.field6 as "field6",
 			a.field7 as "field7",
-			a.field8 as "field8",
+			a.field8 as "field8"
 		FROM
 				statement_office_comprehensive_info a
 				LEFT JOIN sys_user su ON su.id = a.user_id