feat(sip): 新增根据业务编码列表查询订单信息功能
- 在IProjectOrderInfoService接口中新增listByCodeList方法 - 在ProjectOrderInfoController中添加uploadFinalFile属性 - 在ProjectOrderInfoMapper中新增listByCodeList方法 - 在ProjectOrderInfoMapper.xml中添加listByCodeList查询SQL - 在ProjectOrderInfoServiceImpl中实现listByCodeList方法 - 在Todo实体类中新增businessId和businessName字段 - 在TodoMapper.xml中优化查询条件并支持按业务名称搜索 - 在TodoServiceImpl中注入IProjectOrderInfoService并关联业务信息dev_1.0.0
parent
4729ed87ce
commit
98cb07b710
|
|
@ -276,6 +276,7 @@ public class ProjectOrderInfoController extends BaseController
|
||||||
("产品经理".equals(todoCompletedList.get(todoCompletedList.size() - 1).getTaskName()) || "商务".equals(todoCompletedList.get(todoCompletedList.size() - 1).getTaskName()))
|
("产品经理".equals(todoCompletedList.get(todoCompletedList.size() - 1).getTaskName()) || "商务".equals(todoCompletedList.get(todoCompletedList.size() - 1).getTaskName()))
|
||||||
: true;
|
: true;
|
||||||
mmap.put("updateFile", ShiroUtils.getSubject().hasRole("sale_assistant") && updateFlag);
|
mmap.put("updateFile", ShiroUtils.getSubject().hasRole("sale_assistant") && updateFlag);
|
||||||
|
mmap.put("uploadFinalFile",false);
|
||||||
return prefix + "/edit";
|
return prefix + "/edit";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,4 +96,8 @@ public class Todo extends BaseEntity
|
||||||
|
|
||||||
private Map<String, Object> variables;
|
private Map<String, Object> variables;
|
||||||
private List<ProjectTaxRateTemp> taxRateData;
|
private List<ProjectTaxRateTemp> taxRateData;
|
||||||
|
|
||||||
|
|
||||||
|
private Long businessId;
|
||||||
|
private String businessName;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,13 @@ import com.ruoyi.common.core.text.Convert;
|
||||||
import com.ruoyi.common.utils.StringUtils;
|
import com.ruoyi.common.utils.StringUtils;
|
||||||
import com.ruoyi.common.utils.bean.BeanUtils;
|
import com.ruoyi.common.utils.bean.BeanUtils;
|
||||||
import com.ruoyi.common.utils.spring.SpringUtils;
|
import com.ruoyi.common.utils.spring.SpringUtils;
|
||||||
|
import com.ruoyi.sip.domain.ProjectOrderInfo;
|
||||||
|
import com.ruoyi.sip.flowable.controller.TodoController;
|
||||||
import com.ruoyi.sip.flowable.domain.Todo;
|
import com.ruoyi.sip.flowable.domain.Todo;
|
||||||
import com.ruoyi.sip.flowable.mapper.TodoMapper;
|
import com.ruoyi.sip.flowable.mapper.TodoMapper;
|
||||||
import com.ruoyi.sip.flowable.service.TodoCommonTemplate;
|
import com.ruoyi.sip.flowable.service.TodoCommonTemplate;
|
||||||
import com.ruoyi.sip.flowable.service.TodoService;
|
import com.ruoyi.sip.flowable.service.TodoService;
|
||||||
|
import com.ruoyi.sip.service.IProjectOrderInfoService;
|
||||||
import com.ruoyi.system.mapper.SysUserMapper;
|
import com.ruoyi.system.mapper.SysUserMapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.ObjectUtils;
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
|
|
@ -29,6 +32,7 @@ import javax.annotation.Resource;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
|
|
@ -58,6 +62,9 @@ public class TodoServiceImpl implements TodoService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysUserMapper sysUserMapper;
|
private SysUserMapper sysUserMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IProjectOrderInfoService projectOrderInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询待办
|
* 查询待办
|
||||||
*
|
*
|
||||||
|
|
@ -133,8 +140,6 @@ public class TodoServiceImpl implements TodoService {
|
||||||
public List<Todo> selectTodoCompletedList(Todo todo) {
|
public List<Todo> selectTodoCompletedList(Todo todo) {
|
||||||
List<Todo> todoCompletedList = todoMapper.selectTodoCompletedList(todo);
|
List<Todo> todoCompletedList = todoMapper.selectTodoCompletedList(todo);
|
||||||
List<Todo> todoList = todoMapper.selectTodoList(todo);
|
List<Todo> todoList = todoMapper.selectTodoList(todo);
|
||||||
|
|
||||||
|
|
||||||
List<Long> collect = todoCompletedList.stream().map(item->Long.parseLong(item.getApproveUser())).collect(Collectors.toList());
|
List<Long> collect = todoCompletedList.stream().map(item->Long.parseLong(item.getApproveUser())).collect(Collectors.toList());
|
||||||
SysUser queryUserParam = new SysUser();
|
SysUser queryUserParam = new SysUser();
|
||||||
queryUserParam.setUserIdList(collect);
|
queryUserParam.setUserIdList(collect);
|
||||||
|
|
@ -153,6 +158,23 @@ public class TodoServiceImpl implements TodoService {
|
||||||
todoDto.setNextAllApproveUserName(nextApproveUserName);
|
todoDto.setNextAllApproveUserName(nextApproveUserName);
|
||||||
todoDto.setRoleName(userRoleMap.get(Long.parseLong(todoDto.getApproveUser())));
|
todoDto.setRoleName(userRoleMap.get(Long.parseLong(todoDto.getApproveUser())));
|
||||||
}
|
}
|
||||||
|
//关联业务信息
|
||||||
|
List<String> businessKeyList = todoCompletedList.stream().map(Todo::getBusinessKey).collect(Collectors.toList());
|
||||||
|
if (CollUtil.isNotEmpty(businessKeyList)){
|
||||||
|
List<ProjectOrderInfo> orderInfoList = projectOrderInfoService.listByCodeList(businessKeyList);
|
||||||
|
Map<String, ProjectOrderInfo> orderInfoMap = orderInfoList.stream().collect(Collectors.toMap(ProjectOrderInfo::getOrderCode, Function.identity(), (v1, v2) -> v1));
|
||||||
|
todoCompletedList.forEach(item -> {
|
||||||
|
ProjectOrderInfo projectOrderInfo = orderInfoMap.get(item.getBusinessKey());
|
||||||
|
if (ObjectUtils.isEmpty(projectOrderInfo)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
item.setBusinessId(projectOrderInfo.getId());
|
||||||
|
item.setBusinessName(projectOrderInfo.getProjectName());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return todoCompletedList;
|
return todoCompletedList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,4 +77,6 @@ public interface ProjectOrderInfoMapper
|
||||||
void bakData(ProjectOrderInfo projectOrderInfo);
|
void bakData(ProjectOrderInfo projectOrderInfo);
|
||||||
|
|
||||||
List<OrderInfoVo> listOrderInfoVo(ProjectOrderInfo queryParams);
|
List<OrderInfoVo> listOrderInfoVo(ProjectOrderInfo queryParams);
|
||||||
|
|
||||||
|
List<ProjectOrderInfo> listByCodeList(List<String> businessKeyList);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,4 +96,6 @@ public interface IProjectOrderInfoService
|
||||||
* @return 填充后的文件字节数组
|
* @return 填充后的文件字节数组
|
||||||
*/
|
*/
|
||||||
byte[] exportContractTemplate(ProjectOrderInfo orderInfo);
|
byte[] exportContractTemplate(ProjectOrderInfo orderInfo);
|
||||||
|
|
||||||
|
List<ProjectOrderInfo> listByCodeList(List<String> businessKeyList);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1313,6 +1313,11 @@ public class ProjectOrderInfoServiceImpl implements IProjectOrderInfoService, To
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProjectOrderInfo> listByCodeList(List<String> businessKeyList) {
|
||||||
|
return projectOrderInfoMapper.listByCodeList(businessKeyList);
|
||||||
|
}
|
||||||
|
|
||||||
private void replaceTextInDocument(XWPFDocument document, ProjectOrderInfo orderInfo) {
|
private void replaceTextInDocument(XWPFDocument document, ProjectOrderInfo orderInfo) {
|
||||||
// 替换段落中的文本
|
// 替换段落中的文本
|
||||||
for (XWPFParagraph paragraph : document.getParagraphs()) {
|
for (XWPFParagraph paragraph : document.getParagraphs()) {
|
||||||
|
|
|
||||||
|
|
@ -55,25 +55,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectTodoCompletedList" resultType="Todo">
|
<select id="selectTodoCompletedList" resultType="Todo">
|
||||||
select todo_id, business_key, process_key, process_name, task_name, approve_user_name,approve_time,approve_opinion,
|
select todo_id, business_key, process_key, process_name, task_name,
|
||||||
approve_status,apply_user_name, apply_time, extend_field1, extend_field2,task_id,process_instance_id,form_key,all_approve_user_name,approve_user from bu_todo_completed
|
approve_user_name,approve_time,approve_opinion,
|
||||||
|
approve_status,apply_user_name, apply_time, extend_field1,
|
||||||
|
extend_field2,task_id,process_instance_id,form_key,all_approve_user_name,approve_user from bu_todo_completed
|
||||||
<where>
|
<where>
|
||||||
<if test="todoId != null and todoId != ''"> and todo_id = #{todoId}</if>
|
<if test="todoId != null and todoId != ''">and todo_id = #{todoId}</if>
|
||||||
<if test="businessKey != null and businessKey != ''"> and business_key = #{businessKey}</if>
|
<if test="businessKey != null and businessKey != ''">and business_key = #{businessKey}</if>
|
||||||
<if test="processKey != null and processKey != ''"> and process_key = #{processKey}</if>
|
<if test="processKey != null and processKey != ''">and process_key = #{processKey}</if>
|
||||||
<if test="processName != null and processName != ''"> and process_name like concat('%', #{processName}, '%')</if>
|
<if test="processName != null and processName != ''">and process_name like concat('%', #{processName},
|
||||||
<if test="taskName != null and taskName != ''"> and task_name like concat('%', #{taskName}, '%')</if>
|
'%')
|
||||||
<if test="approveUserName != null and approveUserName != ''"> and approve_user_name = #{approveUserName}</if>
|
</if>
|
||||||
<if test="applyUserName != null and applyUserName != ''"> and apply_user_name like concat('%', #{applyUserName}, '%')</if>
|
<if test="taskName != null and taskName != ''">and task_name like concat('%', #{taskName}, '%')</if>
|
||||||
<if test="applyTime != null "> and date_format(apply_time,'%y%m%d') = date_format(#{applyTime},'%y%m%d')</if>
|
<if test="approveUserName != null and approveUserName != ''">and approve_user_name = #{approveUserName}
|
||||||
<if test="approveTime != null "> and date_format(approve_time,'%y%m%d') = date_format(#{approveTime},'%y%m%d')</if>
|
</if>
|
||||||
<if test="extendField1 != null and extendField1 != ''"> and extend_field1 like concat('%',#{extendField1},'%')</if>
|
<if test="applyUserName != null and applyUserName != ''">and apply_user_name like concat('%',
|
||||||
<if test="extendField2 != null and extendField2 != ''"> and extend_field2 like concat('%',#{extendField2},'%')</if>
|
#{applyUserName}, '%')
|
||||||
<if test="processInstanceId != null and processInstanceId != ''"> and process_instance_id = #{processInstanceId}</if>
|
</if>
|
||||||
<if test="approveStatus != null and approveStatus != ''"> and approve_status = #{approveStatus}</if>
|
<if test="applyTime != null ">and date_format(apply_time,'%y%m%d') = date_format(#{applyTime},'%y%m%d')</if>
|
||||||
|
<if test="approveTime != null ">and date_format(approve_time,'%y%m%d') =
|
||||||
|
date_format(#{approveTime},'%y%m%d')
|
||||||
|
</if>
|
||||||
|
<if test="extendField1 != null and extendField1 != ''">and extend_field1 like
|
||||||
|
concat('%',#{extendField1},'%')
|
||||||
|
</if>
|
||||||
|
<if test="extendField2 != null and extendField2 != ''">and extend_field2 like
|
||||||
|
concat('%',#{extendField2},'%')
|
||||||
|
</if>
|
||||||
|
<if test="processInstanceId != null and processInstanceId != ''">and process_instance_id =
|
||||||
|
#{processInstanceId}
|
||||||
|
</if>
|
||||||
|
<if test="approveStatus != null and approveStatus != ''">and approve_status = #{approveStatus}</if>
|
||||||
<if test="searchValue != null and searchValue != ''">
|
<if test="searchValue != null and searchValue != ''">
|
||||||
AND (todo_id like concat('%',#{searchValue},'%') or extend_field1 like concat('%',#{searchValue},'%'))
|
AND (todo_id like concat('%',#{searchValue},'%') or extend_field1 like concat('%',#{searchValue},'%'))
|
||||||
</if>
|
</if>
|
||||||
|
<if test="businessName != null and businessName != ''">
|
||||||
|
AND business_key in (
|
||||||
|
select order_code from project_order_info t1 inner join project_info t2 on t1.project_id = t2.id where t2.project_name like concat('%',#{businessName},'%')
|
||||||
|
|
||||||
|
)
|
||||||
|
</if>
|
||||||
|
<if test="(params.beginCreateTime != null and params.beginCreateTime != '') or (params.endCreateTime != null and params.endCreateTime!='')">
|
||||||
|
<choose>
|
||||||
|
<when test="(params.beginCreateTime != null and params.beginCreateTime != '') and (params.endCreateTime != null and params.endCreateTime!='')">
|
||||||
|
and approve_time between date_format(#{params.beginCreateTime}, '%Y-%m-%d 00:00:00') and
|
||||||
|
date_format(#{params.endCreateTime}, '%Y-%m-%d 23:59:59')
|
||||||
|
</when>
|
||||||
|
<when test="(params.beginCreateTime != null and params.beginCreateTime != '')">
|
||||||
|
and approve_time <![CDATA[ >= ]]> date_format(#{params.beginCreateTime}, '%Y-%m-%d 00:00:00')
|
||||||
|
</when>
|
||||||
|
<when test="(params.endCreateTime != null and params.endCreateTime!='')">
|
||||||
|
and approve_time <![CDATA[ <= ]]> date_format(#{params.endCreateTime}, '%Y-%m-%d 23:59:59')
|
||||||
|
</when>
|
||||||
|
|
||||||
|
</choose>
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by approve_time desc
|
order by approve_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
|
|
@ -269,6 +269,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
and t1.order_code in (select select DISTINCT order_code from oms_inventory_outer where outer_code in (select outer_code from oms_inventory_info where product_sn=#{productSn} ) )
|
and t1.order_code in (select select DISTINCT order_code from oms_inventory_outer where outer_code in (select outer_code from oms_inventory_info where product_sn=#{productSn} ) )
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
<select id="listByCodeList" resultType="com.ruoyi.sip.domain.ProjectOrderInfo">
|
||||||
|
<include refid="selectProjectOrderInfoRelationVo"/>
|
||||||
|
where t1.order_code in (
|
||||||
|
<foreach item="item" collection="list" separator=",">
|
||||||
|
#{item}
|
||||||
|
</foreach>
|
||||||
|
)
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<insert id="insertProjectOrderInfo" parameterType="ProjectOrderInfo" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertProjectOrderInfo" parameterType="ProjectOrderInfo" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue