From 7298d5354963a88643a543b51b90192dc9fc934c Mon Sep 17 00:00:00 2001 From: doum <doum> Date: 星期四, 11 九月 2025 18:43:14 +0800 Subject: [PATCH] 最新版本541200007 --- server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformGroupServiceImpl.java | 65 ++++++++++++++++++++++++++++++-- 1 files changed, 61 insertions(+), 4 deletions(-) diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformGroupServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformGroupServiceImpl.java index cebd0dd..2efeca7 100644 --- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformGroupServiceImpl.java +++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformGroupServiceImpl.java @@ -2,6 +2,10 @@ import com.doumee.core.constants.ResponseStatus; import com.doumee.core.exception.BusinessException; +import com.doumee.core.wx.wxPlat.WxPlatConstants; +import com.doumee.core.wx.wxPlat.WxPlatNotice; +import com.doumee.dao.system.SystemUserMapper; +import com.doumee.dao.system.model.SystemUser; import com.doumee.service.business.third.model.LoginUserInfo; import com.doumee.service.business.third.model.PageData; import com.doumee.service.business.third.model.PageWrap; @@ -21,13 +25,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.github.yulichang.wrapper.MPJLambdaWrapper; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.Date; -import java.util.List; -import java.util.Objects; +import java.util.*; import java.util.stream.Collectors; /** @@ -40,6 +43,8 @@ @Autowired private PlatformGroupMapper platformGroupMapper; + @Autowired + private SystemUserMapper systemUserMapper; @Autowired private PlatformJoinMapper platformJoinMapper; @@ -188,7 +193,53 @@ queryWrapper.orderByAsc(sortData.getProperty()); } } - return PageData.from(platformGroupMapper.selectPage(page, queryWrapper)); + PageData<PlatformGroup> result =PageData.from(platformGroupMapper.selectPage(page, queryWrapper)); + if(result !=null && result.getRecords()!=null){ + List<String > ids0 = new ArrayList<>(); + List<SystemUser> systemUserList ; + for(PlatformGroup platformGroup : result.getRecords()){ + if( StringUtils.isNotBlank(platformGroup.getSignInNoticeUsers()) || StringUtils.isNotBlank(platformGroup.getUnFinishNoticeUsers())) { + if( StringUtils.isNotBlank(platformGroup.getSignInNoticeUsers()) ){ + ids0.addAll(Arrays.asList(platformGroup.getSignInNoticeUsers().split(","))); + } + if( StringUtils.isNotBlank(platformGroup.getUnFinishNoticeUsers()) ){ + ids0.addAll(Arrays.asList(platformGroup.getUnFinishNoticeUsers().split(","))); + } + } + } + systemUserList = systemUserMapper.selectList(new QueryWrapper<SystemUser>().lambda() + .eq(SystemUser::getDeleted, Constants.ZERO) + .in(SystemUser::getMemberId,ids0) ); + if (systemUserList!=null) { + for(PlatformGroup platformGroup : result.getRecords()){ + platformGroup.setSignInNoticeUserNames(getUserNameFromList(0,platformGroup,systemUserList)); + platformGroup.setUnFinishNoticeUserNames(getUserNameFromList(1,platformGroup,systemUserList)); + } + } + } + + return result; + } + + private String getUserNameFromList(int i, PlatformGroup platformGroup, List<SystemUser> systemUserList) { + String ids = i ==0?platformGroup.getSignInNoticeUsers():platformGroup.getUnFinishNoticeUsers(); + String name = ""; + if( StringUtils.isNotBlank(ids)) { + List<String > ids0 = Arrays.asList(ids.split(",")); + if (systemUserList!=null) { + for(SystemUser user :systemUserList){ + for(String s : ids0){ + if(StringUtils.equals(user.getMemberId().toString(),s)){ + if(StringUtils.isNotBlank(name)){ + name += ","; + } + name += StringUtils.defaultString(user.getRealname(),user.getUsername()); + } + } + } + } + } + return name; } @Override @@ -219,6 +270,7 @@ .eq(Platform::getIsdeleted, Constants.ZERO) .eq(Objects.nonNull(platformDataDTO.getQueryType())&&!Constants.equalsInteger(platformDataDTO.getQueryType(),Constants.ZERO), Platform::getStatus,Constants.ZERO) + .orderByAsc(Platform::getSortnum) ); //澶勭悊鎴戠殑鏈堝彴淇℃伅 鏄惁閰嶇疆闅愯棌 if(Constants.equalsInteger(platformDataDTO.getQueryType(),Constants.ONE)){ @@ -297,6 +349,11 @@ || Constants.equalsInteger(i.getPlatformGroupId(),platform.getGroupId()) ).collect(Collectors.toList()); if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platformJobs)){ + for(PlatformJob i :platformJobList){ + if(Constants.equalsInteger(i.getOrigin(),Constants.ZERO)){ + i.setWmsContractNum(i.getContractNum()); + } + } platformWorkVO.setWorkNum( platformJobs.stream().filter(i->Constants.equalsInteger(i.getPlatformId(),platform.getId()) && Constants.equalsInteger(i.getStatus(),Constants.PlatformJobStatus.WORKING.getKey())).collect(Collectors.toList()).size() ); -- Gitblit v1.9.3