|
@@ -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){
|