|  |  | @ -1,14 +1,22 @@ | 
			
		
	
		
			
				
					|  |  |  | package com.epmet.service.impl; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | import com.alibaba.fastjson.JSON; | 
			
		
	
		
			
				
					|  |  |  | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
			
		
	
		
			
				
					|  |  |  | import com.baomidou.mybatisplus.core.metadata.IPage; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.constant.FieldConstant; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.constant.ServiceConstant; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.page.PageData; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.security.user.LoginUserUtil; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.ConvertUtils; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.constant.FieldConstant; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.Result; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dao.IcWorkLogDao; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.CustomerStaffDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.IcWorkLogDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.form.UserResiInfoFormDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.result.UserResiInfoResultDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.entity.IcWorkLogEntity; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.feign.EpmetUserFeignClient; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.redis.IcWorkLogRedis; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.IcWorkLogService; | 
			
		
	
		
			
				
					|  |  |  | import org.apache.commons.lang3.StringUtils; | 
			
		
	
	
		
			
				
					|  |  | @ -32,12 +40,18 @@ public class IcWorkLogServiceImpl extends BaseServiceImpl<IcWorkLogDao, IcWorkLo | 
			
		
	
		
			
				
					|  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |     private IcWorkLogRedis icWorkLogRedis; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |     private LoginUserUtil loginUserUtil; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @Autowired | 
			
		
	
		
			
				
					|  |  |  |     private EpmetUserFeignClient epmetUserFeignClient; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |     public PageData<IcWorkLogDTO> page(Map<String, Object> params) { | 
			
		
	
		
			
				
					|  |  |  |         IPage<IcWorkLogEntity> page = baseDao.selectPage( | 
			
		
	
		
			
				
					|  |  |  |                 getPage(params, FieldConstant.CREATED_TIME, false), | 
			
		
	
		
			
				
					|  |  |  |                 getWrapper(params) | 
			
		
	
		
			
				
					|  |  |  |         ); | 
			
		
	
		
			
				
					|  |  |  |         params.put("customerId", loginUserUtil.getLoginUserCustomerId()); | 
			
		
	
		
			
				
					|  |  |  |         IPage<IcWorkLogDTO> page = getPage(params); | 
			
		
	
		
			
				
					|  |  |  |         List<IcWorkLogDTO> list = baseDao.listPage(params); | 
			
		
	
		
			
				
					|  |  |  |         return getPageData(page, IcWorkLogDTO.class); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | @ -66,6 +80,15 @@ public class IcWorkLogServiceImpl extends BaseServiceImpl<IcWorkLogDao, IcWorkLo | 
			
		
	
		
			
				
					|  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |     @Transactional(rollbackFor = Exception.class) | 
			
		
	
		
			
				
					|  |  |  |     public void save(IcWorkLogDTO dto) { | 
			
		
	
		
			
				
					|  |  |  |         //查询当前申请用户的基本信息
 | 
			
		
	
		
			
				
					|  |  |  |         CustomerStaffDTO customerStaffParam = new CustomerStaffDTO(); | 
			
		
	
		
			
				
					|  |  |  |         customerStaffParam.setUserId(loginUserUtil.getLoginUserId()); | 
			
		
	
		
			
				
					|  |  |  |         Result<CustomerStaffDTO> staffInfo = epmetUserFeignClient.getCustomerStaffInfoByUserId(customerStaffParam); | 
			
		
	
		
			
				
					|  |  |  |         if (!staffInfo.success() || null == staffInfo.getData()) { | 
			
		
	
		
			
				
					|  |  |  |             logger.warn(String.format("居民申请入群,给组长发送消息通知错误,调用%s服务查询申请用户名称失败,入参%s", ServiceConstant.EPMET_USER_SERVER, JSON.toJSONString(userResiInfoFormDTO))); | 
			
		
	
		
			
				
					|  |  |  |         } else { | 
			
		
	
		
			
				
					|  |  |  |             currentUserName = resultUserInfo.getData().getShowName(); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         IcWorkLogEntity entity = ConvertUtils.sourceToTarget(dto, IcWorkLogEntity.class); | 
			
		
	
		
			
				
					|  |  |  |         insert(entity); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
	
		
			
				
					|  |  | 
 |