From 2188777892443d40ee32186c2fd73da1c16032ca Mon Sep 17 00:00:00 2001 From: qi_liang Date: Wed, 29 May 2019 11:38:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=A0=E9=99=A4=E6=96=B9?= =?UTF-8?q?=E6=B3=95bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lq/cms/web/wechat/WechatMessageController.java | 12 ++++++++++-- src/main/resources/mybatis/mapping/SysFileDao.xml | 6 ++++-- src/main/resources/mybatis/mapping/SysLogDao.xml | 6 ++++-- .../resources/mybatis/mapping/SysResourceDao.xml | 9 ++++++--- src/main/resources/mybatis/mapping/SysRoleDao.xml | 7 ++++++- .../mybatis/mapping/SysRoleResourcePermissionDao.xml | 5 +++-- src/main/resources/mybatis/mapping/SysUserDao.xml | 7 ++++--- .../mybatis/mapping/WechatAccesstokenDao.xml | 6 ++++-- src/main/resources/mybatis/mapping/WechatInfoDao.xml | 7 ++++--- src/main/resources/mybatis/mapping/WechatRuleDao.xml | 2 +- src/main/resources/mybatis/mapping/WechatUserDao.xml | 2 +- 11 files changed, 47 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/lq/cms/web/wechat/WechatMessageController.java b/src/main/java/com/lq/cms/web/wechat/WechatMessageController.java index a937b8d..0a63e51 100755 --- a/src/main/java/com/lq/cms/web/wechat/WechatMessageController.java +++ b/src/main/java/com/lq/cms/web/wechat/WechatMessageController.java @@ -10,6 +10,7 @@ import com.lq.cms.web.AdminBaseController; import com.lq.code.entity.AjaxResult; import com.lq.code.util.Constant; import com.lq.code.util.FileUtil; +import com.lq.code.util.StringUtil; import com.lq.entity.SysUser; import com.lq.entity.WechatMessage; import org.apache.shiro.authz.annotation.RequiresPermissions; @@ -24,6 +25,7 @@ import org.springframework.web.multipart.MultipartFile; import java.io.File; import java.io.IOException; +import java.util.Date; import java.util.List; import java.util.Map; import java.util.UUID; @@ -77,7 +79,10 @@ public class WechatMessageController { AjaxResult ajaxResult = new AjaxResult(); try { String filePath = upLoadFile(file); - vo.setImageUrl(filePath); + if(StringUtil.isNotNull(filePath)) { + vo.setImageUrl(filePath); + } + vo.setUpdateTime(new Date()); wechatMessageService.save(vo); } catch (IllegalAccessException e) { e.printStackTrace(); @@ -93,7 +98,10 @@ public class WechatMessageController { public Object update(WechatMessageVo vo,@RequestParam(value = "file",required = false) MultipartFile file){ AjaxResult ajaxResult = new AjaxResult(); String filePath = upLoadFile(file); - vo.setImageUrl(filePath); + if (StringUtil.isNotNull(filePath)) { + vo.setImageUrl(filePath); + } + vo.setUpdateTime(new Date()); wechatMessageService.update(vo); return ajaxResult; } diff --git a/src/main/resources/mybatis/mapping/SysFileDao.xml b/src/main/resources/mybatis/mapping/SysFileDao.xml index 23939d6..8b8c82a 100644 --- a/src/main/resources/mybatis/mapping/SysFileDao.xml +++ b/src/main/resources/mybatis/mapping/SysFileDao.xml @@ -45,8 +45,10 @@ - DELETE - FROM sys_file + UPDATE + sys_file + SET + status = 0 WHERE id=#{id} diff --git a/src/main/resources/mybatis/mapping/SysLogDao.xml b/src/main/resources/mybatis/mapping/SysLogDao.xml index e940a9a..33c47e9 100644 --- a/src/main/resources/mybatis/mapping/SysLogDao.xml +++ b/src/main/resources/mybatis/mapping/SysLogDao.xml @@ -49,8 +49,10 @@ - DELETE - FROM sys_log + UPDATE + sys_log + SET + status = 0 WHERE id=#{id} diff --git a/src/main/resources/mybatis/mapping/SysResourceDao.xml b/src/main/resources/mybatis/mapping/SysResourceDao.xml index 6b161a7..051cae8 100644 --- a/src/main/resources/mybatis/mapping/SysResourceDao.xml +++ b/src/main/resources/mybatis/mapping/SysResourceDao.xml @@ -70,9 +70,12 @@ - UPDATE sys_resource - SET status = 0 - WHERE id=#{id} + UPDATE + sys_resource + SET + status = 0 + WHERE + id=#{id} diff --git a/src/main/resources/mybatis/mapping/SysRoleDao.xml b/src/main/resources/mybatis/mapping/SysRoleDao.xml index f531bac..bc02c45 100644 --- a/src/main/resources/mybatis/mapping/SysRoleDao.xml +++ b/src/main/resources/mybatis/mapping/SysRoleDao.xml @@ -59,7 +59,12 @@ - UPDATE sys_role SET status = 0 WHERE id=#{id} + UPDATE + sys_role + SET + status = 0 + WHERE + id=#{id} diff --git a/src/main/resources/mybatis/mapping/WechatRuleDao.xml b/src/main/resources/mybatis/mapping/WechatRuleDao.xml index 727b18d..89769cb 100644 --- a/src/main/resources/mybatis/mapping/WechatRuleDao.xml +++ b/src/main/resources/mybatis/mapping/WechatRuleDao.xml @@ -63,7 +63,7 @@ UPDATE - FROM wechat_rule + wechat_rule SET status = 0 WHERE diff --git a/src/main/resources/mybatis/mapping/WechatUserDao.xml b/src/main/resources/mybatis/mapping/WechatUserDao.xml index 914d102..726d0b7 100644 --- a/src/main/resources/mybatis/mapping/WechatUserDao.xml +++ b/src/main/resources/mybatis/mapping/WechatUserDao.xml @@ -72,7 +72,7 @@ UPDATE - FROM wechat_user + wechat_user SET status = 0 WHERE