|  | @ -2,6 +2,7 @@ package com.epmet.service.impl; | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  | import com.alibaba.fastjson.JSON; |  |  | import com.alibaba.fastjson.JSON; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.tools.constant.NumConstant; |  |  | import com.epmet.commons.tools.constant.NumConstant; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import com.epmet.commons.tools.constant.StrConstant; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.tools.exception.EpmetErrorCode; |  |  | import com.epmet.commons.tools.exception.EpmetErrorCode; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.tools.exception.RenException; |  |  | import com.epmet.commons.tools.exception.RenException; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.commons.tools.security.dto.TokenDto; |  |  | import com.epmet.commons.tools.security.dto.TokenDto; | 
			
		
	
	
		
		
			
				
					|  | @ -12,6 +13,7 @@ import com.epmet.commons.tools.validator.ValidatorUtils; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.constant.BadgeConstant; |  |  | import com.epmet.constant.BadgeConstant; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.constant.ReadFlagConstant; |  |  | import com.epmet.constant.ReadFlagConstant; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.constant.SmsTemplateConstant; |  |  | import com.epmet.constant.SmsTemplateConstant; | 
			
		
	
		
		
			
				
					|  |  |  |  |  | import com.epmet.constant.UserMessageTypeConstant; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.dao.*; |  |  | import com.epmet.dao.*; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.dto.ResiUserBadgeDTO; |  |  | import com.epmet.dto.ResiUserBadgeDTO; | 
			
		
	
		
		
			
				
					|  |  | import com.epmet.dto.UserBadgeCertificateRecordDTO; |  |  | import com.epmet.dto.UserBadgeCertificateRecordDTO; | 
			
		
	
	
		
		
			
				
					|  | @ -53,8 +55,6 @@ public class UserBadgeServiceImpl implements UserBadgeService { | 
			
		
	
		
		
			
				
					|  |  |     @Autowired |  |  |     @Autowired | 
			
		
	
		
		
			
				
					|  |  |     private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; |  |  |     private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; | 
			
		
	
		
		
			
				
					|  |  |     @Autowired |  |  |     @Autowired | 
			
		
	
		
		
			
				
					|  |  |     private EpmetMessageOpenFeignClient messageFeignClient; |  |  |  | 
			
		
	
		
		
			
				
					|  |  |     @Autowired |  |  |  | 
			
		
	
		
		
			
				
					|  |  |     private UserRoleDao userRoleDao; |  |  |     private UserRoleDao userRoleDao; | 
			
		
	
		
		
			
				
					|  |  |     @Autowired |  |  |     @Autowired | 
			
		
	
		
		
			
				
					|  |  |     private ResiUserBadgeDao resiUserBadgeDao; |  |  |     private ResiUserBadgeDao resiUserBadgeDao; | 
			
		
	
	
		
		
			
				
					|  | @ -278,11 +278,10 @@ public class UserBadgeServiceImpl implements UserBadgeService { | 
			
		
	
		
		
			
				
					|  |  |         form.setSurname(certificationAddFormDTO.getSurname()); |  |  |         form.setSurname(certificationAddFormDTO.getSurname()); | 
			
		
	
		
		
			
				
					|  |  |         log.info(JSON.toJSONString(form)); |  |  |         log.info(JSON.toJSONString(form)); | 
			
		
	
		
		
			
				
					|  |  |         userBadgeDao.insertUserBadgeCertificateRecord(form); |  |  |         userBadgeDao.insertUserBadgeCertificateRecord(form); | 
			
		
	
		
		
			
				
					|  |  | 
 |  |  |  | 
			
		
	
		
		
			
				
					|  |  |         //TODO 站内信发送
 |  |  |         //TODO 站内信发送
 | 
			
		
	
		
		
			
				
					|  |  |         String badgeName = badgeDao.selectBadgeName(form.getCustomerId(), form.getBadgeId()); |  |  |         String badgeName = badgeDao.selectBadgeName(form.getCustomerId(), form.getBadgeId()); | 
			
		
	
		
		
			
				
					|  |  |         String msg = String.format(BadgeConstant.MESSAGE_CONTENT, userBaseInfoResultDTOS.get(NumConstant.ZERO).getDistrict().concat(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRealName()), badgeName); |  |  |         String msg = String.format(BadgeConstant.MESSAGE_CONTENT, userBaseInfoResultDTOS.get(NumConstant.ZERO).getDistrict().concat(userBaseInfoResultDTOS.get(NumConstant.ZERO).getRealName()), badgeName); | 
			
		
	
		
		
			
				
					
					|  |  |         sendMessage(BadgeConstant.AUTH_TITLE,msg,form.getGridId(),form.getUserId(),form.getCustomerId()); |  |  |         sendMessage(BadgeConstant.AUTH_TITLE,msg,form.getGridId(),form.getUserId(),form.getCustomerId(), UserMessageTypeConstant.BADGE_AUTH_APPLY); | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  | 
 |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |         return new Result(); |  |  |         return new Result(); | 
			
		
	
		
		
			
				
					|  |  |     } |  |  |     } | 
			
		
	
	
		
		
			
				
					|  | @ -443,7 +442,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { | 
			
		
	
		
		
			
				
					|  |  |      * @author zxc |  |  |      * @author zxc | 
			
		
	
		
		
			
				
					|  |  |      * @date 2020/11/19 上午9:16 |  |  |      * @date 2020/11/19 上午9:16 | 
			
		
	
		
		
			
				
					|  |  |      */ |  |  |      */ | 
			
		
	
		
		
			
				
					
					|  |  |     public void sendMessage(String title,String msg,String gridId,String userId,String customerId){ |  |  |     public void sendMessage(String title,String msg,String gridId,String userId,String customerId,String messageType){ | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					|  |  |         //1.查询加入当前网格下的人员 customer_staff_grid
 |  |  |         //1.查询加入当前网格下的人员 customer_staff_grid
 | 
			
		
	
		
		
			
				
					|  |  |         CommonGridIdFormDTO commonGridIdFormDTO = new CommonGridIdFormDTO(); |  |  |         CommonGridIdFormDTO commonGridIdFormDTO = new CommonGridIdFormDTO(); | 
			
		
	
		
		
			
				
					|  |  |         commonGridIdFormDTO.setGridId(gridId); |  |  |         commonGridIdFormDTO.setGridId(gridId); | 
			
		
	
	
		
		
			
				
					|  | @ -474,6 +473,12 @@ public class UserBadgeServiceImpl implements UserBadgeService { | 
			
		
	
		
		
			
				
					|  |  |                     msgObj.setReadFlag(ReadFlagConstant.UN_READ); |  |  |                     msgObj.setReadFlag(ReadFlagConstant.UN_READ); | 
			
		
	
		
		
			
				
					|  |  |                     msgObj.setTitle(title); |  |  |                     msgObj.setTitle(title); | 
			
		
	
		
		
			
				
					|  |  |                     msgObj.setUserId(to); |  |  |                     msgObj.setUserId(to); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                     //21.09.10:记录消息类型和对应的业务id
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                     msgObj.setMessageType(messageType); | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                     //todo
 | 
			
		
	
		
		
			
				
					|  |  |  |  |  |                     msgObj.setTargetId(StrConstant.EPMETY_STR); | 
			
		
	
		
		
			
				
					|  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					|  |  |                     msgList.add(msgObj); |  |  |                     msgList.add(msgObj); | 
			
		
	
		
		
			
				
					|  |  |                     //微信订阅
 |  |  |                     //微信订阅
 | 
			
		
	
		
		
			
				
					|  |  |                     WxSubscribeMessageFormDTO subscribeDTO = new WxSubscribeMessageFormDTO(); |  |  |                     WxSubscribeMessageFormDTO subscribeDTO = new WxSubscribeMessageFormDTO(); | 
			
		
	
	
		
		
			
				
					|  | 
 |