From 10c86e25b336b87486fed9434be9439a4c72e161 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期一, 26 二月 2024 16:59:20 +0800
Subject: [PATCH] ERP接口
---
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java | 5 ++++-
server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Visits.java | 4 ++++
server/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java | 9 ++++++++-
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Visits.java b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Visits.java
index 0319466..3118a34 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Visits.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/dao/business/model/Visits.java
@@ -272,6 +272,10 @@
@TableField(exist = false)
private Integer timeOut;
+ @ApiModelProperty(value = "闅忚杞﹁締鏁伴噺", example = "1")
+ @TableField(exist = false)
+ private Integer carNum;
+
@ApiModelProperty(value = "瓒呮椂鐘舵��0鏈秴鏃讹紝1宸茶秴鏃讹紝2鍗冲皢瓒呮椂", example = "1")
@TableField(exist = false)
private Integer outStatus;
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
index b8682cc..5ff23a5 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
@@ -886,13 +886,16 @@
.eq(Member::getPhone,checkVisitedDTO.getMobile())
.eq(validType.equals(Constants.ONE),Member::getName,checkVisitedDTO.getName())
.eq(Member::getIsdeleted,Constants.ZERO)
- .eq(Member::getStatus,Constants.ZERO)
+// .eq(Member::getStatus,Constants.ZERO)
.eq(Member::getCanVisit,Constants.ONE)
.eq(Member::getType,Constants.memberType.internal)
.last(" limit 1 ")
);
MemberVO memberVO = new MemberVO();
if(!Objects.isNull(member)){
+ if(!member.getStatus().equals(Constants.ZERO)){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"琚浜鸿处鍙峰紓甯革紝璇风‘璁ゅ悗鍐嶈瘯");
+ }
BeanUtils.copyProperties(member,memberVO);
}else{
throw new BusinessException(ResponseStatus.DATA_EMPTY);
diff --git a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
index c6a99d6..b41f0ac 100644
--- a/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
+++ b/server/dmvisit_service/src/main/java/com/doumee/service/business/impl/VisitsServiceImpl.java
@@ -123,7 +123,7 @@
//鏅�氳瀹�
visits.setType(Constants.ONE);
//闅忚浜哄憳鏁伴噺
- visits.setMemberNum(CollectionUtils.isNotEmpty(visits.getWithUserList())?visits.getWithUserList().size()+1:1);
+ visits.setMemberNum(CollectionUtils.isNotEmpty(visits.getWithUserList())?visits.getWithUserList().size():0);
//璁垮淇℃伅(浣跨敤韬唤璇佸彿鏌ヨ鏄惁宸插瓨鍦ㄦ敼鏅�氳瀹紝娌℃湁鍒欐柊澧烇紝瀛樺湪鍒欐洿鏂皁penid绛変俊鎭�),鍖呮嫭闅忚浜哄憳鏍¢獙鍜屽鐞�
Member member =dealMemberAndVisits(visits);
visits.setMemberId(member.getId());
@@ -978,6 +978,7 @@
MPJLambdaWrapper<Visits> queryWrapper = new MPJLambdaWrapper<>();
queryWrapper.selectAll(Visits.class);
+ queryWrapper.select(" ( select count(distinct(v.CAR_NOS)) from visits v where v.PARENT_ID = t.ID and v.CAR_NOS is not null and v.CAR_NOS != '' and v.CAR_NOS != t.CAR_NOS ) as carNum ");
queryWrapper.selectAs(Member::getName,Visits::getReceptMemberName);
queryWrapper.selectAs(Company::getName,Visits::getReceptMemberDepartment);
queryWrapper.leftJoin(Member.class,Member::getId,Visits::getReceptMemberId);
@@ -993,6 +994,12 @@
queryWrapper.isNull(Visits::getParentId);
queryWrapper.orderByDesc(Visits::getCreateDate);
IPage<Visits> result = visitsJoinMapper.selectJoinPage(page, Visits.class,queryWrapper);
+
+ for (Visits visits:result.getRecords()) {
+ if(StringUtils.isNotBlank(visits.getCarNos())){
+ visits.setCarNum(visits.getCarNum() + Constants.ONE);
+ }
+ }
return PageData.from(result);
}
--
Gitblit v1.9.3