fix: 修复一些问题
This commit is contained in:
parent
8e0accc6ff
commit
c4d2342ab4
|
|
@ -8,6 +8,7 @@ import com.nflg.mobilebroken.common.exception.NflgException;
|
|||
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.FileUploadVO;
|
||||
import com.nflg.mobilebroken.common.util.AppUserUtil;
|
||||
import com.nflg.mobilebroken.common.util.SaTokenAppUtil;
|
||||
import com.nflg.mobilebroken.repository.entity.FileUploadRecord;
|
||||
import com.nflg.mobilebroken.repository.service.IFileUploadRecordService;
|
||||
import com.nflg.mobilebroken.starter.service.FileUploadService;
|
||||
|
|
@ -68,8 +69,13 @@ public class FileController extends ControllerBase {
|
|||
}
|
||||
|
||||
private String buildFilePath(String fileType) {
|
||||
return StrUtil.format("cfs/{}/{}/{}/{}{}", LocalDateTime.now().format(FORMATTER), AppUserUtil.getUserId()
|
||||
, RandomUtil.randomString(4), IdUtil.fastUUID(),fileType);
|
||||
if (SaTokenAppUtil.isLogin()){
|
||||
return StrUtil.format("cfs/{}/{}/{}/{}{}", LocalDateTime.now().format(FORMATTER)
|
||||
, AppUserUtil.getUserId(), RandomUtil.randomString(4), IdUtil.fastUUID(),fileType);
|
||||
}else {
|
||||
return StrUtil.format("cfs/{}/temp/{}/{}{}", LocalDateTime.now().format(FORMATTER)
|
||||
,RandomUtil.randomString(4), IdUtil.fastUUID(),fileType);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -129,6 +135,6 @@ public class FileController extends ControllerBase {
|
|||
.setSource(source)
|
||||
.setSourceId(sourceId)
|
||||
.setUrl(url)
|
||||
.setCreateBy(AppUserUtil.getUserName());
|
||||
.setCreateBy(SaTokenAppUtil.isLogin()?AppUserUtil.getUserName():"");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.nflg.mobilebroken.common.pojo.request;
|
|||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -22,11 +23,9 @@ public class AnonymousTicketAddRequest {
|
|||
@NotBlank(message = "设备编号不能为空")
|
||||
private String deviceNo;
|
||||
|
||||
/**
|
||||
* 问题部位
|
||||
*/
|
||||
@NotBlank(message = "问题部位不能为空")
|
||||
private String component;
|
||||
//问题部位
|
||||
@NotNull(message = "问题部位id不能为空")
|
||||
private Integer componentId;
|
||||
|
||||
/**
|
||||
* 使用时长,单位小时
|
||||
|
|
|
|||
|
|
@ -22,6 +22,11 @@ public class AnonymousTicketSearchVO {
|
|||
*/
|
||||
private String title;
|
||||
|
||||
/**
|
||||
* 问题描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 问题部位
|
||||
*/
|
||||
|
|
@ -77,6 +82,11 @@ public class AnonymousTicketSearchVO {
|
|||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 区域名称
|
||||
*/
|
||||
private String areaName;
|
||||
|
||||
/**
|
||||
* 手机号码
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ public class AnonymousTicket implements Serializable {
|
|||
private String deviceNo;
|
||||
|
||||
/**
|
||||
* 问题部位
|
||||
* 问题部件id,t_base_part表的id
|
||||
*/
|
||||
private String component;
|
||||
private Integer componentId;
|
||||
|
||||
/**
|
||||
* 使用时长,单位:小时
|
||||
|
|
|
|||
|
|
@ -11,17 +11,17 @@ import com.nflg.mobilebroken.common.pojo.vo.AnonymousTicketInfoVO;
|
|||
import com.nflg.mobilebroken.common.pojo.vo.AnonymousTicketSearchVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.DeviceInfoVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.FileUploadVO;
|
||||
import com.nflg.mobilebroken.common.util.MultilingualUtil;
|
||||
import com.nflg.mobilebroken.common.util.TicketUtil;
|
||||
import com.nflg.mobilebroken.common.util.VUtils;
|
||||
import com.nflg.mobilebroken.repository.entity.AnonymousTicket;
|
||||
import com.nflg.mobilebroken.repository.entity.DictionaryItem;
|
||||
import com.nflg.mobilebroken.repository.entity.FileUploadRecord;
|
||||
import com.nflg.mobilebroken.repository.entity.TBasePart;
|
||||
import com.nflg.mobilebroken.repository.mapper.AnonymousTicketMapper;
|
||||
import com.nflg.mobilebroken.repository.service.IAnonymousTicketService;
|
||||
import com.nflg.mobilebroken.repository.service.IDeviceService;
|
||||
import com.nflg.mobilebroken.repository.service.IDictionaryItemService;
|
||||
import com.nflg.mobilebroken.repository.service.IFileUploadRecordService;
|
||||
import com.nflg.mobilebroken.repository.service.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
|
|
@ -51,7 +51,11 @@ public class AnonymousTicketServiceImpl extends ServiceImpl<AnonymousTicketMappe
|
|||
@Resource
|
||||
private IDictionaryItemService dictionaryItemService;
|
||||
|
||||
@Resource
|
||||
private ITBasePartService partService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void add(AnonymousTicketAddRequest request) {
|
||||
AnonymousTicket lastTicket=lambdaQuery()
|
||||
.ge(AnonymousTicket::getCreateTime, LocalDateTime.now().toLocalDate())
|
||||
|
|
@ -63,7 +67,7 @@ public class AnonymousTicketServiceImpl extends ServiceImpl<AnonymousTicketMappe
|
|||
.setNo(no)
|
||||
.setDeviceNo(request.getDeviceNo())
|
||||
.setDeviceAddress(request.getDeviceAddress())
|
||||
.setComponent(request.getComponent())
|
||||
.setComponentId(request.getComponentId())
|
||||
.setUseTime(request.getUseTime())
|
||||
.setTitle(request.getTitle())
|
||||
.setDescription(request.getDescription())
|
||||
|
|
@ -111,6 +115,7 @@ public class AnonymousTicketServiceImpl extends ServiceImpl<AnonymousTicketMappe
|
|||
DictionaryItem warrantyState = dictionaryItemService.getById(device.getWarrantyState());
|
||||
warrantyStateDesc = warrantyState.getName();
|
||||
}
|
||||
TBasePart part = partService.getByIdAndLanguage(ticket.getComponentId(), MultilingualUtil.getLanguage());
|
||||
return new AnonymousTicketInfoVO()
|
||||
.setId(ticketId)
|
||||
.setNo(ticket.getNo())
|
||||
|
|
@ -128,7 +133,7 @@ public class AnonymousTicketServiceImpl extends ServiceImpl<AnonymousTicketMappe
|
|||
.setShipmentDate(device.getShipmentDate())
|
||||
.setStartWarrantyDate(device.getStartWarrantyDate())
|
||||
.setWarrantyMonth(device.getWarrantyMonth())
|
||||
.setComponent(ticket.getComponent())
|
||||
.setComponent(Objects.nonNull(part) ? part.getPartName() : "")
|
||||
.setUseTime(ticket.getUseTime())
|
||||
.setDeviceAddress(ticket.getDeviceAddress())
|
||||
.setImages(getFileVOs(ticket.getImages()))
|
||||
|
|
|
|||
|
|
@ -3,13 +3,16 @@
|
|||
<mapper namespace="com.nflg.mobilebroken.repository.mapper.AnonymousTicketMapper">
|
||||
|
||||
<select id="search" resultType="com.nflg.mobilebroken.common.pojo.vo.AnonymousTicketSearchVO">
|
||||
SELECT t.id,t.`no`,t.title,t.component,d.customer_name AS 'customerName',d.agent_name AS 'agentName'
|
||||
SELECT t.id,t.`no`,t.title,p.part_name AS 'component',d.customer_name AS 'customerName',d.agent_name AS 'agentName'
|
||||
,t.device_no AS 'deviceNo',t.use_time AS 'useTime',t.create_time AS 'createTime',di.name AS 'warrantyStatusDesc'
|
||||
,d.device_type AS 'deviceType',d.model_no AS 'equipmentModel',d.shipment_date AS 'shipmentDate',t.phone,t.email
|
||||
,t.description,c.area_name
|
||||
FROM anonymous_ticket t
|
||||
LEFT JOIN device d ON t.device_no=d.device_no
|
||||
LEFT JOIN t_base_device_type dt ON d.device_type=dt.device_type
|
||||
LEFT JOIN dictionary_item di ON d.warranty_state=di.id
|
||||
LEFT JOIN t_base_part p ON t.component_id=p.id
|
||||
LEFT JOIN t_base_customer c ON c.agency_company_code=d.agent_code
|
||||
<where>
|
||||
<if test="request.component!=null and request.component!=''">
|
||||
AND t.component=#{request.component}
|
||||
|
|
|
|||
|
|
@ -14,9 +14,10 @@
|
|||
, d.customer_name AS 'customerName'
|
||||
, dc.id AS 'componentId'
|
||||
, d.agent_name
|
||||
,d.area_name
|
||||
,c.area_name
|
||||
FROM device d
|
||||
LEFT JOIN device_component dc ON d.model_no = dc.model_no AND dc.`enable` = 1
|
||||
LEFT JOIN t_base_customer c ON c.agency_company_code=d.agent_code
|
||||
WHERE d.device_no = #{deviceNo}
|
||||
ORDER BY d.data_valid_state DESC,d.device_state
|
||||
LIMIT 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue