优化操作流程2/3

This commit is contained in:
xiaofajia 2024-12-10 16:33:57 +08:00
parent b482acf254
commit 10ea5856b3
4 changed files with 72 additions and 3 deletions

View File

@ -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));
}
}

View File

@ -108,4 +108,13 @@ public interface AppInspectionPartnerService extends IService<ShopMallPartners>
//新检测金额折线图
JSONObject newChartLineInspectionAmount(String unit);
/**
* 根据inspection_info的id查有的项目名称
*
* @author 小李
* @date 14:52 2024/12/10
* @param ids inspection_info的id
**/
Map<Long, String> getProjectByIds(Long[] ids);
}

View File

@ -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<AppInspectionPa
private IInspectionWorkNodeService inspectionWorkNodeService;
@Autowired
private IShopMallPartnersService partnersService;
@Resource
private DlInspectionProjectService projectService;
@Override
public IPage<PartnerListVo> partnerList(Page<PartnerListVo> page, PartnerListQuery partnerListQuery) {
@ -1899,4 +1904,40 @@ public class AppInspectionPartnerServiceImpl extends ServiceImpl<AppInspectionPa
return res;
}
/**
* 根据inspection_info的id查有的项目名称
*
* @author 小李
* @date 14:52 2024/12/10
* @param ids inspection_info的id
**/
@Override
public Map<Long, String> getProjectByIds(Long[] ids){
List<InspectionWorkNode> inspectionWorkNodes = inspectionWorkNodeService.
list(new LambdaQueryWrapper<InspectionWorkNode>()
.in(InspectionWorkNode::getInspectionInfoId, Arrays.asList(ids)));
if (ObjectUtil.isEmpty(inspectionWorkNodes)){
return null;
}
List<String> projectIds = inspectionWorkNodes.stream().map(InspectionWorkNode::getProjectId).collect(Collectors.toList());
if (CollUtil.isEmpty(projectIds)){
return null;
}
List<DlInspectionProject> projects = projectService.listByIds(projectIds);
if (CollUtil.isEmpty(projects)){
return null;
}
Map<String, String> projectMap = projects.stream().collect(Collectors.toMap(DlInspectionProject::getId, DlInspectionProject::getProjectName));
Map<Long, String> result = new HashMap<>();
Map<Long, List<String>> map = inspectionWorkNodes.stream().collect(Collectors
.groupingBy(InspectionWorkNode::getInspectionInfoId,
Collectors.mapping(InspectionWorkNode::getProjectId, Collectors.toList())));
for (Long id : ids) {
List<String> values = map.get(id);
String names = values.stream().filter(projectMap::containsKey).map(projectMap::get).collect(Collectors.joining(","));
result.put(id, names);
}
return result;
}
}

View File

@ -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"
<if test="inspectionInfo.carNum != null">
AND ii.car_num LIKE CONCAT('%', #{inspectionInfo.carNum}, '%')
</if>
<!-- 待接受 -->
<!-- 待支付 -->
<if test="inspectionInfo.status == '0'.toString()">
and (oi.pay_time is null)
ORDER BY iwn.update_time DESC
</if>
<!-- 待接受(待检测) -->
<if test="inspectionInfo.status == 1">
AND <!-- 工单负责人或角色ID匹配 -->
(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
</if>
<!-- 进行中 -->
<!-- 进行中(检测中) -->
<if test="inspectionInfo.status == 2">
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
</if>
<!-- 已完成 -->
<if test="inspectionInfo.status == 3">
<if test="inspectionInfo.status == 5">
AND iwn.status = '2'
AND iwn.deal_user_id = #{inspectionInfo.dealUserId}
ORDER BY iwn.update_time DESC