| | |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.utils.StoreOperationRecordsUtils; |
| | | import com.sandu.ximon.dao.domain.IpVolumeFile; |
| | | import com.sandu.ximon.dao.enums.OrderByEnums; |
| | | import com.sandu.ximon.dao.mapper.IpVolumeFileMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.util.List; |
| | |
| | | |
| | | public boolean addFile(IpVolumeFileParam fileParam) { |
| | | IpVolumeFile file = new IpVolumeFile(); |
| | | // if(SecurityUtils.getClientId()!=null){ |
| | | // file.setUserName(SecurityUtils.getUsername()); |
| | | // } |
| | | // |
| | | if (SecurityUtils.getClientId() != null) { |
| | | file.setUserName(SecurityUtils.getUsername()); |
| | | file.setUserId(SecurityUtils.getClientId()); |
| | | file.setClientId(clientService.getClientId()); |
| | | } |
| | | |
| | | file.setUserName(SecurityUtils.getUsername()); |
| | | file.setUserId(SecurityUtils.getClientId()); |
| | | file.setClientId(clientService.getClientId()); |
| | | |
| | | file.setFileName(fileParam.getFileName()); |
| | | file.setFileUrl(fileParam.getFileUrl()); |
| | |
| | | } |
| | | |
| | | //排序字段 |
| | | String orderByResult = "create_time"; |
| | | String orderByResult = "id"; |
| | | //正序、倒叙 |
| | | String orderBySeq = "ASC"; |
| | | String orderBySeq = OrderByEnums.ASC.getCode(); |
| | | if (order != null) { |
| | | switch (order) { |
| | | case 1: |
| | | orderByResult = "create_time"; |
| | | orderByResult = OrderByEnums.IP_VOLUME_FILE_CREATE_TIME.getCode(); |
| | | break; |
| | | default: |
| | | } |
| | |
| | | if (seq != null) { |
| | | switch (seq) { |
| | | case 1: |
| | | orderBySeq = " ASC"; |
| | | orderBySeq = OrderByEnums.ASC.getCode(); |
| | | break; |
| | | case 2: |
| | | orderBySeq = " DESC"; |
| | | orderBySeq = OrderByEnums.DESC.getCode(); |
| | | break; |
| | | default: |
| | | break; |