From bcd62be27acf68adb54415f75b37f5e26d65c11b Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期三, 07 五月 2025 10:34:44 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/SecurityBoardVO.java |    3 +
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/InoutRecordServiceImpl.java    |   48 ++++++++++++++---------
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java    |    8 +++-
 server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java         |    3 -
 4 files changed, 39 insertions(+), 23 deletions(-)

diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/SecurityBoardVO.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/SecurityBoardVO.java
index 19e7ef1..d5e11a8 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/SecurityBoardVO.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/web/response/platformReport/SecurityBoardVO.java
@@ -48,6 +48,9 @@
     @ApiModelProperty(value = "褰撳墠鍦ㄥ洯杞﹁締鎬绘暟")
     private int inParkCarTotal;
 
+    @ApiModelProperty(value = "褰撳墠鍦ㄥ洯璐ц溅鍙告満鎬绘暟")
+    private int inParkCarUserTotal;
+
     @ApiModelProperty(value = "褰撳墠璁惧鎬绘暟")
     private int deviceTotal;
 
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/InoutRecordServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/InoutRecordServiceImpl.java
index d173f98..9791dcb 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/InoutRecordServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/InoutRecordServiceImpl.java
@@ -226,9 +226,12 @@
         List<InoutRecord> yearList = inoutRecordMapper.selectJoinList(InoutRecord.class,new MPJLambdaWrapper<InoutRecord>()
                 .selectAll(InoutRecord.class)
                 .eq(InoutRecord::getIsdeleted,Constants.ZERO)
+                .eq(InoutRecord::getInOrOut,Constants.ZERO)
                 .isNotNull(Constants.equalsInteger(inParkDataDTO.getType(),Constants.ZERO),InoutRecord::getCarCode)
                 .isNotNull(Constants.equalsInteger(inParkDataDTO.getType(),Constants.ONE),InoutRecord::getMemberPhone)
                 .apply(" ( DATE_FORMAT(CREATE_DATE, '%Y') = DATE_FORMAT(now(), '%Y') ) ")
+                .orderByAsc(Constants.equalsInteger(inParkDataDTO.getType(),Constants.ZERO),InoutRecord::getCarBizType)
+                .orderByAsc(Constants.equalsInteger(inParkDataDTO.getType(),Constants.ONE),InoutRecord::getMemberType)
         );
         List<InoutRecord> monthList = yearList.stream().filter(i->DateUtil.formatDate(i.getCreateDate(),"yyyy-MM").equals(DateUtil.formatDate(new Date(),"yyyy-MM"))).collect(Collectors.toList());
         List<InoutRecord> weekList = yearList.stream().filter(i->i.getCreateDate().getTime()>=weekStart).collect(Collectors.toList());
@@ -273,7 +276,7 @@
                 GeneralDataVO generalDataVO = new GeneralDataVO();
                 generalDataVO.setName(userTypeList[i]);
                 int index = i;
-                generalDataVO.setTotal(yearList.stream().filter(j->Constants.equalsInteger(j.getType(), index)).collect(Collectors.toList()).size());
+                generalDataVO.setTotal(yearList.stream().filter(j->Constants.equalsInteger(j.getMemberType(), index)).collect(Collectors.toList()).size());
                 yearSortList.add(generalDataVO);
             }
         }else{
@@ -322,6 +325,7 @@
         List<InoutRecord> yearList = inoutRecordMapper.selectJoinList(InoutRecord.class,new MPJLambdaWrapper<InoutRecord>()
                 .selectAll(InoutRecord.class)
                 .eq(InoutRecord::getIsdeleted,Constants.ZERO)
+                .eq(InoutRecord::getInOrOut,Constants.ZERO)
                 .isNotNull(Constants.equalsInteger(inParkDataDTO.getType(),Constants.ZERO),InoutRecord::getCarCode)
                 .isNotNull(Constants.equalsInteger(inParkDataDTO.getType(),Constants.ONE),InoutRecord::getMemberPhone)
                 .apply(Constants.equalsInteger(inParkDataDTO.getDateStr().length(),4)," ( DATE_FORMAT(CREATE_DATE, '%Y') =  '"+inParkDataDTO.getDateStr()+"' ) ")
@@ -342,7 +346,7 @@
                 GeneralDataVO generalDataVO = new GeneralDataVO();
                 generalDataVO.setName(userTypeList[i]);
                 int index = i;
-                generalDataVO.setTotal(yearList.stream().filter(j->Constants.equalsInteger(j.getType(), index)).collect(Collectors.toList()).size());
+                generalDataVO.setTotal(yearList.stream().filter(j->Constants.equalsInteger(j.getMemberType(), index)).collect(Collectors.toList()).size());
                 generalDataVO.setRata(new BigDecimal(generalDataVO.getTotal().toString()).divide(new BigDecimal(yearList.size()+""),2,BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")));
                 rataList.add(generalDataVO);
             }
@@ -377,6 +381,7 @@
         List<InoutRecord> allList = inoutRecordMapper.selectJoinList(InoutRecord.class,new MPJLambdaWrapper<InoutRecord>()
                 .selectAll(InoutRecord.class)
                 .eq(InoutRecord::getIsdeleted,Constants.ZERO)
+                .eq(InoutRecord::getInOrOut,Constants.ZERO)
                 .isNotNull(Constants.equalsInteger(inParkDataDTO.getType(),Constants.ZERO),InoutRecord::getCarCode)
                 .isNotNull(Constants.equalsInteger(inParkDataDTO.getType(),Constants.ONE),InoutRecord::getMemberPhone)
                 .apply(Constants.equalsInteger(inParkDataDTO.getDateStr().length(),4)," ( DATE_FORMAT(CREATE_DATE, '%Y') =  '"+inParkDataDTO.getDateStr()+"' ) ")
@@ -397,26 +402,26 @@
             if(Constants.equalsInteger(DateUtil.getNowYearNum(),Integer.valueOf(inParkDataDTO.getDateStr()))){
                 maxMonth =  DateUtil.getNowMonthNum();
             }
-            for (int i = 1; i <= maxMonth; i++) {
+            for (int i = maxMonth; i >=0 ; i--) {
                 dateList.add(DateUtil.getNowYearNum()+"-"+ StringUtils.leftPad(i+"",2,"0"));
             }
         }else {
             //鏃ユ湡
             Integer year  = Integer.valueOf(inParkDataDTO.getDateStr().substring(0,4));
-            Integer month = Integer.valueOf(inParkDataDTO.getDateStr().substring(5,6));
+            Integer month = Integer.valueOf(inParkDataDTO.getDateStr().substring(5,7));
             Integer today = DateUtil.getNowDayNum();
             YearMonth yearMonth = YearMonth.of(year, month);
             // 鑾峰彇璇ユ湀鐨勬渶鍚庝竴澶�
             LocalDate lastDayDate = yearMonth.atEndOfMonth();
-            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
+            DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd");
             Integer lastDay = Integer.valueOf(lastDayDate.format(formatter));
             if(Constants.equalsInteger(year,DateUtil.getNowYearNum()) && Constants.equalsInteger(month,DateUtil.getNowMonthNum())){
                 if(today <  lastDay){
                     lastDay = today;
                 }
             }
-            for (int i = 1; i <= lastDay; i++) {
-                dateList.add(year + "-" + StringUtils.leftPad(month.toString(),2,"0") + "-" + StringUtils.leftPad(lastDay.toString(),2,"0"));
+            for (int i = lastDay; i >= 0 ; i--) {
+                dateList.add(year + "-" + StringUtils.leftPad(month.toString(),2,"0") + "-" + StringUtils.leftPad(Integer.toString(i),2,"0"));
             }
         }
         return this.dealResultData(allList,dateList,inParkDataDTO.getType(),inParkDataDTO.getDateStr());
@@ -468,32 +473,37 @@
                     continue;
                 }
                 totalString.add(userTypeList[j]);
-                totalString.add("鍚堣");
-                resultList.add(totalString);
             }
-            Integer total = 0;
+            totalString.add("鍚堣");
+            resultList.add(totalString);
             for (String str:dataList) {
-                for (String typeName:userTypeList) {
-                    List<String> dataChildList = new ArrayList<>();
-                    dataChildList.add(str);
+                Integer total = 0;
+                List<String> dataChildList = new ArrayList<>();
+                dataChildList.add(str);
+                for (int i = 0; i < userTypeList.length; i++) {
+                    String typeName = userTypeList[i];
+                    if(StringUtils.isBlank(typeName)){
+                        continue;
+                    }
+                    int finalI = i;
                     if(Constants.equalsInteger(dateStr.length(),4)){
-                        Integer childNum = allList.stream().filter(i->typeName.equals(i.getCategoryName())
-                                && DateUtil.formatDate(i.getCreateDate(),"yyyy-MM").equals(str)).collect(Collectors.toList()).size();
+                        Integer childNum = allList.stream().filter(j->Constants.equalsInteger(j.getMemberType(), finalI)
+                                && DateUtil.formatDate(j.getCreateDate(),"yyyy-MM").equals(str)).collect(Collectors.toList()).size();
                         dataChildList.add(
                                 Integer.toString(childNum)
                         );
                         total = total + childNum;
                     }else if(Constants.equalsInteger(dateStr.length(),7)){
-                        Integer childNum = allList.stream().filter(i->typeName.equals(i.getCategoryName())
-                                &&DateUtil.formatDate(i.getCreateDate(),"yyyy-MM-dd").equals(str)).collect(Collectors.toList()).size();
+                        Integer childNum = allList.stream().filter(j->Constants.equalsInteger(j.getMemberType(), finalI)
+                                &&DateUtil.formatDate(j.getCreateDate(),"yyyy-MM-dd").equals(str)).collect(Collectors.toList()).size();
                         dataChildList.add(
                                 Integer.toString(childNum)
                         );
                         total = total + childNum;
                     }
-                    dataChildList.add(Integer.toString(total));
-                    resultList.add(dataChildList);
                 }
+                dataChildList.add(Integer.toString(total));
+                resultList.add(dataChildList);
             }
         }
         return resultList;
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 fc9aea5..59b2fce 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
@@ -689,7 +689,7 @@
         if(Constants.equalsInteger(visits.getType(),Constants.ZERO)
              ||  Constants.equalsInteger(visits.getType(),Constants.ONE)){
             if(  visits.getIdcardType() == null
-                    ||  StringUtils.isBlank( visits.getIdcardNo() ) || StringUtils.isBlank(visits.getFaceImg()) ){
+                    || StringUtils.isBlank(visits.getFaceImg()) ){
                 throw  new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "瀵逛笉璧凤紝淇℃伅濉啓涓嶆纭紒");
             }
         }
@@ -1933,7 +1933,6 @@
             pcWorkPlatformDataVO.setWeekCarList(weekCarList);
 
             List<Company> companyList = companyMapper.selectList(new QueryWrapper<Company>().lambda()
-                    .eq(Company::getType,Constants.ZERO)
                     .eq(Company::getIsdeleted,Constants.ZERO)
             );
 
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java
index 80e5ec4..af13ac2 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/thrid/BoardServiceImpl.java
@@ -1943,11 +1943,11 @@
         );
         //鍦ㄥ洯闀挎湡鐩稿叧鏂逛汉鏁�
         data.setRelatedTotal(
-                (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.TWO) && Constants.equalsInteger(i.getCompanyType(),Constants.ZERO)).count()
+                (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.FOUR) ).count()
         );
         //鍦ㄥ洯鍐呴儴鍛樺伐浜烘暟
         data.setInternalTotal(
-                (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.TWO) && Constants.equalsInteger(i.getCompanyType(),Constants.ONE)).count()
+                (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.TWO) ).count()
         );
         //鍦ㄥ洯璁垮鏁伴噺
         data.setVisitTotal(
@@ -1957,6 +1957,10 @@
         data.setInParkCarTotal(
                 (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.THREE)).count()
         );
+        //鍦ㄥ洯杞﹁締
+        data.setInParkCarUserTotal(
+                (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.FIVE)).count()
+        );
        /* //鍦ㄥ洯鐩稿叧鏂硅溅杈�
         data.setRelatedCarTotal(
                 (int) retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.THREE)

--
Gitblit v1.9.3