From 7eb2019aaee5002c2dac1a9f459c48189f9ce5fa Mon Sep 17 00:00:00 2001 From: wangzhijiang <12345678> Date: Wed, 6 Jul 2022 15:50:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B3=95=E8=A7=84=E6=84=8F=E8=A7=81=E6=94=B6?= =?UTF-8?q?=E9=9B=86-=E4=BF=9D=E5=AD=98=E5=8E=86=E5=8F=B2=E8=A1=A8?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=88=9B=E5=BB=BA=E4=BA=BA=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/LawsProcessHistoryEOServiceImpl.java | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsProcessHistoryEOServiceImpl.java b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsProcessHistoryEOServiceImpl.java index 7c9c84aa2..a8e64f79f 100644 --- a/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsProcessHistoryEOServiceImpl.java +++ b/jero-boot/jero-boot-modules/src/main/java/com/jero/modules/lawsOpinionGather/service/impl/LawsProcessHistoryEOServiceImpl.java @@ -13,13 +13,18 @@ import com.jero.modules.lawsOpinionGather.mapper.LawsProcessHistoryEOMapper; import com.jero.modules.lawsOpinionGather.service.ILawsProcessHistoryEOService; import com.jero.modules.project.enums.OperatorTypeEnum; import com.jero.modules.project.enums.RequestSourceEnum; +import com.jero.modules.system.entity.SysUser; +import com.jero.modules.system.service.ISysUserService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.List; import java.util.Date; +import java.util.stream.Collectors; + import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import javax.servlet.http.HttpServletRequest; @@ -33,6 +38,9 @@ import javax.servlet.http.HttpServletRequest; @Service public class LawsProcessHistoryEOServiceImpl extends ServiceImpl implements ILawsProcessHistoryEOService { + @Autowired + private ISysUserService sysUserService; + /** * 保存 * @@ -142,7 +150,27 @@ public class LawsProcessHistoryEOServiceImpl extends ServiceImpl createUserId = lawsProcessHistoryEOList.stream().map(LawsProcessHistoryEO::getCreateBy).distinct().collect(Collectors.toList()); + if(CollectionUtils.isNotEmpty(createUserId)){ + QueryWrapper queryUserWrapper = new QueryWrapper<>(); + queryUserWrapper.lambda().in(SysUser::getId,createUserId); + List sysUserList = sysUserService.getBaseMapper().selectList(queryUserWrapper); + + lawsProcessHistoryEOList.forEach(lawsProcessHistory -> { + String createBy = sysUserList.stream().filter(e -> { + boolean flag = false; + if (StringUtils.equals(e.getId(), lawsProcessHistory.getCreateBy())) { + flag = true; + } + return flag; + }).map(SysUser::getUsername).distinct().collect(Collectors.toList()).get(0); + lawsProcessHistory.setCreateBy(createBy); + }); + } + + this.saveBatch(lawsProcessHistoryEOList); + } } return new Result<>().success("调用成功!");