diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java index 472801d9..d4e3833b 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/controller/PartnerOwnController.java @@ -754,4 +754,16 @@ public class PartnerOwnController extends BaseController { return success(partnerList.staticsTable5(partners.getPartnerId(),startTime,endTime)); } + /** + * 根据inspection_info的id查有的项目名称 + * + * @author 小李 + * @date 14:52 2024/12/10 + * @param ids inspection_info的id + **/ + @GetMapping("/getProjectByIds") + public CommonResult getProjectByIds(Long[] ids) { + return success(partnerList.getProjectByIds(ids)); + } + } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java index 3c998583..e0b6d94d 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/AppInspectionPartnerService.java @@ -108,4 +108,13 @@ public interface AppInspectionPartnerService extends IService //新检测金额折线图 JSONObject newChartLineInspectionAmount(String unit); + + /** + * 根据inspection_info的id查有的项目名称 + * + * @author 小李 + * @date 14:52 2024/12/10 + * @param ids inspection_info的id + **/ + Map getProjectByIds(Long[] ids); } diff --git a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java index 8fd50073..86ea8825 100644 --- a/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java +++ b/dl-module-inspection/src/main/java/cn/iocoder/yudao/module/inspection/service/impl/AppInspectionPartnerServiceImpl.java @@ -1,5 +1,6 @@ package cn.iocoder.yudao.module.inspection.service.impl; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.ObjectUtil; @@ -62,6 +63,8 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.LocalDateTime; @@ -124,6 +127,8 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl partnerList(Page page, PartnerListQuery partnerListQuery) { @@ -1899,4 +1904,40 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl getProjectByIds(Long[] ids){ + List inspectionWorkNodes = inspectionWorkNodeService. + list(new LambdaQueryWrapper() + .in(InspectionWorkNode::getInspectionInfoId, Arrays.asList(ids))); + if (ObjectUtil.isEmpty(inspectionWorkNodes)){ + return null; + } + List projectIds = inspectionWorkNodes.stream().map(InspectionWorkNode::getProjectId).collect(Collectors.toList()); + if (CollUtil.isEmpty(projectIds)){ + return null; + } + List projects = projectService.listByIds(projectIds); + if (CollUtil.isEmpty(projects)){ + return null; + } + Map projectMap = projects.stream().collect(Collectors.toMap(DlInspectionProject::getId, DlInspectionProject::getProjectName)); + Map result = new HashMap<>(); + Map> map = inspectionWorkNodes.stream().collect(Collectors + .groupingBy(InspectionWorkNode::getInspectionInfoId, + Collectors.mapping(InspectionWorkNode::getProjectId, Collectors.toList()))); + for (Long id : ids) { + List values = map.get(id); + String names = values.stream().filter(projectMap::containsKey).map(projectMap::get).collect(Collectors.joining(",")); + result.put(id, names); + } + return result; + } + } diff --git a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml index 40357fca..0c1feeb3 100644 --- a/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml +++ b/dl-module-inspection/src/main/resources/mapper/inspection/InspectionInfoMapper.xml @@ -277,6 +277,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" iwn.status AS workNodeStatus, oi.order_no AS orderNo, oi.phonenumber AS buyPhone, + oi.goods_title as goodsTitle, + oi.sku_name as skuName, ip.project_name AS projectName, su.nickname AS leadManName, ROW_NUMBER() OVER (PARTITION BY ii.id ORDER BY iwn.update_time DESC) as rn -- 根据需要调整排序逻辑 @@ -295,7 +297,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND ii.car_num LIKE CONCAT('%', #{inspectionInfo.carNum}, '%') - + + + and (oi.pay_time is null) + ORDER BY iwn.update_time DESC + + AND (ii.lead_man_id = #{inspectionInfo.leadManId} @@ -308,7 +315,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -- AND ii.now_order_num = iwn.order_num ORDER BY ii.create_time DESC - + AND ii.status = '0' AND iwn.status = '1' @@ -316,7 +323,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ORDER BY iwn.update_time DESC - + AND iwn.status = '2' AND iwn.deal_user_id = #{inspectionInfo.dealUserId} ORDER BY iwn.update_time DESC