From b682979d0d4fbcb00860713db1fbacbafb1d3547 Mon Sep 17 00:00:00 2001 From: lijiarao Date: Thu, 1 Feb 2024 17:38:14 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix=2081518=20=E6=9C=AA=E7=AC=A6=E5=90=88?= =?UTF-8?q?=E9=A1=B9-=E7=BC=96=E8=BE=91=E6=B2=A1=E6=9C=89=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E6=97=B6=E9=97=B4=E9=87=8D=E6=96=B0=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/LawsEvaluationNotMetServiceImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/laws-modules/src/main/java/com/jero/modules/projectLibrary/service/impl/LawsEvaluationNotMetServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/projectLibrary/service/impl/LawsEvaluationNotMetServiceImpl.java index 5f4b070c..0fbd2802 100644 --- a/laws-modules/src/main/java/com/jero/modules/projectLibrary/service/impl/LawsEvaluationNotMetServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/projectLibrary/service/impl/LawsEvaluationNotMetServiceImpl.java @@ -165,10 +165,12 @@ public class LawsEvaluationNotMetServiceImpl extends ServiceImpl= 0){ + lawsEvaluationNotMet.setState(AssessCommon.TO_BE_RECTIFIED); } } From 004b7aa5faecffc481aff27122d886f640af9eaf Mon Sep 17 00:00:00 2001 From: caihaohan Date: Thu, 1 Feb 2024 17:40:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=E8=81=94=E7=BB=9C=E4=BA=BA?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=A2=9E=E5=8A=A0=E9=87=8D=E5=A4=8D=E8=81=94?= =?UTF-8?q?=E7=BB=9C=E4=BA=BA=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/LawsContactManageServiceImpl.java | 308 +++++++++--------- 1 file changed, 157 insertions(+), 151 deletions(-) diff --git a/laws-modules/src/main/java/com/jero/modules/laws/system/service/impl/LawsContactManageServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/system/service/impl/LawsContactManageServiceImpl.java index 0f9148ef..f456e3bf 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/system/service/impl/LawsContactManageServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/system/service/impl/LawsContactManageServiceImpl.java @@ -29,7 +29,7 @@ import java.util.stream.Collectors; /** * @Description: 联络人管理 * @Author: jero-boot - * @Date: 2023-10-13 + * @Date: 2023-10-13 * @Version: V1.0 */ @Slf4j @@ -37,8 +37,8 @@ import java.util.stream.Collectors; @Transactional(rollbackFor = JeroBootException.class) public class LawsContactManageServiceImpl extends ServiceImpl implements ILawsContactManageService { - @Resource - private ISysUserService sysUserService; + @Resource + private ISysUserService sysUserService; /** * 分页查询 @@ -51,50 +51,50 @@ public class LawsContactManageServiceImpl extends ServiceImpl queryPage(LawsContactManage lawsContactManage, Integer pageNo, Integer pageSize, - HttpServletRequest req) { + HttpServletRequest req) { QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(lawsContactManage, req.getParameterMap()); - if (StringUtils.isNotBlank(lawsContactManage.getContact())){ - List userList = sysUserService.list(new LambdaQueryWrapper() - .like(SysUser::getRealname, lawsContactManage.getContact())); - if (userList.isEmpty()){ - return new Page<>(pageNo, pageSize); - } - queryWrapper.in("contact_id", userList.stream().map(SysUser::getId).collect(Collectors.toList())); - } + if (StringUtils.isNotBlank(lawsContactManage.getContact())) { + List userList = sysUserService.list(new LambdaQueryWrapper() + .like(SysUser::getRealname, lawsContactManage.getContact())); + if (userList.isEmpty()) { + return new Page<>(pageNo, pageSize); + } + queryWrapper.in("contact_id", userList.stream().map(SysUser::getId).collect(Collectors.toList())); + } Page page = new Page<>(pageNo, pageSize); return page(page, queryWrapper); } - /** - * 分页查询 - * - * @param lawsContactManage - * @param pageNo - * @param pageSize - * @param req - * @return - */ - @Override - public IPage queryPageMerge(LawsContactManage lawsContactManage, Integer pageNo, Integer pageSize, - HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(lawsContactManage, req.getParameterMap()); - queryWrapper.select("group_concat(id) as id, group_concat(create_by) as create_by, max(create_time) as create_time, " + - "group_concat(update_by) as update_by, max(update_time) as update_time, group_concat(org_code) as org_code," + - " group_concat(depart_name) as depart_name, group_concat(depart_id) as depart_id, " + - "group_concat(engineer_id) as engineer_id, group_concat(leader_id) as leader_id,contact_id "); - String contactId = "contact_id"; - if (StringUtils.isNotBlank(lawsContactManage.getContact())){ - List userList = sysUserService.list(new LambdaQueryWrapper() - .like(SysUser::getRealname, lawsContactManage.getContact())); - if (userList.isEmpty()){ - return new Page<>(pageNo, pageSize); - } - queryWrapper.in(contactId, userList.stream().map(SysUser::getId).collect(Collectors.toList())); - } - queryWrapper.groupBy(contactId); - Page page = new Page<>(pageNo, pageSize); - return page(page, queryWrapper); - } + /** + * 分页查询 + * + * @param lawsContactManage + * @param pageNo + * @param pageSize + * @param req + * @return + */ + @Override + public IPage queryPageMerge(LawsContactManage lawsContactManage, Integer pageNo, Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(lawsContactManage, req.getParameterMap()); + queryWrapper.select("group_concat(id) as id, group_concat(create_by) as create_by, max(create_time) as create_time, " + + "group_concat(update_by) as update_by, max(update_time) as update_time, group_concat(org_code) as org_code," + + " group_concat(depart_name) as depart_name, group_concat(depart_id) as depart_id, " + + "group_concat(engineer_id) as engineer_id, group_concat(leader_id) as leader_id,contact_id "); + String contactId = "contact_id"; + if (StringUtils.isNotBlank(lawsContactManage.getContact())) { + List userList = sysUserService.list(new LambdaQueryWrapper() + .like(SysUser::getRealname, lawsContactManage.getContact())); + if (userList.isEmpty()) { + return new Page<>(pageNo, pageSize); + } + queryWrapper.in(contactId, userList.stream().map(SysUser::getId).collect(Collectors.toList())); + } + queryWrapper.groupBy(contactId); + Page page = new Page<>(pageNo, pageSize); + return page(page, queryWrapper); + } /** * 列表查询 @@ -108,24 +108,30 @@ public class LawsContactManageServiceImpl extends ServiceImpl queryLawsContactManage = new LambdaQueryWrapper<>(); - queryLawsContactManage.eq(LawsContactManage::getDepartId,lawsContactManage.getDepartId()); - queryLawsContactManage.eq(LawsContactManage::getEngineerId,lawsContactManage.getEngineerId()); - queryLawsContactManage.eq(LawsContactManage::getContactId,lawsContactManage.getContactId()); - queryLawsContactManage.eq(LawsContactManage::getLeaderId,lawsContactManage.getLeaderId()); - long l = count(queryLawsContactManage); - if(l > 0){ - throw new JeroBootException("部门名称+标准化工程师+联络人+部门联络人主管级领导已存在"); - } + // 验证 部门名称+标准化工程师+联络人+部门联络人主管级领导唯一 + LambdaQueryWrapper queryLawsContactManage = new LambdaQueryWrapper<>(); + queryLawsContactManage.eq(LawsContactManage::getDepartId, lawsContactManage.getDepartId()); + queryLawsContactManage.eq(LawsContactManage::getContactId, lawsContactManage.getContactId()); + queryLawsContactManage.eq(LawsContactManage::getLeaderId, lawsContactManage.getLeaderId()); + long l = count(queryLawsContactManage); + if (l > 0) { + throw new JeroBootException("部门和联络人匹配关系已存在,请重新选择"); + } + + queryLawsContactManage.clear(); + queryLawsContactManage.eq(LawsContactManage::getContactId, lawsContactManage.getContactId()); + long n = count(queryLawsContactManage); + if (n > 0) { + throw new JeroBootException("已存在相同的联络人"); + } Date now = new Date(); lawsContactManage.setCreateTime(now); @@ -133,114 +139,114 @@ public class LawsContactManageServiceImpl extends ServiceImpl queryLawsContactManage = new LambdaQueryWrapper<>(); - queryLawsContactManage.eq(LawsContactManage::getDepartId,lawsContactManage.getDepartId()); - queryLawsContactManage.eq(LawsContactManage::getEngineerId,lawsContactManage.getEngineerId()); - queryLawsContactManage.eq(LawsContactManage::getContactId,lawsContactManage.getContactId()); - queryLawsContactManage.eq(LawsContactManage::getLeaderId,lawsContactManage.getLeaderId()); - queryLawsContactManage.ne(LawsContactManage::getId,lawsContactManage.getId()); - long l = count(queryLawsContactManage); - if(l > 0){ - throw new JeroBootException("部门名称+标准化工程师+联络人+部门联络人主管级领导已存在"); - } - Date now = new Date(); + // 验证 部门名称+标准化工程师+联络人+部门联络人主管级领导唯一 + LambdaQueryWrapper queryLawsContactManage = new LambdaQueryWrapper<>(); + queryLawsContactManage.eq(LawsContactManage::getDepartId, lawsContactManage.getDepartId()); + queryLawsContactManage.eq(LawsContactManage::getEngineerId, lawsContactManage.getEngineerId()); + queryLawsContactManage.eq(LawsContactManage::getContactId, lawsContactManage.getContactId()); + queryLawsContactManage.eq(LawsContactManage::getLeaderId, lawsContactManage.getLeaderId()); + queryLawsContactManage.ne(LawsContactManage::getId, lawsContactManage.getId()); + long l = count(queryLawsContactManage); + if (l > 0) { + throw new JeroBootException("部门名称+标准化工程师+联络人+部门联络人主管级领导已存在"); + } + Date now = new Date(); lawsContactManage.setUpdateTime(now); - saveOrUpdate(lawsContactManage); + saveOrUpdate(lawsContactManage); } - /** - * 通过id删除 - * - * @param id - * @return - */ - @Override + /** + * 通过id删除 + * + * @param id + * @return + */ + @Override public void deleteById(String id) { removeById(id); } - /** - * 批量删除 - * - * @param ids - * @return - */ - @Override + /** + * 批量删除 + * + * @param ids + * @return + */ + @Override public void deleteByIds(List ids) { removeByIds(ids); } - /** - * 通过id查询 - * - * @param id - * @return - */ - @Override + /** + * 通过id查询 + * + * @param id + * @return + */ + @Override public LawsContactManage queryById(String id) { return getById(id); } - @Override - public String findContactUserByDept(String deptId) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(LawsContactManage::getDepartId, deptId); - List list = list(wrapper); - if (list == null || list.isEmpty()) { - return null; - } else { - String contactUserId = list.get(0).getContactId(); - SysUser user = sysUserService.getById(contactUserId); - // 判断用户是否有效 - if (user == null) { - log.info("部门{}的联络人{}已经被删除", deptId, contactUserId); - return null; - } else { - return contactUserId; - } - } - } + @Override + public String findContactUserByDept(String deptId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(LawsContactManage::getDepartId, deptId); + List list = list(wrapper); + if (list == null || list.isEmpty()) { + return null; + } else { + String contactUserId = list.get(0).getContactId(); + SysUser user = sysUserService.getById(contactUserId); + // 判断用户是否有效 + if (user == null) { + log.info("部门{}的联络人{}已经被删除", deptId, contactUserId); + return null; + } else { + return contactUserId; + } + } + } - @Override - public String findStandardEngineerByDept(String deptId) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(LawsContactManage::getDepartId, deptId); - List list = list(wrapper); - if (list == null || list.isEmpty()) { - return null; - } else { - String engineerId = list.get(0).getEngineerId(); - SysUser user = sysUserService.getById(engineerId); - // 判断用户是否有效 - if (user == null) { - log.info("部门{}的联络人{}已经被删除", deptId, engineerId); - return null; - } else { - return engineerId; - } - } - } + @Override + public String findStandardEngineerByDept(String deptId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(LawsContactManage::getDepartId, deptId); + List list = list(wrapper); + if (list == null || list.isEmpty()) { + return null; + } else { + String engineerId = list.get(0).getEngineerId(); + SysUser user = sysUserService.getById(engineerId); + // 判断用户是否有效 + if (user == null) { + log.info("部门{}的联络人{}已经被删除", deptId, engineerId); + return null; + } else { + return engineerId; + } + } + } - @Override - public List queryByDepartIds(String deptIds) { - List lawsContactManageList = new ArrayList<>(); - if (StringUtils.isNotBlank(deptIds)){ - List departIdList = Arrays.asList(deptIds.split(",")); - lawsContactManageList = list(new LambdaQueryWrapper() - .in(LawsContactManage::getDepartId, departIdList)); - for (LawsContactManage lawsContactManage : lawsContactManageList) { - lawsContactManage.setContactIdDictText(sysUserService.dictByIdsOrUserNames(lawsContactManage.getContactId(), "")); - } - } - return lawsContactManageList; - } + @Override + public List queryByDepartIds(String deptIds) { + List lawsContactManageList = new ArrayList<>(); + if (StringUtils.isNotBlank(deptIds)) { + List departIdList = Arrays.asList(deptIds.split(",")); + lawsContactManageList = list(new LambdaQueryWrapper() + .in(LawsContactManage::getDepartId, departIdList)); + for (LawsContactManage lawsContactManage : lawsContactManageList) { + lawsContactManage.setContactIdDictText(sysUserService.dictByIdsOrUserNames(lawsContactManage.getContactId(), "")); + } + } + return lawsContactManageList; + } }