|  | @ -10,19 +10,12 @@ import com.yihu.jw.base.dao.menu.BaseMenuShowDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.menu.BaseLinkDictDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.menu.BaseMenuDictDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.menu.BaseMenuShowDO;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.article.KnowledgeArticleDictDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.ListEnvelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.MixEnvelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.utils.StringUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.utils.hibernate.HibenateUtils;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import org.apache.commons.lang3.StringUtils;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import org.springframework.beans.BeanUtils;
 | 
	
		
			
				|  |  | import org.springframework.beans.factory.annotation.Autowired;
 | 
	
		
			
				|  |  | import org.springframework.data.domain.PageRequest;
 | 
	
	
		
			
				|  | @ -52,7 +45,7 @@ public class BaseMenuManageService {
 | 
	
		
			
				|  |  |     private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
 | 
	
		
			
				|  |  |     //删除菜单字典
 | 
	
		
			
				|  |  |     public void deletMenuDict(String id) throws  Exception{
 | 
	
		
			
				|  |  |         BaseMenuDictDO baseMenuDictDO= baseMenuDictDao.getOne(id);
 | 
	
		
			
				|  |  |         BaseMenuDictDO baseMenuDictDO= baseMenuDictDao.findById(id).orElse(null);
 | 
	
		
			
				|  |  |         if (baseMenuDictDO!=null){
 | 
	
		
			
				|  |  |             if ("0".equalsIgnoreCase(baseMenuDictDO.getParentId())){
 | 
	
		
			
				|  |  |                  List<BaseMenuDictDO> childList = baseMenuDictDao.findByParentId(baseMenuDictDO.getId());
 | 
	
	
		
			
				|  | @ -172,13 +165,13 @@ public class BaseMenuManageService {
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     //查询单挑菜单字典
 | 
	
		
			
				|  |  |     public BaseMenuDictDO findOneMenuDict(String id){
 | 
	
		
			
				|  |  |         BaseMenuDictDO baseMenuDictDO= baseMenuDictDao.getOne(id);
 | 
	
		
			
				|  |  |         BaseMenuDictDO baseMenuDictDO= baseMenuDictDao.findById(id).orElse(null);
 | 
	
		
			
				|  |  |         if (baseMenuDictDO!=null){
 | 
	
		
			
				|  |  |             WlyyHospitalSysDictDO effect = wlyyHospitalSysDictDao.findOneByDictNameAndDictCode("isEffect",baseMenuDictDO.getStatus().toString());
 | 
	
		
			
				|  |  |             baseMenuDictDO.setShowName(baseMenuDictDO.getStatus().equals("1")?"是":"否");
 | 
	
		
			
				|  |  |             baseMenuDictDO.setStatusName(effect.getDictValue());
 | 
	
		
			
				|  |  |             if (!"0".equalsIgnoreCase(baseMenuDictDO.getParentId())){
 | 
	
		
			
				|  |  |                 BaseMenuDictDO parentDo= baseMenuDictDao.getOne(baseMenuDictDO.getParentId());
 | 
	
		
			
				|  |  |                 BaseMenuDictDO parentDo= baseMenuDictDao.findById(baseMenuDictDO.getParentId()).orElse(null);;
 | 
	
		
			
				|  |  |                 if (parentDo!=null){
 | 
	
		
			
				|  |  |                     baseMenuDictDO.setParentName(parentDo.getName());
 | 
	
		
			
				|  |  |                 }
 | 
	
	
		
			
				|  | @ -202,7 +195,7 @@ public class BaseMenuManageService {
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public BaseMenuDictDO downMenu(String id) throws Exception{
 | 
	
		
			
				|  |  |         BaseMenuDictDO baseMenuDictDO= baseMenuDictDao.getOne(id);
 | 
	
		
			
				|  |  |         BaseMenuDictDO baseMenuDictDO= baseMenuDictDao.findById(id).orElse(null);
 | 
	
		
			
				|  |  |         int maxSort = baseMenuDictDao.getMaxSort(baseMenuDictDO.getParentId());
 | 
	
		
			
				|  |  |         int sort = 0;
 | 
	
		
			
				|  |  |         if(null!=baseMenuDictDO){
 | 
	
	
		
			
				|  | @ -218,7 +211,7 @@ public class BaseMenuManageService {
 | 
	
		
			
				|  |  |         BaseMenuDictDO upPrevious = new BaseMenuDictDO();
 | 
	
		
			
				|  |  |         if (list.size()>0){
 | 
	
		
			
				|  |  |             String prviousBannerId = list.get(0).get("id").toString();
 | 
	
		
			
				|  |  |             upPrevious =baseMenuDictDao.getOne(prviousBannerId);
 | 
	
		
			
				|  |  |             upPrevious =baseMenuDictDao.findById(prviousBannerId).orElse(null);;
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         //交换sort值
 | 
	
	
		
			
				|  | @ -236,7 +229,7 @@ public class BaseMenuManageService {
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public BaseMenuDictDO upMenu(String id) throws Exception{
 | 
	
		
			
				|  |  |         //当前
 | 
	
		
			
				|  |  |         BaseMenuDictDO baseMenuDictDO = baseMenuDictDao.getOne(id);
 | 
	
		
			
				|  |  |         BaseMenuDictDO baseMenuDictDO = baseMenuDictDao.findById(id).orElse(null);
 | 
	
		
			
				|  |  |         int minSort = baseMenuDictDao.getMinSort(baseMenuDictDO.getParentId());
 | 
	
		
			
				|  |  |         int sort = 0;
 | 
	
		
			
				|  |  |         if(null!=baseMenuDictDO){
 | 
	
	
		
			
				|  | @ -251,7 +244,7 @@ public class BaseMenuManageService {
 | 
	
		
			
				|  |  |         BaseMenuDictDO downPrevious = new BaseMenuDictDO();
 | 
	
		
			
				|  |  |         if (list.size()>0){
 | 
	
		
			
				|  |  |             String prviousBannerId = list.get(0).get("id").toString();
 | 
	
		
			
				|  |  |             downPrevious =baseMenuDictDao.getOne(prviousBannerId);
 | 
	
		
			
				|  |  |             downPrevious =baseMenuDictDao.findById(prviousBannerId).orElse(null);;
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         //获取的下一条b
 | 
	
		
			
				|  |  |         //交换sort值
 | 
	
	
		
			
				|  | @ -274,7 +267,7 @@ public class BaseMenuManageService {
 | 
	
		
			
				|  |  |     public BaseMenuDictDO createOrUpdateMenu(String json) throws  Exception{
 | 
	
		
			
				|  |  |         BaseMenuDictDO menuDO = objectMapper.readValue(json,BaseMenuDictDO.class);
 | 
	
		
			
				|  |  |         if (StringUtils.isNoneBlank(menuDO.getId())){
 | 
	
		
			
				|  |  |             BaseMenuDictDO menuOld = baseMenuDictDao.getOne(menuDO.getId());
 | 
	
		
			
				|  |  |             BaseMenuDictDO menuOld = baseMenuDictDao.findById(menuDO.getId()).orElse(null);;
 | 
	
		
			
				|  |  |             if (menuOld!=null){
 | 
	
		
			
				|  |  |                 menuOld.setParentId(menuDO.getParentId());
 | 
	
		
			
				|  |  |                 menuOld.setName(menuDO.getName());
 | 
	
	
		
			
				|  | @ -309,7 +302,7 @@ public class BaseMenuManageService {
 | 
	
		
			
				|  |  |         BaseLinkDictDO linkDictDO = objectMapper.readValue(json,BaseLinkDictDO.class);
 | 
	
		
			
				|  |  |         Integer maxSort=baseLinkDictDao.getMaxSort();
 | 
	
		
			
				|  |  |         if (StringUtils.isNoneBlank(linkDictDO.getId())){
 | 
	
		
			
				|  |  |             BaseLinkDictDO baseLinkDictDO=baseLinkDictDao.getOne(linkDictDO.getId());
 | 
	
		
			
				|  |  |             BaseLinkDictDO baseLinkDictDO=baseLinkDictDao.findById(linkDictDO.getId()).orElse(null);;
 | 
	
		
			
				|  |  |             if (baseLinkDictDO!=null){
 | 
	
		
			
				|  |  |                 baseLinkDictDO.setName(linkDictDO.getName());
 | 
	
		
			
				|  |  |                 baseLinkDictDO.setLinkUrl(linkDictDO.getLinkUrl());
 | 
	
	
		
			
				|  | @ -360,7 +353,7 @@ public class BaseMenuManageService {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  |     public BaseLinkDictDO findOneLinkDict(String id){
 | 
	
		
			
				|  |  |         BaseLinkDictDO baseLinkDictDO= baseLinkDictDao.getOne(id);
 | 
	
		
			
				|  |  |         BaseLinkDictDO baseLinkDictDO= baseLinkDictDao.findById(id).orElse(null);
 | 
	
		
			
				|  |  |         if (baseLinkDictDO!=null){
 | 
	
		
			
				|  |  |             WlyyHospitalSysDictDO effect = wlyyHospitalSysDictDao.findOneByDictNameAndDictCode("isEffect",baseLinkDictDO.getStatus());
 | 
	
		
			
				|  |  |             baseLinkDictDO.setShowName(baseLinkDictDO.getStatus().equalsIgnoreCase("1")?"是":"否");
 | 
	
	
		
			
				|  | @ -376,7 +369,7 @@ public class BaseMenuManageService {
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public BaseLinkDictDO downlink(String id) throws Exception{
 | 
	
		
			
				|  |  |         BaseLinkDictDO baseLinkDictDO= baseLinkDictDao.getOne(id);
 | 
	
		
			
				|  |  |         BaseLinkDictDO baseLinkDictDO= baseLinkDictDao.findById(id).orElse(null);
 | 
	
		
			
				|  |  |         int maxSort = baseLinkDictDao.getMaxSort();
 | 
	
		
			
				|  |  |         int sort = 0;
 | 
	
		
			
				|  |  |         if(null!=baseLinkDictDO){
 | 
	
	
		
			
				|  | @ -391,7 +384,7 @@ public class BaseMenuManageService {
 | 
	
		
			
				|  |  |         BaseLinkDictDO upPrevious = new BaseLinkDictDO();
 | 
	
		
			
				|  |  |         if (list.size()>0){
 | 
	
		
			
				|  |  |             String prviousBannerId = list.get(0).get("id").toString();
 | 
	
		
			
				|  |  |             upPrevious =baseLinkDictDao.getOne(prviousBannerId);
 | 
	
		
			
				|  |  |             upPrevious =baseLinkDictDao.findById(prviousBannerId).orElse(null);;
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         //交换sort值
 | 
	
	
		
			
				|  | @ -409,7 +402,7 @@ public class BaseMenuManageService {
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public BaseLinkDictDO upLink(String id) throws Exception{
 | 
	
		
			
				|  |  |         //当前
 | 
	
		
			
				|  |  |         BaseLinkDictDO baseLinkDictDO = baseLinkDictDao.getOne(id);
 | 
	
		
			
				|  |  |         BaseLinkDictDO baseLinkDictDO = baseLinkDictDao.findById(id).orElse(null);
 | 
	
		
			
				|  |  |         int minSort = baseLinkDictDao.getMinSort();
 | 
	
		
			
				|  |  |         int sort = 0;
 | 
	
		
			
				|  |  |         if(null!=baseLinkDictDO){
 | 
	
	
		
			
				|  | @ -423,7 +416,7 @@ public class BaseMenuManageService {
 | 
	
		
			
				|  |  |         BaseLinkDictDO downPrevious = new BaseLinkDictDO();
 | 
	
		
			
				|  |  |         if (list.size()>0){
 | 
	
		
			
				|  |  |             String prviousBannerId = list.get(0).get("id").toString();
 | 
	
		
			
				|  |  |             downPrevious =baseLinkDictDao.getOne(prviousBannerId);
 | 
	
		
			
				|  |  |             downPrevious =baseLinkDictDao.findById(prviousBannerId).orElse(null);;
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         //获取的下一条b
 | 
	
		
			
				|  |  |         //交换sort值
 | 
	
	
		
			
				|  | @ -467,7 +460,7 @@ public class BaseMenuManageService {
 | 
	
		
			
				|  |  |      *
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public BaseMenuShowDO removeMenu(String menuId){
 | 
	
		
			
				|  |  |         BaseMenuShowDO baseMenuShowDO = baseMenuShowDao.getOne(menuId);
 | 
	
		
			
				|  |  |         BaseMenuShowDO baseMenuShowDO = baseMenuShowDao.findById(menuId).orElse(null);;
 | 
	
		
			
				|  |  |         baseMenuShowDO.setIsDel("0");
 | 
	
		
			
				|  |  |         baseMenuShowDao.save(baseMenuShowDO);
 | 
	
		
			
				|  |  |         return baseMenuShowDO;
 | 
	
	
		
			
				|  | @ -502,7 +495,7 @@ public class BaseMenuManageService {
 | 
	
		
			
				|  |  |         for (Map<String,Object> map:list){
 | 
	
		
			
				|  |  |             if (map.get("parentId")!=null){
 | 
	
		
			
				|  |  |                 String parentId = map.get("parentId").toString();
 | 
	
		
			
				|  |  |                 BaseMenuDictDO parentDo= baseMenuDictDao.getOne(parentId);
 | 
	
		
			
				|  |  |                 BaseMenuDictDO parentDo= baseMenuDictDao.findById(parentId).orElse(null);
 | 
	
		
			
				|  |  |                 if (parentDo!=null){
 | 
	
		
			
				|  |  |                     map.put("parentName",parentDo.getName());
 | 
	
		
			
				|  |  |                 }
 | 
	
	
		
			
				|  | @ -551,7 +544,7 @@ public class BaseMenuManageService {
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public BaseMenuShowDO downMenuShow(String id) throws Exception{
 | 
	
		
			
				|  |  |         BaseMenuShowDO baseMenuShowDO= baseMenuShowDao.getOne(id);
 | 
	
		
			
				|  |  |         BaseMenuShowDO baseMenuShowDO= baseMenuShowDao.findById(id).orElse(null);
 | 
	
		
			
				|  |  |         int maxSort = baseMenuShowDao.getMaxSort(baseMenuShowDO.getModelId());
 | 
	
		
			
				|  |  |         int sort = 0;
 | 
	
		
			
				|  |  |         if(null!=baseMenuShowDO){
 | 
	
	
		
			
				|  | @ -567,7 +560,7 @@ public class BaseMenuManageService {
 | 
	
		
			
				|  |  |         BaseMenuShowDO upPrevious = new BaseMenuShowDO();
 | 
	
		
			
				|  |  |         if (list.size()>0){
 | 
	
		
			
				|  |  |             String prviousBannerId = list.get(0).get("id").toString();
 | 
	
		
			
				|  |  |             upPrevious =baseMenuShowDao.getOne(prviousBannerId);
 | 
	
		
			
				|  |  |             upPrevious =baseMenuShowDao.findById(prviousBannerId).orElse(null);;
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         //交换sort值
 | 
	
	
		
			
				|  | @ -585,7 +578,7 @@ public class BaseMenuManageService {
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public BaseMenuShowDO upMenuShow(String id) throws Exception{
 | 
	
		
			
				|  |  |         //当前
 | 
	
		
			
				|  |  |         BaseMenuShowDO baseMenuShowDO = baseMenuShowDao.getOne(id);
 | 
	
		
			
				|  |  |         BaseMenuShowDO baseMenuShowDO = baseMenuShowDao.findById(id).orElse(null);
 | 
	
		
			
				|  |  |         int minSort = baseMenuShowDao.getMinSort(baseMenuShowDO.getModelId());
 | 
	
		
			
				|  |  |         int sort = 0;
 | 
	
		
			
				|  |  |         if(null!=baseMenuShowDO){
 | 
	
	
		
			
				|  | @ -600,7 +593,7 @@ public class BaseMenuManageService {
 | 
	
		
			
				|  |  |         BaseMenuShowDO downPrevious = new BaseMenuShowDO();
 | 
	
		
			
				|  |  |         if (list.size()>0){
 | 
	
		
			
				|  |  |             String prviousBannerId = list.get(0).get("id").toString();
 | 
	
		
			
				|  |  |             downPrevious =baseMenuShowDao.getOne(prviousBannerId);
 | 
	
		
			
				|  |  |             downPrevious =baseMenuShowDao.findById(prviousBannerId).orElse(null);;
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         //获取的下一条b
 | 
	
		
			
				|  |  |         //交换sort值
 |