From 308bc8e5c0db7298a127f3478995ddc6167328e9 Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期四, 25 十二月 2025 16:43:27 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/wuhuyancao' into wuhuyancao
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/InoutRecordServiceImpl.java | 51 +++++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 45 insertions(+), 6 deletions(-)
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 7426367..7eaf736 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
@@ -14,6 +14,7 @@
import com.doumee.dao.business.model.Member;
import com.doumee.dao.business.vo.GeneralDataVO;
import com.doumee.dao.business.vo.InParkUserDataVO;
+import com.doumee.dao.business.vo.TelecomInParkDataVO;
import com.doumee.service.business.InoutRecordService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
@@ -24,7 +25,7 @@
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.C;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -155,7 +156,7 @@
//浜哄憳鍒嗙被 鍗曠嫭澶勭悊浜哄憳鏁版嵁 0鍔冲姟璁垮 1鏅�氳瀹� 2鍐呴儴鍛樺伐 3杞﹁締淇℃伅 4鐩稿叧鏂逛汉鍛� 5璐ц繍鍙告満
- private static String[] userTypeList = new String[]{"","鏅�氳瀹�","鍐呴儴浜哄憳","","鐩稿叧鏂逛汉鍛�","璐ц繍鍙告満"};
+ private static String[] userTypeList = new String[]{"","鏅�氳瀹�","鍐呴儴浜哄憳","","鐩稿叧鏂逛汉鍛�"};
/**
@@ -172,8 +173,11 @@
){
throw new BusinessException(ResponseStatus.BAD_REQUEST);
}
- //鏌ヨ鏈懆鐨勫紑濮嬫棩鏈熷拰缁撴潫鏃ユ湡
- Long weekStart = LocalDate.now().with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY)).atStartOfDay(ZoneOffset.UTC).toInstant().toEpochMilli();
+ //鏌ヨ鏈懆鐨勫紑濮嬫棩鏈�
+ LocalDate today = LocalDate.now();
+ // 璁$畻鍛ㄤ竴鍜屽懆浜旂殑鏃ユ湡
+ LocalDate monday = today.with(DayOfWeek.MONDAY);
+ Long weekStart = DateUtil.fromStringToDate("yyyy-MM-dd HH:mm:ss",monday.toString() + " 00:00:00").getTime();//LocalDate.now().with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY)).atStartOfDay(ZoneOffset.UTC).toInstant().toEpochMilli();
InParkUserDataVO inParkUserDataVO = new InParkUserDataVO();
List<InoutRecord> yearList = inoutRecordMapper.selectJoinList(InoutRecord.class,new MPJLambdaWrapper<InoutRecord>()
.selectAll(InoutRecord.class)
@@ -310,7 +314,7 @@
for (String categoryName:setList) {
GeneralDataVO generalDataVO = new GeneralDataVO();
generalDataVO.setName(categoryName);
- generalDataVO.setTotal(yearList.stream().filter(j->StringUtils.isNotBlank(j.getCategoryParentName())&&j.getCategoryName().equals(categoryName)).collect(Collectors.toList()).size());
+ generalDataVO.setTotal(yearList.stream().filter(j->StringUtils.isNotBlank(j.getCategoryParentName())&&j.getCategoryParentName().equals(categoryName)).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);
}
@@ -352,7 +356,6 @@
}else if(Constants.equalsInteger(inParkDataDTO.getDateStr().length(),7)&&Constants.equalsInteger(inParkDataDTO.getType(),Constants.ZERO)){
mpjLambdaWrapper.select("car_code,category_name,DATE_FORMAT(CREATE_DATE, '%Y-%m-%d') as createDateStr ");
}else if(Constants.equalsInteger(inParkDataDTO.getDateStr().length(),4)&&Constants.equalsInteger(inParkDataDTO.getType(),Constants.ONE)){
-
mpjLambdaWrapper.select("member_phone,MEMBER_TYPE,DATE_FORMAT(CREATE_DATE, '%Y-%m') as createDateStr");
}else{
mpjLambdaWrapper.select("member_phone,MEMBER_TYPE,DATE_FORMAT(CREATE_DATE, '%Y-%m-%d') as createDateStr ");
@@ -545,4 +548,40 @@
throw new BusinessException(ResponseStatus.EXPORT_EXCEL_ERROR, e);
}
}
+
+
+
+ @Override
+ public TelecomInParkDataVO getInParkDataForTelecom(){
+ TelecomInParkDataVO telecomInParkDataVO = new TelecomInParkDataVO();
+ telecomInParkDataVO.setInCarNum(Constants.ZERO);
+ telecomInParkDataVO.setInUserNum(Constants.ZERO);
+ List<InoutRecord> listCar = inoutRecordMapper.selectList(new MPJLambdaWrapper<InoutRecord>()
+ .eq(InoutRecord::getIsdeleted,Constants.ZERO)
+ .eq(InoutRecord::getInOrOut,Constants.ZERO)
+ .isNotNull(InoutRecord::getCarCode)
+ .apply(" ( DATE_FORMAT(CREATE_DATE, '%Y%m%d') = DATE_FORMAT(now(), '%Y%m%d') ) "));
+ if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(listCar)){
+ telecomInParkDataVO.setInCarNum(
+ new HashSet<>(listCar.stream().map(i->i.getCarCode()).collect(Collectors.toList())).size()
+ );
+ }
+
+
+ List<InoutRecord> listUser = inoutRecordMapper.selectList(new MPJLambdaWrapper<InoutRecord>()
+ .eq(InoutRecord::getIsdeleted,Constants.ZERO)
+ .eq(InoutRecord::getInOrOut,Constants.ZERO)
+ .isNotNull(InoutRecord::getMemberPhone)
+ .apply(" ( DATE_FORMAT(CREATE_DATE, '%Y%m%d') = DATE_FORMAT(now(), '%Y%m%d') ) "));
+ if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(listUser)){
+ telecomInParkDataVO.setInUserNum(
+ new HashSet<>(listUser.stream().map(i->i.getMemberPhone()).collect(Collectors.toList())).size()
+ );
+ }
+
+ return telecomInParkDataVO;
+ }
+
+
+
}
--
Gitblit v1.9.3