refactor(repository): 优化设备查询和解决方案审核相关功能

- 修改设备查询条件,使用 LIKE 模糊匹配
- 重命名 SolutionMeasuresVO 中的 audited 字段为 approved,优化审核状态表示
- 更新 TicketSolutionServiceImpl 中的审核状态判断逻辑
This commit is contained in:
曹鹏飞 2025-04-03 10:01:08 +08:00
parent e110af14fb
commit 30cf997c7b
3 changed files with 9 additions and 8 deletions

View File

@ -18,6 +18,6 @@ public class SolutionMeasuresVO {
//是否是审核人 //是否是审核人
private boolean inAudit=false; private boolean inAudit=false;
// 是否审核 // 是否审核通过默认为null表示未审核false不通过true通过
private boolean audited=false; private Boolean approved;
} }

View File

@ -61,9 +61,9 @@ public class TicketSolutionServiceImpl extends ServiceImpl<TicketSolutionMapper,
Map<String, List<TicketSolution>> groupedSolutions = solutions.stream().collect(Collectors.groupingBy(TicketSolution::getDictionaryItemName, LinkedHashMap::new, Collectors.toList())); Map<String, List<TicketSolution>> groupedSolutions = solutions.stream().collect(Collectors.groupingBy(TicketSolution::getDictionaryItemName, LinkedHashMap::new, Collectors.toList()));
SolutionMeasuresVO vo=new SolutionMeasuresVO(); SolutionMeasuresVO vo=new SolutionMeasuresVO();
TicketSolutionAudit audit =ticketSolutionAuditService.getByTicketAndUser(ticketId,AdminUserUtil.getUserId()); TicketSolutionAudit audit =ticketSolutionAuditService.getByTicketAndUser(ticketId,AdminUserUtil.getUserId());
if (Objects.nonNull(audit)){ if (Objects.nonNull(audit)) {
vo.setInAudit(true); vo.setInAudit(true);
vo.setAudited(Objects.nonNull(audit.getState())); vo.setApproved(Objects.isNull(audit.getState()) ? null : Objects.equals(audit.getState(), 1));
} }
List<SolutionMeasuresItemVO> items = new ArrayList<>(); List<SolutionMeasuresItemVO> items = new ArrayList<>();
if (CollectionUtil.isEmpty(groupedSolutions)) { if (CollectionUtil.isEmpty(groupedSolutions)) {

View File

@ -22,22 +22,23 @@
</select> </select>
<sql id="whr"> <sql id="whr">
<if test="query.deviceNo!=null and query.deviceNo!=''"> <if test="query.deviceNo!=null and query.deviceNo!=''">
and a.device_no=#{query.deviceNo} and a.device_no LIKE concat('%', #{query.deviceNo}, '%')
</if> </if>
<if test="query.customerName!=null and query.customerName!=''"> <if test="query.customerName!=null and query.customerName!=''">
and a.customer_name=#{query.customerName} and a.customer_name LIKE concat('%', #{query.customerName}, '%')
</if> </if>
<if test="query.agentName!=null and query.agentName!=''"> <if test="query.agentName!=null and query.agentName!=''">
and a.agent_name=#{query.agentName} and a.agent_name=#{query.agentName}
</if> </if>
<if test="query.modelNo!=null and query.modelNo!=''"> <if test="query.modelNo!=null and query.modelNo!=''">
and a.model_no=#{query.modelNo} and a.model_no LIKE concat('%', #{query.modelNo}, '%')
</if> </if>
<if test="query.warrantyState!=null and query.warrantyState!=''"> <if test="query.warrantyState!=null and query.warrantyState!=''">
and a.warranty_state=#{query.warrantyState} and a.warranty_state=#{query.warrantyState}
</if> </if>
<if test="query.warrantyStartDate!=null and query.warrantyStartDate!=''"> <if test="query.warrantyStartDate!=null and query.warrantyStartDate!=''">
and a.start_warranty_date &gt;= #{query.warrantyStartDate} and start_warranty_date &lt;= #{query.warrantyEndDate} and a.start_warranty_date &gt;= #{query.warrantyStartDate} and start_warranty_date &lt;=
#{query.warrantyEndDate}
</if> </if>
</sql> </sql>