From 81c81834668f8b5e26f3dde8a7d13efcb251ad32 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期四, 19 十二月 2024 19:42:01 +0800
Subject: [PATCH] 代码初始化
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java | 159 +++++++++++++++++++++++++++++++++++++++
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/PlatformJobService.java | 7 +
server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/WholeProvinceController.java | 6 +
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java | 1
server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java | 15 +++
5 files changed, 187 insertions(+), 1 deletions(-)
diff --git a/server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java b/server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java
index afb3039..894d2d5 100644
--- a/server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java
+++ b/server/system_service/src/main/java/com/doumee/core/utils/DateUtil.java
@@ -3405,4 +3405,19 @@
return dateBeforeDay.toString();
}
+
+ /**
+ * 鑾峰彇X骞村悗鐨勬棩鏈�
+ * @param date
+ * @param beforMonths 涓嬪勾 -1 涓婂勾 1
+ * @return
+ */
+ public static String getBeforYear(Date date,Integer beforMonths){
+ ZonedDateTime zonedDateTime = date.toInstant().atZone(ZoneId.systemDefault());
+ // 杞崲涓簀ava.time.LocalDate,璁$畻x澶╃殑鏃ユ湡
+ LocalDate dateBeforeDay = zonedDateTime.toLocalDate().minusYears(beforMonths);
+ return dateBeforeDay.toString();
+ }
+
+
}
\ No newline at end of file
diff --git a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/WholeProvinceController.java b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/WholeProvinceController.java
index 794b868..ae6c484 100644
--- a/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/WholeProvinceController.java
+++ b/server/visits/dmvisit_admin/src/main/java/com/doumee/cloud/board/WholeProvinceController.java
@@ -1,13 +1,17 @@
package com.doumee.cloud.board;
-import com.doumee.api.BaseController;
+import com.doumee.api.BaseController;
import com.doumee.config.annotation.LoginNoRequired;
import com.doumee.core.model.ApiResponse;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.dao.web.response.platformReport.*;
+import com.doumee.service.business.PlatformJobService;
+import com.doumee.service.business.VisitsService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/PlatformJobService.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/PlatformJobService.java
index 810cf30..e9eb5d6 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/PlatformJobService.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/PlatformJobService.java
@@ -12,6 +12,7 @@
import com.doumee.dao.web.response.DriverHomeVO;
import com.doumee.dao.web.response.LineUpVO;
import com.doumee.dao.web.response.PlatformWorkVO;
+import com.doumee.dao.web.response.platformReport.WholeProvinceBoardVO;
import java.util.List;
@@ -244,4 +245,10 @@
void timeOutWork();
PlatformJob getLastWaitJob(String uuid, LoginUserInfo loginUser);
+
+ void wholeProvinceCenterData(WholeProvinceBoardVO data);
+
+ void centerDataForInOut(WholeProvinceBoardVO data);
+
+ void centerDataOutInRata(WholeProvinceBoardVO data);
}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java
index 476825c..c13f906 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java
@@ -35,6 +35,7 @@
import com.doumee.dao.web.response.DriverHomeVO;
import com.doumee.dao.web.response.LineUpVO;
import com.doumee.dao.web.response.PlatformWorkVO;
+import com.doumee.dao.web.response.platformReport.WholeProvinceBoardVO;
import com.doumee.service.business.PlatformJobService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@@ -2202,6 +2203,164 @@
}
+ /**
+ * 绱鍑哄簱閲忕粺璁� - 澶у睆
+ * @param data
+ */
+ @Override
+ public void wholeProvinceCenterData(WholeProvinceBoardVO data){
+// //绱鏈勾搴﹀嚭搴撻噺
+// List<PlatformJob> platformJobList = platformJobJoinMapper.selectList(new QueryWrapper<PlatformJob>()
+// .lambda()
+// .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE
+// ,Constants.PlatformJobStatus.AUTHED_LEAVE
+// ,Constants.PlatformJobStatus.LEAVED)
+// .isNotNull(PlatformJob::getDoneDate)
+// .in(PlatformJob::getType,Constants.platformJobType.wxczh,Constants.platformJobType.zyczh)
+// .like( PlatformJob::getDoneDate, DateUtil.getFomartDate(new Date(),"yyyy"))
+// );
+// data.setYearOutTotal(platformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add));
+// data.setYearOutTimes(platformJobList.size());
+//
+//
+// List<PlatformJob> platformJobsMonthList = platformJobList.stream().filter(i->DateUtil.getFomartDate(i.getDoneDate(),"yyyy-MM").equals(DateUtil.getFomartDate(new Date(),"yyyy-MM"))).collect(Collectors.toList());
+// data.setMonthOutTotal(platformJobsMonthList.stream().filter(i->Objects.nonNull(i.getTotalNum())).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add));
+// data.setMonthOutTimes(platformJobsMonthList.size());
+// String beforYear = DateUtil.getBeforYear(new Date(),1);
+//
+// //绱鏈勾搴﹀嚭搴撻噺
+// List<PlatformJob> beforYearPlatformJobList = platformJobJoinMapper.selectList(new QueryWrapper<PlatformJob>()
+// .lambda()
+// .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE
+// ,Constants.PlatformJobStatus.AUTHED_LEAVE
+// ,Constants.PlatformJobStatus.LEAVED)
+// .isNotNull(PlatformJob::getDoneDate)
+// .in(PlatformJob::getType,Constants.platformJobType.wxczh,Constants.platformJobType.zyczh)
+// .like( PlatformJob::getDoneDate, beforYear.substring(0,4))
+// );
+//
+// List<PlatformJob> beforPlatformJobsMonthList = platformJobList.stream().filter(i->DateUtil.getFomartDate(i.getDoneDate(),"yyyy-MM").equals(beforYear.substring(0,7))).collect(Collectors.toList());
+// //鍚屾瘮鏁版嵁
+// data.setYearOutTotalOnYear(beforYearPlatformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add));
+// data.setMonthOutTotalOnYear(beforPlatformJobsMonthList.stream().filter(i->Objects.nonNull(i.getTotalNum())).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add));
+//
+ }
+
+ @Override
+ public void centerDataForInOut(WholeProvinceBoardVO data){
+// //浠婃棩瀹屾垚鐨勫嚭鍏ュ簱鎵�鏈夋暟鎹�
+// List<PlatformJob> platformJobList = platformJobJoinMapper.selectList(new QueryWrapper<PlatformJob>()
+// .lambda()
+// .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE
+// ,Constants.PlatformJobStatus.AUTHED_LEAVE
+// ,Constants.PlatformJobStatus.LEAVED)
+// .like( PlatformJob::getDoneDate, DateUtil.getFomartDate(new Date(),"yyyy-MM-dd"))
+// );
+// //浠婃棩涔嬪墠 鎵�鏈夋湭瀹屾垚鐨勫嚭鍏ュ簱鏁版嵁 - WMS鎺ㄩ��
+// List<PlatformJob> wmsPlatformJobList = platformJobJoinMapper.selectList(new QueryWrapper<PlatformJob>()
+// .lambda()
+// .notIn(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE
+// ,Constants.PlatformJobStatus.AUTHED_LEAVE
+// ,Constants.PlatformJobStatus.LEAVED
+// ,Constants.PlatformJobStatus.CANCEL)
+// .eq(PlatformJob::getOrigin ,Constants.ONE)
+// .le(PlatformJob::getCreateDate, DateUtil.getFomartDate(new Date(),"yyyy-MM-dd") +" 23:59:59")
+// );
+// //浠婃棩涔嬪墠 鎵�鏈夋湭瀹屾垚鐨勫嚭鍏ュ簱鏁版嵁 - 棰勭害鏁版嵁
+// List<PlatformJob> bookPlatformJobList = platformJobJoinMapper.selectList(new QueryWrapper<PlatformJob>()
+// .lambda()
+// .notIn(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE
+// ,Constants.PlatformJobStatus.AUTHED_LEAVE
+// ,Constants.PlatformJobStatus.LEAVED
+// ,Constants.PlatformJobStatus.CANCEL)
+// .eq(PlatformJob::getOrigin ,Constants.ONE)
+// .le(PlatformJob::getArriveDate, DateUtil.getFomartDate(new Date(),"yyyy-MM-dd") +" 23:59:59")
+// );
+//
+// BigDecimal finishOutTotal = platformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.wxczh)||i.getType().equals(Constants.platformJobType.zyczh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add);
+// BigDecimal unFinishWmsOutTotal = wmsPlatformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.wxczh)||i.getType().equals(Constants.platformJobType.zyczh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add);
+// BigDecimal unFinishBookOutTotal = bookPlatformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.wxczh)||i.getType().equals(Constants.platformJobType.zyczh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add);
+//
+// BigDecimal finishInTotal = platformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.zycxh)||i.getType().equals(Constants.platformJobType.wxcxh)||i.getType().equals(Constants.platformJobType.sgscxh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add);
+// BigDecimal unFinishWmsInTotal = wmsPlatformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.zycxh)||i.getType().equals(Constants.platformJobType.wxcxh)||i.getType().equals(Constants.platformJobType.sgscxh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add);
+// BigDecimal unFinishBookInTotal = bookPlatformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.zycxh)||i.getType().equals(Constants.platformJobType.wxcxh)||i.getType().equals(Constants.platformJobType.sgscxh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add);
+//
+// data.setOutTotal(finishOutTotal);
+// data.setOutPlanTotal(finishOutTotal.add(unFinishWmsOutTotal).add(unFinishBookOutTotal));
+//
+// data.setInTotal(finishInTotal);
+// data.setInPlanTotal(finishInTotal.add(unFinishWmsInTotal).add(unFinishBookInTotal));
+
+ }
+
+
+
+
+ @Override
+ public void centerDataOutInRata(WholeProvinceBoardVO data){
+// //绱鏈湀搴︽墍鏈夋搷浣滈噺
+// List<PlatformJob> platformJobList = platformJobJoinMapper.selectJoinList(PlatformJob.class,new MPJLambdaWrapper<PlatformJob>()
+// .selectAll(PlatformJob.class)
+// .select(" ( select ifnull(sum(p.param3),0) from platform_log p where p.obj_id = platform_job.id ) ",PlatformJob::getWorkTime)
+// .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE
+// ,Constants.PlatformJobStatus.AUTHED_LEAVE
+// ,Constants.PlatformJobStatus.LEAVED)
+// .isNotNull(PlatformJob::getDoneDate)
+// .like( PlatformJob::getDoneDate, DateUtil.getFomartDate(new Date(),"yyyy-MM"))
+// );
+//
+// //鑾峰彇鏈湀鎵�鏈夊嚭搴撻噺
+// BigDecimal monthOutTotal = platformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.wxczh)||i.getType().equals(Constants.platformJobType.zyczh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add);
+// Long monthOutWorkTotal = platformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.wxczh)||i.getType().equals(Constants.platformJobType.zyczh))).map(i->i.getWorkTime()).reduce(Long.valueOf(Constants.ZERO),Long::sum);
+// BigDecimal monthInTotal = platformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.zycxh)||i.getType().equals(Constants.platformJobType.wxcxh)||i.getType().equals(Constants.platformJobType.sgscxh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add);
+// Long monthInWorkTotal = platformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.zycxh)||i.getType().equals(Constants.platformJobType.wxcxh)||i.getType().equals(Constants.platformJobType.sgscxh))).map(i->i.getWorkTime()).reduce(Long.valueOf(Constants.ZERO),Long::sum);
+//
+// data.setMonthOutRata(BigDecimal.ZERO);
+// //鏈堝害鍑哄簱鏁堢巼
+// if(Objects.nonNull(monthOutTotal) && Objects.nonNull(monthOutWorkTotal) && monthOutWorkTotal>0L && monthOutTotal.compareTo(BigDecimal.ZERO) > 0){
+// BigDecimal workTotal = new BigDecimal(monthOutWorkTotal);
+// data.setMonthOutRata(monthOutTotal.multiply(new BigDecimal(3600)).divide(workTotal,2,BigDecimal.ROUND_UP));
+// }
+//
+// //鏈堝害鍏ュ簱鏁堢巼
+//
+// data.setMonthInRata(BigDecimal.ZERO);
+// if(Objects.nonNull(monthInTotal) && Objects.nonNull(monthInWorkTotal) && monthInWorkTotal>0L && monthInTotal.compareTo(BigDecimal.ZERO) > 0){
+// BigDecimal workTotal = new BigDecimal(monthInWorkTotal);
+// data.setMonthInRata(monthInTotal.multiply(new BigDecimal(3600)).divide(workTotal,2,BigDecimal.ROUND_UP));
+// }
+//
+//
+//
+// List<PlatformJob> dayPlatformJobList = platformJobJoinMapper.selectList(new QueryWrapper<PlatformJob>()
+// .lambda()
+// .in(PlatformJob::getStatus,Constants.PlatformJobStatus.DONE
+// ,Constants.PlatformJobStatus.AUTHED_LEAVE
+// ,Constants.PlatformJobStatus.LEAVED)
+// .isNotNull(PlatformJob::getDoneDate)
+// .like( PlatformJob::getDoneDate, DateUtil.getFomartDate(new Date(),"yyyy-MM-dd"))
+// );
+//
+// BigDecimal dayOutTotal = dayPlatformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.wxczh)||i.getType().equals(Constants.platformJobType.zyczh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add);
+// Long dayOutWorkTotal = platformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.wxczh)||i.getType().equals(Constants.platformJobType.zyczh))).map(i->i.getWorkTime()).reduce(Long.valueOf(Constants.ZERO),Long::sum);
+// BigDecimal dayInTotal = dayPlatformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.zycxh)||i.getType().equals(Constants.platformJobType.wxcxh)||i.getType().equals(Constants.platformJobType.sgscxh))).map(i->i.getTotalNum()).reduce(BigDecimal.ZERO,BigDecimal::add);
+// Long dayInWorkTotal = platformJobList.stream().filter(i->Objects.nonNull(i.getTotalNum())&&(i.getType().equals(Constants.platformJobType.zycxh)||i.getType().equals(Constants.platformJobType.wxcxh)||i.getType().equals(Constants.platformJobType.sgscxh))).map(i->i.getWorkTime()).reduce(Long.valueOf(Constants.ZERO),Long::sum);
+//
+// data.setDayOutRata(BigDecimal.ZERO);
+// //鏃ュ嚭搴撴晥鐜�
+// if(Objects.nonNull(dayOutTotal) && Objects.nonNull(dayOutWorkTotal) && dayOutWorkTotal>0L && dayOutTotal.compareTo(BigDecimal.ZERO) > 0){
+// BigDecimal workTotal = new BigDecimal(dayOutWorkTotal);
+// data.setDayOutRata(dayOutTotal.multiply(new BigDecimal(3600)).divide(workTotal,2,BigDecimal.ROUND_UP));
+// }
+// //鏃ュ叆搴撴晥鐜�
+// data.setDayInRata(BigDecimal.ZERO);
+// if(Objects.nonNull(dayInTotal) && Objects.nonNull(dayInWorkTotal) && dayInWorkTotal>0L && dayInTotal.compareTo(BigDecimal.ZERO) > 0){
+// BigDecimal workTotal = new BigDecimal(dayInWorkTotal);
+// data.setMonthInRata(dayInTotal.multiply(new BigDecimal(3600)).divide(workTotal,2,BigDecimal.ROUND_UP));
+// }
+
+
+ }
}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
index ebf537c..761b297 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
@@ -229,6 +229,7 @@
@Override
@Transactional(rollbackFor = {BusinessException.class,Exception.class})
public Integer createFk(Visits visits,Boolean isERP,Integer source) {
+ visits.setId(null);
isValidBaseParam(visits);
//妫�鏌ユ槸鍚﹀繀椤荤瓟棰橈紝骞朵笖绗﹀悎绛旈瑕佹眰
ProblemLog problemLog = isValidProblemLog(visits,source);
--
Gitblit v1.9.3