diff --git a/src/main/java/com/lq/cms/service/WechatMessageService.java b/src/main/java/com/lq/cms/service/WechatMessageService.java index 9bb4adb..fa22686 100755 --- a/src/main/java/com/lq/cms/service/WechatMessageService.java +++ b/src/main/java/com/lq/cms/service/WechatMessageService.java @@ -8,5 +8,5 @@ import java.util.List; public interface WechatMessageService extends AdminBaseService { - List findAllWechatMessageVo(); + List findAllWechatMessageVo(WechatMessageVo wechatMessageVo); } diff --git a/src/main/java/com/lq/cms/service/impl/WechatMessageServiceImpl.java b/src/main/java/com/lq/cms/service/impl/WechatMessageServiceImpl.java index e701a8b..0705ab1 100755 --- a/src/main/java/com/lq/cms/service/impl/WechatMessageServiceImpl.java +++ b/src/main/java/com/lq/cms/service/impl/WechatMessageServiceImpl.java @@ -26,13 +26,14 @@ public class WechatMessageServiceImpl extends AdminBaseServiceImpl findAllWechatMessageVo() { + public List findAllWechatMessageVo(WechatMessageVo wechatMessageVo) { List wechatMessageVoList = new ArrayList<>(); - List wechatMessageList = wechatMessageDao.findAll(); + List wechatMessageList = wechatMessageDao.findAllByWechatMessageVo(wechatMessageVo); + wechatMessageList.forEach(wechatMessage -> { - WechatMessageVo wechatMessageVo = new WechatMessageVo(); - BeanUtil.copyNotNull(wechatMessageVo,wechatMessage); - wechatMessageVoList.add(wechatMessageVo); + WechatMessageVo wechatMessageVo1 = new WechatMessageVo(); + BeanUtil.copyNotNull(wechatMessageVo1,wechatMessage); + wechatMessageVoList.add(wechatMessageVo1); }); return wechatMessageVoList; diff --git a/src/main/java/com/lq/cms/web/AdminBaseController.java b/src/main/java/com/lq/cms/web/AdminBaseController.java index f4577c1..3d1b673 100755 --- a/src/main/java/com/lq/cms/web/AdminBaseController.java +++ b/src/main/java/com/lq/cms/web/AdminBaseController.java @@ -5,6 +5,7 @@ import com.lq.cms.mode.AdminDataGridParam; import com.lq.cms.service.AdminBaseService; import com.lq.cms.vo.AdminBaseVo; import com.lq.code.entity.AjaxResult; +import com.lq.code.util.Constant; import org.apache.shiro.SecurityUtils; import org.apache.shiro.subject.Subject; import org.slf4j.Logger; @@ -46,7 +47,7 @@ public abstract class AdminBaseController { @ResponseBody public AdminDataGridParam list(V vo){ Subject subject = SecurityUtils.getSubject(); - subject.checkPermission(getIndexUrl()+":"+ PermissionTyepEnum.SELECT.getConstant()); + subject.checkPermission(getIndexUrl()+ Constant.PERSSION_MARK+ PermissionTyepEnum.SELECT.getConstant()); AdminDataGridParam adminDataGridParam = setPageDate(vo); return adminDataGridParam; } @@ -55,7 +56,7 @@ public abstract class AdminBaseController { @ResponseBody public AjaxResult save(V vo) throws InstantiationException, IllegalAccessException { Subject subject = SecurityUtils.getSubject(); - subject.checkPermission(getIndexUrl()+":"+ PermissionTyepEnum.INSERT.getConstant()); + subject.checkPermission(getIndexUrl()+Constant.PERSSION_MARK+ PermissionTyepEnum.INSERT.getConstant()); AjaxResult ajaxResult = new AjaxResult(); T t = getBaseService().save(vo); ajaxResult.setData(t); @@ -66,7 +67,7 @@ public abstract class AdminBaseController { @ResponseBody public AjaxResult update(V vo){ Subject subject = SecurityUtils.getSubject(); - subject.checkPermission(getIndexUrl()+":"+ PermissionTyepEnum.UPDATE.getConstant()); + subject.checkPermission(getIndexUrl()+Constant.PERSSION_MARK+ PermissionTyepEnum.UPDATE.getConstant()); AjaxResult ajaxResult= new AjaxResult(); getBaseService().update(vo); return ajaxResult; @@ -76,7 +77,7 @@ public abstract class AdminBaseController { @ResponseBody public AjaxResult delete(Long id){ Subject subject = SecurityUtils.getSubject(); - subject.checkPermission(getIndexUrl()+":"+ PermissionTyepEnum.DELETE.getConstant()); + subject.checkPermission(getIndexUrl()+Constant.PERSSION_MARK+ PermissionTyepEnum.DELETE.getConstant()); AjaxResult ajaxResult = new AjaxResult(); getBaseService().delete(id); return ajaxResult; 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 f1769c1..f180862 100755 --- a/src/main/java/com/lq/cms/web/wechat/WechatMessageController.java +++ b/src/main/java/com/lq/cms/web/wechat/WechatMessageController.java @@ -46,8 +46,8 @@ public class WechatMessageController extends AdminBaseController wechatMessageVoList = wechatMessageService.findAllWechatMessageVo(); + public Object findAll(WechatMessageVo wechatMessageVo){ + List wechatMessageVoList = wechatMessageService.findAllWechatMessageVo(wechatMessageVo); WechatMessageBo wechatMessageBo = new WechatMessageBo(); wechatMessageBo.setWechatMessageVoList(wechatMessageVoList); wechatMessageBo.setWechatMessageCount(wechatMessageVoList.size()); diff --git a/src/main/java/com/lq/dao/WechatMessageDao.java b/src/main/java/com/lq/dao/WechatMessageDao.java index 60480f4..df491b3 100755 --- a/src/main/java/com/lq/dao/WechatMessageDao.java +++ b/src/main/java/com/lq/dao/WechatMessageDao.java @@ -4,6 +4,9 @@ import com.lq.cms.dao.AdminBaseDao; import com.lq.cms.vo.WechatMessageVo; import com.lq.entity.WechatMessage; +import java.util.List; + public interface WechatMessageDao extends AdminBaseDao { + List findAllByWechatMessageVo(WechatMessageVo wechatMessageVo); } diff --git a/src/main/resources/mybatis/mapping/WechatMessageDao.xml b/src/main/resources/mybatis/mapping/WechatMessageDao.xml index 16f95c2..ff531f0 100644 --- a/src/main/resources/mybatis/mapping/WechatMessageDao.xml +++ b/src/main/resources/mybatis/mapping/WechatMessageDao.xml @@ -78,5 +78,16 @@ status = 1 + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/jsp/cms/wechat/message/edit.jsp b/src/main/webapp/WEB-INF/views/jsp/cms/wechat/message/edit.jsp index d50a692..293579f 100755 --- a/src/main/webapp/WEB-INF/views/jsp/cms/wechat/message/edit.jsp +++ b/src/main/webapp/WEB-INF/views/jsp/cms/wechat/message/edit.jsp @@ -21,7 +21,7 @@ @@ -69,6 +69,7 @@ + + + +