From 1aa4436ce66ea4811a8c65cc76a6ec59cf5071bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E5=85=81=E6=9E=9E?= <3422692813@qq.com> Date: Mon, 11 Nov 2024 16:31:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BF=AE=E6=94=B9=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E9=A1=B9=E7=9B=AE=E6=8F=90=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/ProjectRoyaltyMapper.java | 2 +- .../impl/DlInspectionProjectServiceImpl.java | 8 ++++++-- .../impl/InspectionInfoServiceImpl.java | 18 +++++++++--------- .../impl/ProjectRoyaltyServiceImpl.java | 14 +++++++++++++- .../inspection/DlInspectionProjectMapper.xml | 2 +- .../mapper/inspection/ProjectRoyaltyMapper.xml | 17 ++++++++++++----- 6 files changed, 42 insertions(+), 19 deletions(-) diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/ProjectRoyaltyMapper.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/ProjectRoyaltyMapper.java index cb9ac2a3..c58cf383 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/ProjectRoyaltyMapper.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/mapper/ProjectRoyaltyMapper.java @@ -23,7 +23,7 @@ public interface ProjectRoyaltyMapper extends BaseMapper { void deleteByProjectId(String projectId); - List selectListByProjrctId(String projectId); + List selectListByProjrctId(@Param("projectId")String projectId,@Param("parentId") String parentId); void updtaBatch(@Param("list") List createReq); } \ No newline at end of file diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/DlInspectionProjectServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/DlInspectionProjectServiceImpl.java index 2dfcfdac..d1d00d39 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/DlInspectionProjectServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/DlInspectionProjectServiceImpl.java @@ -72,9 +72,13 @@ public class DlInspectionProjectServiceImpl extends ServiceImpl projectRoyaltyList = updateReqVO.getProjectRoyaltyList(); - projectRoyaltyService.updtaBatch(projectRoyaltyList); + //设置项目id + List collect = projectRoyaltyList.stream().map(item -> item.setProjectId(updateReqVO.getId())).collect(Collectors.toList()); + projectRoyaltyService.batchInsertProjectRoyalty(collect); } @Override diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java index dc8c034a..461a7ba5 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/InspectionInfoServiceImpl.java @@ -289,12 +289,12 @@ public class InspectionInfoServiceImpl extends ServiceImpl workerQueryWrapper = new LambdaQueryWrapper<>(); workerQueryWrapper.eq(PartnerWorker::getUserId, loginUser.getId()).eq(PartnerWorker::getPartnerId, partners.getPartnerId()); PartnerWorker worker = workerService.getOne(workerQueryWrapper); - AdminUserDO workerUser = userService.getUser(worker.getUserId()); - if (ObjectUtils.isNotEmpty(worker)) { - inspectionInfo.setWorkId(worker.getId()); - } else { - throw new Exception("请先将接待员加入员工"); - } + AdminUserDO workerUser = userService.getUser(loginUser.getId()); +// if (ObjectUtils.isNotEmpty(worker)) { + inspectionInfo.setWorkId(workerUser.getId()); +// } else { +// throw new Exception("请先将接待员加入员工"); +// } String buyName = StringUtils.isNotEmpty(inspectionInfo.getBuyName()) ? inspectionInfo.getBuyName() : "未知客户"; String buyPhone = StringUtils.isNotEmpty(inspectionInfo.getBuyPhone()) ? inspectionInfo.getBuyPhone() : StringUtils.isNotEmpty(inspectionInfo.getBuyName()) ? inspectionInfo.getBuyName() : "无"; AdminUserDO user = userService.getUserByMobile(buyPhone); @@ -385,17 +385,17 @@ public class InspectionInfoServiceImpl extends ServiceImpl geStelectInspection(IPage page,InspectionInfo inspectionInfo) { + public IPage geStelectInspection(IPage page, InspectionInfo inspectionInfo) { //获取当前登录人 LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); //获取当前登陆人的角色 List byUserId = roleService.getByUserId(loginUser.getId()); List roleIds = byUserId.stream().map(UserRoleDO::getRoleId).collect(Collectors.toList()); - if(!"1".equals(inspectionInfo.getStatus())){ + if (!"1".equals(inspectionInfo.getStatus())) { //进行中 已完成 inspectionInfo.setDealUserId(loginUser.getId()); } - return baseMapper.selectByUser(page,roleIds,inspectionInfo); + return baseMapper.selectByUser(page, roleIds, inspectionInfo); } /** diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/ProjectRoyaltyServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/ProjectRoyaltyServiceImpl.java index 5b1a4c8b..47eb57d2 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/ProjectRoyaltyServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/ProjectRoyaltyServiceImpl.java @@ -2,10 +2,14 @@ package cn.iocoder.yudao.module.inspection.service.impl; import cn.iocoder.yudao.module.inspection.entity.ProjectRoyalty; import cn.iocoder.yudao.module.inspection.mapper.ProjectRoyaltyMapper; +import cn.iocoder.yudao.module.inspection.service.AppInspectionPartnerService; import cn.iocoder.yudao.module.inspection.service.ProjectRoyaltyService; import cn.iocoder.yudao.module.inspection.vo.ProjectRoyaltySaveReqVO; +import cn.iocoder.yudao.module.shop.entity.ShopMallPartners; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; @@ -24,6 +28,9 @@ public class ProjectRoyaltyServiceImpl extends ServiceImpl getProjectRoyaltyList(String projectId) { - return baseMapper.selectListByProjrctId(projectId); + try { + ShopMallPartners one = appInspectionPartnerService.shopInfoByUserId(); + return baseMapper.selectListByProjrctId(projectId, one.getPartnerId().toString()); + } catch (Exception e) { + throw new RuntimeException(e); + } } /** diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/DlInspectionProjectMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/DlInspectionProjectMapper.xml index 5e3a7fc3..43708546 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/DlInspectionProjectMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/DlInspectionProjectMapper.xml @@ -23,6 +23,6 @@ AND role_id = #{entity.roleId} - ORDER BY create_time DESC + ORDER BY update_time DESC \ No newline at end of file diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/ProjectRoyaltyMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/ProjectRoyaltyMapper.xml index 6ec80d45..2e55db6e 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/ProjectRoyaltyMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/ProjectRoyaltyMapper.xml @@ -30,13 +30,20 @@ - UPDATE inspection_project_royalty SET deleted = 1 WHERE project_id = #{projectId} + delete from inspection_project_royalty where project_id = #{projectId} + \ No newline at end of file