fix: BUG-706

This commit is contained in:
曹鹏飞 2025-03-09 17:27:42 +08:00
parent e2df5c07d0
commit 43f87574d4
9 changed files with 70 additions and 22 deletions

View File

@ -205,6 +205,15 @@ public class TicketController extends ControllerBase {
return ApiResult.success(partService.getSimpleList(name));
}
/**
* 获取所有设备代理商
* @return 代理商列表
*/
@GetMapping("getDeviceAgents")
public ApiResult<List<DeviceAgentVO>> getDeviceAgents(){
return ApiResult.success(deviceService.getAgents());
}
/**
* 搜索工单
* @param request 请求参数

View File

@ -14,9 +14,6 @@ public class AdminTicketSearchRequest extends TicketSearchRequest {
//工单处理人
private String handleUserName;
//代理商id
private Integer companyId;
//问题类型
private String question;
@ -35,4 +32,7 @@ public class AdminTicketSearchRequest extends TicketSearchRequest {
//区域编码
private String areaCode;
//代理商编码
private String agentCode;
}

View File

@ -63,17 +63,25 @@ public class AdminTicketVO {
@ExcelColumn("区域")
private String areaName;
//代理商名称
@ExcelColumn("代理商")
private String primaryUserName;
// //代理商名称
// @ExcelColumn("代理商")
// private String primaryUserName;
@JsonIgnore
@IgnoreExport
private String companyId;
// @JsonIgnore
// @IgnoreExport
// private String companyId;
// //客户
// @ExcelColumn("客户")
// private String companyName;
//代理商
@ExcelColumn("代理商")
private String agentName;
//客户
@ExcelColumn("客户")
private String companyName;
private String customerName;
//设备编号
@ExcelColumn("设备编号")

View File

@ -0,0 +1,13 @@
package com.nflg.mobilebroken.common.pojo.vo;
import lombok.Data;
@Data
public class DeviceAgentVO {
//代理编码
private String agentCode;
//代理名称
private String agentName;
}

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nflg.mobilebroken.common.pojo.query.PageBaseQuery;
import com.nflg.mobilebroken.common.pojo.request.SearchDeviceRequest;
import com.nflg.mobilebroken.common.pojo.vo.ComponentInfo;
import com.nflg.mobilebroken.common.pojo.vo.DeviceAgentVO;
import com.nflg.mobilebroken.common.pojo.vo.DeviceInfoVO;
import com.nflg.mobilebroken.common.pojo.vo.DeviceVO;
import com.nflg.mobilebroken.repository.entity.Device;
@ -43,4 +44,6 @@ public interface DeviceMapper extends BaseMapper<Device> {
void taskWarrantyStateNotOutsideWithinWarranty();
List<ComponentInfo> getComponents(Integer componentId,String language);
List<DeviceAgentVO> getAgents();
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.nflg.mobilebroken.common.pojo.query.PageBaseQuery;
import com.nflg.mobilebroken.common.pojo.request.SearchDeviceRequest;
import com.nflg.mobilebroken.common.pojo.vo.DeviceAgentVO;
import com.nflg.mobilebroken.common.pojo.vo.DeviceInfoVO;
import com.nflg.mobilebroken.common.pojo.vo.DeviceVO;
import com.nflg.mobilebroken.repository.entity.Device;
@ -35,4 +36,6 @@ public interface IDeviceService extends IService<Device> {
void taskWarrantyStateNotOutsideWarranty();
void taskWarrantyStateNotOutsideWithinWarranty();
List<DeviceAgentVO> getAgents();
}

View File

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nflg.mobilebroken.common.pojo.query.PageBaseQuery;
import com.nflg.mobilebroken.common.pojo.request.SearchDeviceRequest;
import com.nflg.mobilebroken.common.pojo.vo.DeviceAgentVO;
import com.nflg.mobilebroken.common.pojo.vo.DeviceInfoVO;
import com.nflg.mobilebroken.common.pojo.vo.DeviceVO;
import com.nflg.mobilebroken.common.util.AppUserUtil;
@ -69,4 +70,9 @@ public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> impleme
public void taskWarrantyStateNotOutsideWithinWarranty(){
baseMapper.taskWarrantyStateNotOutsideWithinWarranty();
}
@Override
public List<DeviceAgentVO> getAgents() {
return baseMapper.getAgents();
}
}

View File

@ -97,4 +97,10 @@
LEFT JOIN t_base_language_data ld ON dcd.model_part_id = ld.source_id
WHERE p.enable=1 AND dcd.device_component_id=#{componentId} AND ld.language_code=#{language}
</select>
<select id="getAgents" resultType="com.nflg.mobilebroken.common.pojo.vo.DeviceAgentVO">
SELECT DISTINCT agent_code,agent_name
FROM device
WHERE LENGTH(agent_code)>0
</select>
</mapper>

View File

@ -47,8 +47,8 @@
<if test="request.handleUserName!=null and request.handleUserName!=''">
AND t.handle_name LIKE CONCAT('%', #{request.handleUserName}, '%')
</if>
<if test="request.companyId!=null">
AND u.company_id=#{request.companyId}
<if test="request.agentCode!=null and request.agentCode!=''">
AND d.agent_code=#{request.agentCode}
</if>
<if test="request.areaCode!=null and request.areaCode!=''">
AND FIND_IN_SET(#{request.areaCode},c.area_code)>0
@ -118,10 +118,10 @@
<select id="searchFromAdmin" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
SELECT t.id,t.`no`,t.title,t.state,t.urgency,t.component,t.question,t.solution
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),'') AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
,d.customer_name AS 'companyName',u.company_id AS 'companyId',u.`name` AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
,d.customer_name AS 'customerName',d.agent_name AS 'agentName',u.`name` AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',d.device_type AS 'deviceType'
,d.model_no AS 'equipmentModel',d.shipment_date AS 'shipmentDate',IF(tf.id IS NULL, false, true) AS 'followed',auc.user_name AS 'cqm'
,t.solve_time AS 'closeTime',u.name AS 'primaryUserName',auh.user_name AS 'currentHandle',dt.cqm_person_name AS 'cqms'
,t.solve_time AS 'closeTime',auh.user_name AS 'currentHandle',dt.cqm_person_name AS 'cqms'
,t.handle_name AS 'handle'
FROM ticket t
LEFT JOIN app_user u ON t.user_id=u.id
@ -149,10 +149,10 @@
<select id="searchAllFromAdmin" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
SELECT t.id,t.`no`,t.title,t.state,t.urgency,t.component,t.question,t.solution
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),'') AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
,d.customer_name AS 'companyName',u.company_id AS 'companyId',u.`name` AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
,d.customer_name AS 'customerName',d.agent_name AS 'agentName',u.`name` AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',d.device_type AS 'deviceType'
,d.model_no AS 'equipmentModel',d.shipment_date AS 'shipmentDate',IF(tf.id IS NULL, false, true) AS 'followed',auc.user_name AS 'cqm'
,t.solve_time AS 'closeTime',u.name AS 'primaryUserName',auh.user_name AS 'currentHandle',dt.cqm_person_name AS 'cqms'
,t.solve_time AS 'closeTime',auh.user_name AS 'currentHandle',dt.cqm_person_name AS 'cqms'
,t.handle_name AS 'handle'
FROM ticket t
LEFT JOIN app_user u ON t.user_id=u.id
@ -171,10 +171,10 @@
<select id="searchFromAdminAndFollow" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
SELECT t.id,t.`no`,t.title,t.state,t.urgency,t.component,t.question,t.solution
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),'') AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
,d.customer_name AS 'companyName',u.company_id AS 'companyId',u.`name` AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
,d.customer_name AS 'customerName',d.agent_name AS 'agentName',u.`name` AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',d.device_type AS 'deviceType'
,d.model_no AS 'equipmentModel',d.shipment_date AS 'shipmentDate',true AS 'followed',auc.user_name AS 'cqm'
,t.solve_time AS 'closeTime',u.name AS 'primaryUserName',auh.user_name AS 'currentHandle',dt.cqm_person_name AS 'cqms'
,t.solve_time AS 'closeTime',auh.user_name AS 'currentHandle',dt.cqm_person_name AS 'cqms'
,t.handle_name AS 'handle'
FROM ticket t
LEFT JOIN app_user u ON t.user_id=u.id
@ -193,9 +193,9 @@
<select id="searchAllFromAdminAndFollow" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
SELECT t.id,t.`no`,t.title,t.state,t.urgency,t.component,t.question,t.solution
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),'') AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
,d.customer_name AS 'companyName',u.company_id AS 'companyId',u.`name` AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
,d.customer_name AS 'customerName',d.agent_name AS 'agentName',u.`name` AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',true AS 'followed'
,auc.user_name AS 'cqm',t.solve_time AS 'closeTime',u.name AS 'primaryUserName',auh.user_name AS 'currentHandle'
,auc.user_name AS 'cqm',t.solve_time AS 'closeTime',auh.user_name AS 'currentHandle'
,dt.cqm_person_name AS 'cqms',t.handle_name AS 'handle'
FROM ticket t
LEFT JOIN app_user u ON t.user_id=u.id
@ -224,10 +224,10 @@
<select id="searchByFavouritesId" resultType="com.nflg.mobilebroken.common.pojo.vo.AdminTicketVO">
SELECT t.id,t.`no`,t.title,t.state,t.urgency,t.component,t.question,t.solution
,IF(u.is_primary,fun_getPrimaryUserArea(u.company_id),'') AS 'areaName',IF(u.is_primary,'',a2.`name`) AS 'agentAreaName'
,d.customer_name AS 'companyName',u.company_id AS 'companyId',u.`name` AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
,d.customer_name AS 'customerName',d.agent_name AS 'agentName',u.`name` AS 'createBy',t.device_no AS 'deviceNo',t.use_time AS 'useTime'
,t.create_time AS 'createTime',t.update_time AS 'completeTime',di.name AS 'warrantyStatusDesc',d.device_type AS 'deviceType'
,d.model_no AS 'equipmentModel',d.shipment_date AS 'shipmentDate',true AS 'followed',auc.user_name AS 'cqm'
,t.solve_time AS 'closeTime',u.name AS 'primaryUserName',auh.user_name AS 'currentHandle',dt.cqm_person_name AS 'cqms'
,t.solve_time AS 'closeTime',auh.user_name AS 'currentHandle',dt.cqm_person_name AS 'cqms'
,t.handle_name AS 'handle'
FROM ticket t
LEFT JOIN app_user u ON t.user_id=u.id