package cn.appsys.android.developer;
import cn.appsys.pojo.*;
import cn.appsys.service.developer.AppCategoryService;
import cn.appsys.service.developer.AppInfoService;
import cn.appsys.service.developer.AppVersionService;
import cn.appsys.service.developer.DataDictionaryService;
import cn.appsys.tool.Constants;
import cn.appsys.tool.EmptyUtils;
import cn.appsys.tool.PageSupport;
import org.apache.commons.io.FilenameUtils;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 开发者APP信息控制器
*
*
*/
@Controller
@RequestMapping("/android/dev/appInfo")
public class AndroidDevAppInfoController {
private static Logger logger = Logger.getLogger(AndroidDevAppInfoController.class);
@Resource
private AppInfoService appInfoService;
@Resource
private DataDictionaryService dataDictionaryService;
@Resource
private AppCategoryService appCategoryService;
@Resource
private AppVersionService appVersionService;
/**
* 获取APP信息列表
*
* @param querySoftwareName
* @param _queryStatus
* @param _queryCategoryLevel1
* @param _queryCategoryLevel2
* @param _queryCategoryLevel3
* @param _queryFlatformId
* @param pageIndex
* @return
*/
@RequestMapping(value = "/appList")
@ResponseBody
public List<AppInfo> getAppInfos(
@RequestParam(value = "devId", required = true) Integer devId,
@RequestParam(value = "querySoftwareName", required = false) String querySoftwareName,
@RequestParam(value = "queryStatus", required = false) String _queryStatus,
@RequestParam(value = "queryCategoryLevel1", required = false) String _queryCategoryLevel1,
@RequestParam(value = "queryCategoryLevel2", required = false) String _queryCategoryLevel2,
@RequestParam(value = "queryCategoryLevel3", required = false) String _queryCategoryLevel3,
@RequestParam(value = "queryFlatformId", required = false) String _queryFlatformId,
@RequestParam(value = "pageIndex", required = false) String pageIndex) {
// 定义各种变量
List<AppInfo> appInfos = null;// APP信息集合
// 转换数据类型
Integer queryStatus = null;
if (EmptyUtils.isNotEmpty(_queryStatus)) {
queryStatus = Integer.parseInt(_queryStatus);
}
Integer queryCategoryLevel1 = null;
if (EmptyUtils.isNotEmpty(_queryCategoryLevel1)) {
queryCategoryLevel1 = Integer.parseInt(_queryCategoryLevel1);
}
Integer queryCategoryLevel2 = null;
if (EmptyUtils.isNotEmpty(_queryCategoryLevel2)) {
queryCategoryLevel2 = Integer.parseInt(_queryCategoryLevel2);
}
Integer queryCategoryLevel3 = null;
if (EmptyUtils.isNotEmpty(_queryCategoryLevel3)) {
queryCategoryLevel3 = Integer.parseInt(_queryCategoryLevel3);
}
Integer queryFlatformId = null;
if (EmptyUtils.isNotEmpty(_queryFlatformId)) {
queryFlatformId = Integer.parseInt(_queryFlatformId);
}
// 分页数据处理
int pageSize = Constants.PAGESIZE;
Integer currentPageNo = 1;
if (pageIndex != null) {
currentPageNo = Integer.parseInt(pageIndex);
}
int totalCount = 0;
try {
totalCount = appInfoService.getAppInfoCount(querySoftwareName, queryStatus, queryCategoryLevel1,
queryCategoryLevel2, queryCategoryLevel3, queryFlatformId, devId);
} catch (Exception e) {
e.printStackTrace();
}
PageSupport pages = new PageSupport(currentPageNo, totalCount, pageSize);
int from = pages.getFrom();// 数据开始的行数(limit)
// 获取各种数据
try {
appInfos = appInfoService.getAppInfos(querySoftwareName, queryStatus, queryCategoryLevel1,
queryCategoryLevel2, queryCategoryLevel3, queryFlatformId, devId, from, pageSize);
} catch (Exception e) {
e.printStackTrace();
}
return appInfos;
}
/**
* 查看APP信息
*/
@RequestMapping(value = "/appInfoView")
@ResponseBody
public Object appInfoView(@RequestParam(value = "id") String id) {
AppInfo appInfo = null;
try {
appInfo = appInfoService.getAppInfo(Integer.parseInt(id), null);
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException("加载信息失败!!");
}
return appInfo;
}
/**
* 获取APP分类信息
*
* @param parentId
* @return
*/
@RequestMapping(value = "/category.json")
@ResponseBody
public List<AppCategory> getAppCategories(@RequestParam(value = "parentId") String parentId) {
List<AppCategory> appCategories = null;
if (EmptyUtils.isEmpty(parentId)) {
appCategories = appCategoryService.getAppCategories(null);
} else {
appCategories = appCategoryService.getAppCategories(Integer.parseInt(parentId));
}
return appCategories;
}
/**
* 添加APP信息
*/
@RequestMapping(value = "/doAdd")
@ResponseBody
public Object addAppInfo(AppInfo appInfo,HttpServletRequest request,
@RequestParam(value = "softwareName") String softwareName,
@RequestParam(value = "apkName") String apkName,
@RequestParam(value = "supportROM") String supportROM,
@RequestParam(value = "interfaceLanguage") String interfaceLanguage,
@RequestParam(value = "softwareSize") String softwareSize,
@RequestParam(value = "downloads") Integer downloads,
@RequestParam(value = "appInfomation") String appInfomation,
@RequestParam(value = "flatFormId") Integer flatFormId,
@RequestParam(value = "categoryOneId") Integer categoryOneId,
@RequestParam(value = "categoryTwoId") Integer categoryTwoId,
@RequestParam(value = "categoryThreeId") Integer categoryThreeId,
@RequestParam(value = "devId") Integer devId,
@RequestParam(value = "_logoPicPath", required = false) MultipartFile updateFile) {
Map<String, String> result = new HashMap<>();
String logoPicPath = null;// 相对路径
String logoLocPath = null;// 决定路径
if (updateFile!=null&&!updateFile.isEmpty()) {// 如果上传文件不为空
String path = request.getSession().getServletContext().getRealPath("/") + "statics"+File.separator+"uploadFiles";// 项目实际路径
String suffix = FilenameUtils.getExtension(updateFile.getOriginalFilename());// 上传文件后缀名称
int fileSize = 500000;// 文件大小
if (updateFile.getSize() > fileSize) {// 如果文件过大
result.put("message","图片过大,不能超过500KB");
return result;
} else if (suffix.equalsIgnoreCase("jpg") || suffix.equalsIgnoreCase("jpeg")
|| suffix.equalsIgnoreCase("pneg") || suffix.equalsIgnoreCase("png")) {// 判断格式是否正确
String fileName = appInfo.getApkName() + "." + suffix;// 新文件名称
File file = new File(path, fileName);
if (!file.exists()) {// 判断文件是否存在
file.mkdirs();
}
try {
updateFile.transferTo(file);// 上传文件
} catch (Exception e) {
e.printStackTrace();
result.put("message","图片上传失败");
return result;
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
北大青鸟app信息管理系统 (1073个子文件)
com.google.android.inputmethod.pinyin-V1.1.1.apk 16.81MB
air.net.machinarium.Machinarium.GP-V1.1.1.apk 11.74MB
com.bithack.apparatus-V1.1.2.apk 11.31MB
com.kleientertainment.doNotStarvePocket-V1.1.1.apk 3.56MB
com.speedsoftware.rootexplorer-V1.1.1.apk 3.05MB
com.doodleapps.powdertoy-V1.1.2.apk 1.01MB
com.doodleapps.powdertoy-V1.1.3.apk 1.01MB
com.doodleapps.powdertoy-V1.1.31.apk 1.01MB
com.bithack.apparatus-V1.1.1.apk 774KB
com.kleientertainment.doNotStarvePocket-V1.1.2.apk 529KB
ZeroClipboardPdf.as 9KB
ZeroClipboard.as 6KB
bootstrap.css 192KB
plugins.css 184KB
main.css 71KB
icons.css 66KB
landing.css 55KB
skin.min.css 32KB
skin.ie7.min.css 32KB
jquery-ui.css 31KB
jquery.ui.theme.css 16KB
_all.css 13KB
spectrum.css 12KB
TableTools.css 9KB
daterangepicker-bs3.css 5KB
visualblocks.css 5KB
jquery.ui.datepicker.css 4KB
TableTools_JUI.css 4KB
default.css 3KB
railscasts.css 2KB
jquery.ui.button.css 2KB
arta.css 2KB
monokai_sublime.css 2KB
obsidian.css 2KB
xcode.css 2KB
sunburst.css 2KB
googlecode.css 2KB
monokai.css 2KB
school_book.css 2KB
magula.css 2KB
far.css 2KB
zenburn.css 2KB
brown_paper.css 2KB
docco.css 2KB
atelier-lakeside.light.css 2KB
atelier-lakeside.dark.css 2KB
atelier-seaside.light.css 2KB
dark.css 2KB
atelier-seaside.dark.css 2KB
atelier-forest.light.css 2KB
atelier-forest.dark.css 2KB
atelier-heath.light.css 2KB
atelier-heath.dark.css 2KB
idea.css 2KB
atelier-dune.light.css 2KB
atelier-dune.dark.css 2KB
github.css 2KB
pojoaque.css 2KB
tomorrow-night-blue.css 2KB
solarized_dark.css 2KB
solarized_light.css 2KB
tomorrow-night.css 2KB
rainbow.css 2KB
foundation.css 2KB
vs.css 2KB
tomorrow-night-eighties.css 2KB
tomorrow-night-bright.css 1KB
content.min.css 1KB
paraiso.light.css 1KB
paraiso.dark.css 1KB
jquery.ui.core.css 1KB
ir_black.css 1KB
purple.css 1KB
orange.css 1KB
yellow.css 1KB
jquery.ui.menu.css 1KB
green.css 1KB
tomorrow.css 1KB
pink.css 1KB
grey.css 1KB
aero.css 1KB
blue.css 1KB
red.css 1KB
flat.css 1KB
jquery.ui.slider.css 1KB
jquery.ui.tabs.css 1KB
jquery.ui.dialog.css 1KB
jquery.ui.resizable.css 1KB
jquery.ui.spinner.css 1KB
content.inline.min.css 1KB
mono-blue.css 899B
jquery.ui.accordion.css 840B
ascetic.css 806B
jquery.ui.base.css 770B
jquery.ui.progressbar.css 618B
jquery.ui.tooltip.css 340B
jquery.ui.selectable.css 328B
jquery.ui.autocomplete.css 322B
jquery.ui.all.css 292B
custom.css 133B
共 1073 条
- 1
- 2
- 3
- 4
- 5
- 6
- 11
资源评论
大浪淘沙丶
- 粉丝: 9
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- Win64OpenSSL-3-3-0.exe
- 课高分程设计-基于C++实现的民航飞行与地图简易管理系统-南京航空航天大学
- 航天器遥测数据故障检测系统python源码+文档说明+数据库(课程设计)
- 北京航空航天大学操作系统课设+ppt+实验报告
- 基于Vue+Echarts实现风力发电机中传感器的数据展示监控可视化系统+源代码+文档说明(高分课程设计)
- 基于单片机的风力发电机转速控制源码
- 基于C++实现的风力发电气动平衡监测系统+源代码+测量数据(高分课程设计)
- 毕业设计- 基于STM32F103C8T6 单片机,物联网技术的太阳能发电装置+源代码+文档说明+架构图+界面截图
- 基于 LSTM(长短期记忆)(即改进的循环神经网络)预测风力发电厂中风力涡轮机产生的功率+源代码+文档说明
- 基于stm32f103+空心杯电机+oled按键+运动算法
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功