feat(sip): 优化项目信息查询和订单信息相关功能

- 新增选择客户、合作伙伴和人员的页面路由
- 优化项目信息查询条件,支持日期范围查询
- 修复项目订单信息插入逻辑,添加创建人和订单编号
- 优化项目信息列表查询,增加空列表判断
master
chenhao 2025-06-03 15:35:36 +08:00
parent e384ef51dc
commit 3480d55309
4 changed files with 39 additions and 15 deletions

View File

@ -40,6 +40,21 @@ public class ProjectInfoController extends BaseController
{
return prefix + "/project";
}
@GetMapping("/selectCustomer")
public String selectCustomer()
{
return prefix + "/selectCustomer";
}
@GetMapping("/selectPartner")
public String selectPartner()
{
return prefix + "/selectPartner";
}
@GetMapping("selectPeople")
public String selectPeople()
{
return prefix + "/selectPeople";
}
/**
*

View File

@ -92,6 +92,9 @@ public class ProjectInfoServiceImpl implements IProjectInfoService {
public List<ProjectInfo> selectProjectInfoList(ProjectInfo projectInfo) {
List<ProjectInfo> projectInfos = projectInfoMapper.selectProjectInfoList(projectInfo);
if (CollUtil.isEmpty(projectInfos)){
return projectInfos;
}
List<Long> idList = projectInfos.stream().map(ProjectInfo::getId).collect(Collectors.toList());
List<ProjectOrderInfo> projectOrderInfos = orderInfoService.selectProjectOrderInfoByProjectId(idList);
Map<Long, ProjectOrderInfo> orderInfoMap = projectOrderInfos.stream().collect(Collectors.toMap(ProjectOrderInfo::getProjectId, Function.identity(), (v1, v2) -> v1));

View File

@ -7,6 +7,7 @@ import java.util.stream.Collectors;
import cn.hutool.core.collection.CollUtil;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.sip.domain.ProjectOrderFileLog;
import com.ruoyi.sip.service.IProjectOrderFileLogService;
import org.springframework.beans.factory.annotation.Autowired;
@ -66,6 +67,8 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService {
@Override
public int insertProjectOrderInfo(ProjectOrderInfo projectOrderInfo) {
projectOrderInfo.setCreateTime(DateUtils.getNowDate());
projectOrderInfo.setCreateBy(ShiroUtils.getUserId().toString());
//todo 生成订单编号
return projectOrderInfoMapper.insertProjectOrderInfo(projectOrderInfo);
}

View File

@ -60,43 +60,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="estimatedOrderTime != null "> and estimated_order_time = #{estimatedOrderTime}</if>
<if test="estimatedOrderTimeStart != null or estimatedOrderTimeEnd != null">
<choose>
<when test="estimatedOrderTimeStart != null and estimatedOrderTimeEnd != null">
and estimated_order_time between date_format(#{estimatedOrderTimeStart}, '%Y-%m-%d 00:00:00') and date_format(#{estimatedOrderTimeEnd}, '%Y-%m-%d 23:59:59')
</when>
<when test="estimatedOrderTimeStart != null">
and estimated_order_time <![CDATA[ >= ]]> #{estimatedOrderTimeStart}
and estimated_order_time <![CDATA[ >= ]]> date_format(#{estimatedOrderTimeStart}, '%Y-%m-%d 00:00:00')
</when>
<when test="estimatedOrderTimeEnd != null">
and estimated_order_time <![CDATA[ <= ]]> #{estimatedOrderTimeEnd}
and estimated_order_time <![CDATA[ <= ]]> date_format(#{estimatedOrderTimeEnd}, '%Y-%m-%d 23:59:59')
</when>
<otherwise>
and estimated_order_time between #{estimatedOrderTimeStart} and #{estimatedOrderTimeEnd}
</otherwise>
</choose>
</if>
<if test="estimatedDeliverTime != null "> and estimated_deliver_time = #{estimatedDeliverTime}</if>
<if test="estimatedDeliverTimeStart != null or estimatedDeliverTimeEnd != null">
<choose>
<when test="estimatedDeliverTimeStart != null and estimatedDeliverTimeEnd != null">
and estimated_deliver_time between date_format(#{estimatedDeliverTimeStart}, '%Y-%m-%d 00:00:00') and date_format(#{estimatedDeliverTimeEnd}, '%Y-%m-%d 23:59:59')
</when>
<when test="estimatedDeliverTimeStart != null">
and estimated_deliver_time <![CDATA[ >= ]]> #{estimatedDeliverTimeStart}
and estimated_deliver_time <![CDATA[ >= ]]> date_format(#{estimatedDeliverTimeStart}, '%Y-%m-%d 00:00:00')
</when>
<when test="estimatedDeliverTimeEnd != null">
and estimated_deliver_time <![CDATA[ <= ]]> #{estimatedDeliverTimeEnd}
and estimated_deliver_time <![CDATA[ <= ]]> date_format(#{estimatedDeliverTimeEnd}, '%Y-%m-%d 23:59:59')
</when>
<otherwise>
and estimated_deliver_time between #{estimatedDeliverTimeStart} and #{estimatedDeliverTimeEnd}
</otherwise>
</choose>
</if>
<if test="updateTimeStart != null or updateTimeEnd != null">
<choose>
<when test="updateTimeStart != null and updateTimeEnd != null">
and update_time between date_format(#{updateTimeStart}, '%Y-%m-%d 00:00:00') and date_format(#{updateTimeEnd}, '%Y-%m-%d 23:59:59')
</when>
<when test="updateTimeStart != null">
and update_time <![CDATA[ >= ]]> #{updateTimeStart}
and update_time <![CDATA[ >= ]]> date_format(#{updateTimeStart}, '%Y-%m-%d 00:00:00')
</when>
<when test="updateTimeEnd != null">
and update_time <![CDATA[ <= ]]> #{updateTimeEnd}
and update_time <![CDATA[ <= ]]> date_format(#{updateTimeEnd}, '%Y-%m-%d 23:59:59')
</when>
<otherwise>
and update_time between #{updateTimeStart} and #{updateTimeEnd}
</otherwise>
</choose>
</if>