From 64bd2204be459b47e008b79073a143684140ff24 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期六, 04 七月 2020 18:20:45 +0800 Subject: [PATCH] mapper xml文件位置移动 --- fanli/src/main/java/com/yeshi/fanli/controller/admin/AppPageNotificationAdminController.java | 59 ++++++++++++++++++++++++----------------------------------- 1 files changed, 24 insertions(+), 35 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/admin/AppPageNotificationAdminController.java b/fanli/src/main/java/com/yeshi/fanli/controller/admin/AppPageNotificationAdminController.java index ebe3bb9..f790a11 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/admin/AppPageNotificationAdminController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/admin/AppPageNotificationAdminController.java @@ -9,6 +9,7 @@ import javax.annotation.Resource; +import com.yeshi.fanli.entity.accept.AdminAcceptData; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.yeshi.utils.JsonUtil; @@ -20,13 +21,11 @@ import com.yeshi.fanli.entity.bus.help.AppPageNotification; import com.yeshi.fanli.entity.bus.help.AppPageNotification.AppPageNotificationTypeEnum; import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl; -import com.yeshi.fanli.entity.bus.homemodule.FloatAD; import com.yeshi.fanli.entity.bus.homemodule.AdActivityVersionControl.AdActivityType; import com.yeshi.fanli.service.inter.config.AppVersionService; import com.yeshi.fanli.service.inter.help.AppPageNotificationService; import com.yeshi.fanli.service.inter.homemodule.AdActivityVersionControlService; import com.yeshi.fanli.tag.PageEntity; -import com.yeshi.fanli.util.Constant; import com.yeshi.fanli.util.StringUtil; import net.sf.json.JSONArray; @@ -53,7 +52,7 @@ * @param out */ // @RequestMapping(value = "saveAdd") - public void saveAdd(String callback, AppPageNotification appPageNotification, PrintWriter out) { + public void saveAdd(AdminAcceptData acceptData, String callback, AppPageNotification appPageNotification, PrintWriter out) { try { String content = appPageNotification.getContent(); if (StringUtil.isNullOrEmpty(content) ) { @@ -63,7 +62,7 @@ AppPageNotificationTypeEnum type = appPageNotification.getType(); if (type != null) { - AppPageNotification old = appPageNotificationService.getAppPageNotificationByType(type.name()); + AppPageNotification old = appPageNotificationService.getAppPageNotificationByType(type.name(),acceptData.getSystem()); if (old != null) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("宸插瓨鍦ㄦ绫诲瀷")); return; @@ -129,15 +128,14 @@ * @param out */ @RequestMapping(value = "saveModify") - public void saveModify(String callback, AppPageNotification appPageNotification, PrintWriter out) { + public void saveModify(AdminAcceptData acceptData,String callback, AppPageNotification appPageNotification, PrintWriter out) { try { - AppPageNotificationTypeEnum type = appPageNotification.getType(); - if (type == null) { + if (appPageNotification.getId() == null) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID涓嶈兘涓虹┖")); return; } - AppPageNotification old = appPageNotificationService.getAppPageNotificationByType(type.name()); + AppPageNotification old = appPageNotificationService.selectByPrimaryKey(appPageNotification.getId()); if (old == null) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔瀵硅薄宸蹭笉瀛樺湪")); return; @@ -183,7 +181,7 @@ appPageNotification.setEndTime(format.parse(endTimeVO.replaceAll("T", " "))); } - appPageNotification.setMd5(StringUtil.Md5(type.name() + "#" + content + "#" + appPageNotification.getContentUrl())); + appPageNotification.setMd5(StringUtil.Md5(appPageNotification.getType() + "#" + content + "#" + appPageNotification.getContentUrl())); appPageNotification.setUpdateTime(new Date()); appPageNotification.setId(old.getId()); @@ -211,7 +209,7 @@ * @param out */ @RequestMapping(value = "query") - public void query(String callback, Integer pageIndex, Integer pageSize, String key, + public void query(AdminAcceptData acceptData, String callback, Integer pageIndex, Integer pageSize, String key, Integer show, Integer canClose,String version, String platform, PrintWriter out) { if (pageIndex == null || pageIndex < 1) { @@ -222,7 +220,7 @@ try { List<AppPageNotification> list = appPageNotificationService.listQuery((pageIndex - 1) * pageSize, - pageSize, key, show, canClose); + pageSize, key, show, canClose,acceptData.getSystem()); if (list == null || list.size() == 0) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鏁版嵁")); @@ -233,7 +231,6 @@ for (AppPageNotification notification: list) { AppPageNotificationTypeEnum type = notification.getType(); notification.setPageName(type.getDesc()); - Date startTime = notification.getBeginTime(); if (startTime == null) { @@ -250,7 +247,7 @@ } } - long count = appPageNotificationService.countQuery(key, show, canClose); + long count = appPageNotificationService.countQuery(key, show, canClose,acceptData.getSystem()); List<AppVersionInfo> versionList = null; if (!StringUtil.isNullOrEmpty(version) || !StringUtil.isNullOrEmpty(platform)) { @@ -260,7 +257,7 @@ if (appVersion != null) versionList.add(appVersion); } else { - List<AppVersionInfo> appVersionList = appVersionService.getAppVersionInfoListByPlatform(platform); + List<AppVersionInfo> appVersionList = appVersionService.getAppVersionInfoListByPlatform(platform,acceptData.getSystem()); if (appVersionList != null) { versionList.addAll(appVersionList); } @@ -318,15 +315,15 @@ * @param id * @param out */ - @RequestMapping(value = "updateCanCloseState") - public void updateCanCloseState(String callback, String type, PrintWriter out) { + @RequestMapping(value = "switchShutOff") + public void switchShutOff(AdminAcceptData acceptData,String callback, Long id, PrintWriter out) { try { - if (type == null) { + if (id == null) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID涓嶈兘涓虹┖")); return; } - AppPageNotification resultObj = appPageNotificationService.getAppPageNotificationByType(type); + AppPageNotification resultObj = appPageNotificationService.selectByPrimaryKey(id); if (resultObj == null) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔鏁版嵁宸蹭笉瀛樺湪")); return; @@ -357,7 +354,6 @@ JSONObject data = new JSONObject(); data.put("state", newOBj.getCanClose()); JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); - } catch (Exception e) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔寮傚父")); e.printStackTrace(); @@ -370,16 +366,15 @@ * @param id * @param out */ - @RequestMapping(value = "updateShowState") - public void updateShowState(String callback, String type, PrintWriter out) { + @RequestMapping(value = "switchState") + public void switchState(AdminAcceptData acceptData,String callback, Long id, PrintWriter out) { try { - - if (type == null) { + if (id == null) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID涓嶈兘涓虹┖")); return; } - AppPageNotification resultObj = appPageNotificationService.getAppPageNotificationByType(type); + AppPageNotification resultObj = appPageNotificationService.selectByPrimaryKey(id); if (resultObj == null) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔鏁版嵁宸蹭笉瀛樺湪")); return; @@ -396,11 +391,7 @@ newOBj.setId(resultObj.getId()); newOBj.setShow(show); appPageNotificationService.updateByPrimaryKeySelective(newOBj); - - JSONObject data = new JSONObject(); - data.put("state", newOBj.getShow()); - JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data)); - + JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鎿嶄綔鎴愬姛")); } catch (Exception e) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔寮傚父")); e.printStackTrace(); @@ -414,7 +405,7 @@ * @param out */ //@RequestMapping(value = "delete") - public void delete(String callback, String idArray, PrintWriter out) { + public void delete(AdminAcceptData acceptData,String callback, String idArray, PrintWriter out) { try { if (StringUtil.isNullOrEmpty(idArray)) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("璇烽�夋嫨鎿嶄綔鐨勬暟鎹�")); @@ -438,14 +429,12 @@ e.printStackTrace(); } } - + /** - * 璁剧疆鐗堟湰 - * + * 璁剧疆鐗堟湰 * @param callback * @param id - * @param moveType - * @param sex + * @param versions * @param out */ @RequestMapping(value = "setVersions") -- Gitblit v1.8.0