| | |
| | | */
|
| | | // @RequestMapping(value = "saveAdd")
|
| | | public void saveAdd(String callback, AppPageNotification appPageNotification, PrintWriter out) {
|
| | |
|
| | | try {
|
| | | |
| | | String content = appPageNotification.getContent();
|
| | | if (StringUtil.isNullOrEmpty(content) ) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("显示内容不能为空"));
|
| | |
| | | } else {
|
| | | appPageNotification.setMd5(StringUtil.Md5(null + "#" + content + "#" + appPageNotification.getContentUrl()));
|
| | | }
|
| | | |
| | | Boolean show = appPageNotification.getShow();
|
| | | if (show == null) {
|
| | | show = false;
|
| | | appPageNotification.setShow(show);
|
| | | }
|
| | | |
| | | Boolean canClose = appPageNotification.getCanClose();
|
| | | if (canClose == null) {
|
| | | canClose = false;
|
| | | appPageNotification.setCanClose(canClose);
|
| | | }
|
| | | |
| | | String contentUrl = appPageNotification.getContentUrl();
|
| | | if (canClose != null && canClose && !StringUtil.isNullOrEmpty(contentUrl)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("跳转链接和允许关闭不可同时存在"));
|
| | | return;
|
| | | }
|
| | | |
| | |
|
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | Boolean show = appPageNotification.getShow();
|
| | | if (show == null) {
|
| | | show = false;
|
| | | appPageNotification.setShow(show);
|
| | | }
|
| | | |
| | | Boolean canClose = appPageNotification.getCanClose();
|
| | | if (canClose == null) {
|
| | | canClose = false;
|
| | | appPageNotification.setCanClose(canClose);
|
| | | }
|
| | | |
| | | if (canClose && !StringUtil.isNullOrEmpty(appPageNotification.getContentUrl())) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("跳转链接和允许关闭不可同时存在"));
|
| | | return;
|
| | | }
|
| | | |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
| | |
|
| | | String beginTimeVO = appPageNotification.getBeginTimeVO();
|
| | |
| | | }
|
| | |
|
| | | appPageNotification.setMd5(StringUtil.Md5(type.name() + "#" + content + "#" + appPageNotification.getContentUrl()));
|
| | | appPageNotification.setId(old.getId());
|
| | | appPageNotification.setUpdateTime(new Date());
|
| | | appPageNotificationService.updateByPrimaryKeySelective(appPageNotification);
|
| | | |
| | | appPageNotification.setId(old.getId());
|
| | | appPageNotification.setType(old.getType());
|
| | | appPageNotification.setCreateTime(old.getCreateTime());
|
| | | appPageNotificationService.updateByPrimaryKey(appPageNotification);
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("修改成功"));
|
| | |
|
| | |
| | | }
|
| | |
|
| | | Boolean canClose = resultObj.getCanClose();
|
| | | if (canClose) {
|
| | | resultObj.setCanClose(false);
|
| | | if (canClose != null && canClose) {
|
| | | canClose = false;
|
| | | } else {
|
| | | resultObj.setCanClose(true);
|
| | | canClose = true;
|
| | | }
|
| | |
|
| | | appPageNotificationService.updateByPrimaryKeySelective(resultObj);
|
| | | |
| | | if (canClose && !StringUtil.isNullOrEmpty(resultObj.getContentUrl())) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("跳转链接和允许关闭不可同时存在"));
|
| | | return;
|
| | | }
|
| | | |
| | | AppPageNotification newOBj = new AppPageNotification();
|
| | | newOBj.setId(resultObj.getId());
|
| | | newOBj.setCanClose(canClose);
|
| | | appPageNotificationService.updateByPrimaryKeySelective(newOBj);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("state", resultObj.getCanClose());
|
| | | data.put("state", newOBj.getCanClose());
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | |
| | | }
|
| | |
|
| | | Boolean show = resultObj.getShow();
|
| | | if (show) {
|
| | | resultObj.setShow(false);
|
| | | if (show != null && show) {
|
| | | show = false;
|
| | | } else {
|
| | | resultObj.setShow(true);
|
| | | show = true;
|
| | | }
|
| | |
|
| | | appPageNotificationService.updateByPrimaryKeySelective(resultObj);
|
| | | |
| | | AppPageNotification newOBj = new AppPageNotification();
|
| | | newOBj.setId(resultObj.getId());
|
| | | newOBj.setShow(show);
|
| | | appPageNotificationService.updateByPrimaryKeySelective(newOBj);
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("state", resultObj.getShow());
|
| | | data.put("state", newOBj.getShow());
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|