diff --git a/skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveWinBgPicDao.java b/skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveWinBgPicDao.java new file mode 100644 index 0000000000000000000000000000000000000000..5d2cea1d1daf11c112fe9e7bed1d2c57369391fe --- /dev/null +++ b/skyeye-dao/src/main/java/com/skyeye/authority/dao/SysEveWinBgPicDao.java @@ -0,0 +1,17 @@ +package com.skyeye.authority.dao; + +import java.util.List; +import java.util.Map; +import com.github.miemiedev.mybatis.paginator.domain.PageBounds; + +public interface SysEveWinBgPicDao { + + public List> querySysEveWinBgPicList(Map map, PageBounds pageBounds) throws Exception; + + public int insertSysEveWinBgPicMation(Map map) throws Exception; + + public int deleteSysEveWinBgPicMationById(Map map) throws Exception; + + public Map querySysEveMationById(Map map) throws Exception; + +} diff --git a/skyeye-service/src/main/java/com/skyeye/authority/service/SysEveWinBgPicService.java b/skyeye-service/src/main/java/com/skyeye/authority/service/SysEveWinBgPicService.java new file mode 100644 index 0000000000000000000000000000000000000000..dd185c8210a371eb284256db584f161d1c182397 --- /dev/null +++ b/skyeye-service/src/main/java/com/skyeye/authority/service/SysEveWinBgPicService.java @@ -0,0 +1,14 @@ +package com.skyeye.authority.service; + +import com.skyeye.common.object.InputObject; +import com.skyeye.common.object.OutputObject; + +public interface SysEveWinBgPicService { + + public void querySysEveWinBgPicList(InputObject inputObject, OutputObject outputObject) throws Exception; + + public void insertSysEveWinBgPicMation(InputObject inputObject, OutputObject outputObject) throws Exception; + + public void deleteSysEveWinBgPicMationById(InputObject inputObject, OutputObject outputObject) throws Exception; + +} diff --git a/skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysEveWinBgPicServiceImpl.java b/skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysEveWinBgPicServiceImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..78dcadeef9e3c6c4b2bdb7089c3a43fae249704e --- /dev/null +++ b/skyeye-service/src/main/java/com/skyeye/authority/service/impl/SysEveWinBgPicServiceImpl.java @@ -0,0 +1,83 @@ +package com.skyeye.authority.service.impl; + +import java.util.List; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.github.miemiedev.mybatis.paginator.domain.PageBounds; +import com.github.miemiedev.mybatis.paginator.domain.PageList; +import com.skyeye.authority.dao.SysEveWinBgPicDao; +import com.skyeye.authority.service.SysEveWinBgPicService; +import com.skyeye.common.object.InputObject; +import com.skyeye.common.object.OutputObject; +import com.skyeye.common.util.ToolUtil; + +@Service +public class SysEveWinBgPicServiceImpl implements SysEveWinBgPicService{ + + @Autowired + private SysEveWinBgPicDao sysEveWinBgPicDao; + + /** + * + * @Title: querySysEveWinBgPicList + * @Description: 获取win系统桌面图片列表 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @Override + public void querySysEveWinBgPicList(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + List> beans = sysEveWinBgPicDao.querySysEveWinBgPicList(map, + new PageBounds(Integer.parseInt(map.get("page").toString()), Integer.parseInt(map.get("limit").toString()))); + PageList> beansPageList = (PageList>)beans; + int total = beansPageList.getPaginator().getTotalCount(); + outputObject.setBeans(beans); + outputObject.settotal(total); + } + + /** + * + * @Title: insertSysEveWinBgPicMation + * @Description: 添加win系统桌面图片信息 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @Override + public void insertSysEveWinBgPicMation(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + Map user = inputObject.getLogParams(); + map.put("id", ToolUtil.getSurFaceId()); + map.put("createId", user.get("id")); + map.put("createTime", ToolUtil.getTimeAndToString()); + sysEveWinBgPicDao.insertSysEveWinBgPicMation(map); + } + + /** + * + * @Title: deleteSysEveWinBgPicMationById + * @Description: 删除win系统桌面图片信息 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @SuppressWarnings("static-access") + @Override + public void deleteSysEveWinBgPicMationById(InputObject inputObject, OutputObject outputObject) throws Exception { + Map map = inputObject.getParams(); + Map bean = sysEveWinBgPicDao.querySysEveMationById(map); + String tPath = inputObject.getRequest().getSession().getServletContext().getRealPath("/"); + String basePath = tPath + bean.get("picUrl").toString(); + ToolUtil.deleteFile(basePath); + sysEveWinBgPicDao.deleteSysEveWinBgPicMationById(map); + } + +} diff --git a/skyeye-service/src/main/java/com/skyeye/common/service/impl/CommonServiceImpl.java b/skyeye-service/src/main/java/com/skyeye/common/service/impl/CommonServiceImpl.java index 8b083ce96d59d419e4bfe047b5fe040816d652f7..3bd6e7984ff6d6a0872750d3a60ed52b378b3ebe 100644 --- a/skyeye-service/src/main/java/com/skyeye/common/service/impl/CommonServiceImpl.java +++ b/skyeye-service/src/main/java/com/skyeye/common/service/impl/CommonServiceImpl.java @@ -62,6 +62,12 @@ public class CommonServiceImpl implements CommonService{ case 1://小程序上传 basePath = tPath + "\\assets\\smpropic" ; break; + case 2://系统桌面背景自定义图片上传 + basePath = tPath + "\\assets\\winbgpic" ; + break; + case 3://系统桌面锁屏背景自定义图片上传 + basePath = tPath + "\\assets\\winlockbgpic" ; + break; default: basePath = tPath.substring(0, inputObject.getRequest().getSession().getServletContext().getRealPath("/").indexOf(Constants.PROJECT_WEB)); break; @@ -84,6 +90,18 @@ public class CommonServiceImpl implements CommonService{ String path = basePath + "\\" + newFileName; // 上传 file.transferTo(new File(path)); + switch (type) { + case 1://小程序上传 + break; + case 2://系统桌面背景自定义图片上传 + newFileName = "/assets/winbgpic/" + newFileName ; + break; + case 3://系统桌面锁屏背景自定义图片上传 + newFileName = "/assets/winlockbgpic/" + newFileName ; + break; + default: + break; + } if(ToolUtil.isBlank(trueFileName)){ trueFileName = newFileName; }else{ diff --git a/skyeye-web/src/main/java/com/skyeye/authority/controller/SysEveWinBgPicController.java b/skyeye-web/src/main/java/com/skyeye/authority/controller/SysEveWinBgPicController.java new file mode 100644 index 0000000000000000000000000000000000000000..cb345399c6e9fc50b7a82fa02c060236357e60bd --- /dev/null +++ b/skyeye-web/src/main/java/com/skyeye/authority/controller/SysEveWinBgPicController.java @@ -0,0 +1,65 @@ +package com.skyeye.authority.controller; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; +import com.skyeye.authority.service.SysEveWinBgPicService; +import com.skyeye.common.object.InputObject; +import com.skyeye.common.object.OutputObject; + +@Controller +public class SysEveWinBgPicController { + + @Autowired + private SysEveWinBgPicService sysEveWinBgPicService; + + /** + * + * @Title: querySysEveWinBgPicList + * @Description: 获取win系统桌面图片列表 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/SysEveWinBgPicController/querySysEveWinBgPicList") + @ResponseBody + public void querySysEveWinBgPicList(InputObject inputObject, OutputObject outputObject) throws Exception{ + sysEveWinBgPicService.querySysEveWinBgPicList(inputObject, outputObject); + } + + /** + * + * @Title: insertSysEveWinBgPicMation + * @Description: 添加win系统桌面图片信息 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/SysEveWinBgPicController/insertSysEveWinBgPicMation") + @ResponseBody + public void insertSysEveWinBgPicMation(InputObject inputObject, OutputObject outputObject) throws Exception{ + sysEveWinBgPicService.insertSysEveWinBgPicMation(inputObject, outputObject); + } + + /** + * + * @Title: deleteSysEveWinBgPicMationById + * @Description: 删除win系统桌面图片信息 + * @param @param inputObject + * @param @param outputObject + * @param @throws Exception 参数 + * @return void 返回类型 + * @throws + */ + @RequestMapping("/post/SysEveWinBgPicController/deleteSysEveWinBgPicMationById") + @ResponseBody + public void deleteSysEveWinBgPicMationById(InputObject inputObject, OutputObject outputObject) throws Exception{ + sysEveWinBgPicService.deleteSysEveWinBgPicMationById(inputObject, outputObject); + } + +} diff --git a/skyeye-web/src/main/resources/dbmapper/SysEveWinBgPicMapper.xml b/skyeye-web/src/main/resources/dbmapper/SysEveWinBgPicMapper.xml new file mode 100644 index 0000000000000000000000000000000000000000..aee3a8a11ba5c0785cb24f0123c7d78f87219b17 --- /dev/null +++ b/skyeye-web/src/main/resources/dbmapper/SysEveWinBgPicMapper.xml @@ -0,0 +1,40 @@ + + + + + + + + INSERT into sys_eve_win_bg_pic + (id, pic_url, pic_type, create_id, create_time) + VALUES + (#{id}, #{picUrl}, '1', #{createId}, #{createTime}) + + + + DELETE + FROM + sys_eve_win_bg_pic + WHERE + id = #{id} + + + + + \ No newline at end of file diff --git a/skyeye-web/src/main/resources/mapping/reqmapping.xml b/skyeye-web/src/main/resources/mapping/reqmapping.xml index 1aaad6a01ad84a33791d0d8260cdde45f6904c66..506a5802fe37b33fa7a16dd007061ace1107e222 100644 --- a/skyeye-web/src/main/resources/mapping/reqmapping.xml +++ b/skyeye-web/src/main/resources/mapping/reqmapping.xml @@ -164,6 +164,17 @@ + + + + + + + + + + + diff --git a/skyeye-web/src/main/webapp/assets/images/sexy_girl.jpg b/skyeye-web/src/main/webapp/assets/images/sexy_girl.jpg deleted file mode 100644 index 6029db45b2c1289715e09d0d156aa0c16836b947..0000000000000000000000000000000000000000 Binary files a/skyeye-web/src/main/webapp/assets/images/sexy_girl.jpg and /dev/null differ diff --git a/skyeye-web/src/main/webapp/assets/lib/winui/css/winui.css b/skyeye-web/src/main/webapp/assets/lib/winui/css/winui.css index e8c3d5db357736379cb65ecf2082f7f28a444e2b..b9f72c3bb3a5b765f12677d69ee05e9475687eac 100644 --- a/skyeye-web/src/main/webapp/assets/lib/winui/css/winui.css +++ b/skyeye-web/src/main/webapp/assets/lib/winui/css/winui.css @@ -2033,6 +2033,29 @@ body .layer-ext-winconfirm { /***系统icon样式end***/ +/***系统桌面背景图片样式start***/ + +.pic-item{ + padding-top: 10px; + height: 140px; +} + +.pic-item-div-top{ + text-align: center; +} + +.win-bg-pic{ + width: 70%; + height: 90px; +} + +.pic-item-div>div{ + text-align: center; + margin-top: 10px; +} + +/***系统桌面背景图片样式end***/ + /***common start***/ .noMation{ diff --git a/skyeye-web/src/main/webapp/assets/images/bg_01.jpg b/skyeye-web/src/main/webapp/assets/winbgpic/1542606484204.jpg similarity index 100% rename from skyeye-web/src/main/webapp/assets/images/bg_01.jpg rename to skyeye-web/src/main/webapp/assets/winbgpic/1542606484204.jpg diff --git a/skyeye-web/src/main/webapp/assets/images/bg_02.jpg b/skyeye-web/src/main/webapp/assets/winbgpic/1542606488509.jpg similarity index 100% rename from skyeye-web/src/main/webapp/assets/images/bg_02.jpg rename to skyeye-web/src/main/webapp/assets/winbgpic/1542606488509.jpg diff --git a/skyeye-web/src/main/webapp/assets/images/bg_03.jpg b/skyeye-web/src/main/webapp/assets/winbgpic/1542606492834.jpg similarity index 100% rename from skyeye-web/src/main/webapp/assets/images/bg_03.jpg rename to skyeye-web/src/main/webapp/assets/winbgpic/1542606492834.jpg diff --git a/skyeye-web/src/main/webapp/assets/images/bg_04.jpg b/skyeye-web/src/main/webapp/assets/winbgpic/1542606496486.jpg similarity index 100% rename from skyeye-web/src/main/webapp/assets/images/bg_04.jpg rename to skyeye-web/src/main/webapp/assets/winbgpic/1542606496486.jpg diff --git a/skyeye-web/src/main/webapp/assets/images/bg_05.jpg b/skyeye-web/src/main/webapp/assets/winbgpic/1542606500281.jpg similarity index 100% rename from skyeye-web/src/main/webapp/assets/images/bg_05.jpg rename to skyeye-web/src/main/webapp/assets/winbgpic/1542606500281.jpg diff --git a/skyeye-web/src/main/webapp/js/sysevewinbgpic/sysevewinbgpiclist.js b/skyeye-web/src/main/webapp/js/sysevewinbgpic/sysevewinbgpiclist.js new file mode 100644 index 0000000000000000000000000000000000000000..cf6b09d08540ea69d2366f51adb8d1c0456f7bab --- /dev/null +++ b/skyeye-web/src/main/webapp/js/sysevewinbgpic/sysevewinbgpiclist.js @@ -0,0 +1,92 @@ + +var rowId = ""; + +layui.config({ + base: basePath, + version: skyeyeVersion +}).define(['table', 'jquery', 'winui', 'upload'], function (exports) { + + winui.renderColor(); + + var $ = layui.$, + form = layui.form, + upload = layui.upload; + + //初始化数据 + showGrid({ + id: "showForm", + url: reqBasePath + "sysevewinbgpic001", + params: {}, + pagination: true, + pagesize: 18, + template: getFileContent('tpl/sysevewinbgpic/bgpic-item.tpl'), + ajaxSendLoadBefore: function(hdb){ + hdb.registerHelper("compare1", function(v1, options){ + return fileBasePath + v1; + }); + }, + options: {'click .del':function(index, row){ + layer.confirm('确认删除选中数据吗?', { icon: 3, title: '删除win系统桌面图片' }, function (index) { + layer.close(index); + AjaxPostUtil.request({url:reqBasePath + "sysevewinbgpic003", params:{rowId: row.id}, type:'json', callback:function(json){ + if(json.returnCode == 0){ + top.winui.window.msg("删除成功", {icon: 1,time: 2000}); + loadTable(); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); + }); + }, 'click .sel':function(index, row){ + layer.open({ + type:1, + title:false, + closeBtn:0, + skin: 'demo-class', + shadeClose:true, + content:'', + scrollbar:false + }); + } + }, + ajaxSendAfter:function(json){ + } + }); + + //刷新数据 + $("body").on("click", "#reloadTable", function(){ + loadTable(); + }); + + + var uploadInst = upload.render({ + elem: '#addBean', // 绑定元素 + url: reqBasePath + 'common003', // 上传接口 + data: {type: 2}, + done: function(json) { + // 上传完毕回调 + if(json.returnCode == 0){ + AjaxPostUtil.request({url:reqBasePath + "sysevewinbgpic002", params:{picUrl: json.bean.picUrl}, type:'json', callback:function(json){ + if(json.returnCode == 0){ + top.winui.window.msg("上传成功", {icon: 1,time: 2000}); + loadTable(); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }}); + }else{ + top.winui.window.msg(json.returnMessage, {icon: 2,time: 2000}); + } + }, + error: function(e) { + // 请求异常回调 + console.log(e); + } + }); + + function loadTable(){ + refreshGrid("showForm", {params:{}}); + } + + exports('sysevewinbgpiclist', {}); +}); diff --git a/skyeye-web/src/main/webapp/tpl/sysevewinbgpic/bgpic-item.tpl b/skyeye-web/src/main/webapp/tpl/sysevewinbgpic/bgpic-item.tpl new file mode 100644 index 0000000000000000000000000000000000000000..085a5753f2be539d47c59cf5eee7d09b3e61b477 --- /dev/null +++ b/skyeye-web/src/main/webapp/tpl/sysevewinbgpic/bgpic-item.tpl @@ -0,0 +1,13 @@ + +{{#each rows}} +
+
+ +
+
+
+ 删除 +
+
+
+{{/each}} \ No newline at end of file diff --git a/skyeye-web/src/main/webapp/tpl/sysevewinbgpic/sysevewinbgpiclist.html b/skyeye-web/src/main/webapp/tpl/sysevewinbgpic/sysevewinbgpiclist.html new file mode 100644 index 0000000000000000000000000000000000000000..efca68c0808b6009bfac99d5d2536aa51906dbe4 --- /dev/null +++ b/skyeye-web/src/main/webapp/tpl/sysevewinbgpic/sysevewinbgpiclist.html @@ -0,0 +1,28 @@ + + + + + + + + + + +
+
+ + +
+
+
+
+ +
+
+ + + + + \ No newline at end of file