| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -32,6 +32,7 @@ import com.epmet.dto.UserAdviceDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.form.AdviceListFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.form.ReplyAdviceFormDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.result.AdviceDetailResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.result.AdviceListResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.entity.UserAdviceEntity; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.entity.UserAdviceImgEntity; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.redis.UserAdviceRedis; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -39,14 +40,11 @@ import com.epmet.service.UserAdviceImgService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.UserAdviceService; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import io.jsonwebtoken.lang.Collections; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.commons.lang3.StringUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.apache.poi.ss.formula.functions.T; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.beans.BeanUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.beans.factory.annotation.Autowired; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.context.annotation.Bean; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.stereotype.Service; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import org.springframework.transaction.annotation.Transactional; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import javax.annotation.Resource; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.ArrayList; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.Arrays; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import java.util.List; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -168,7 +166,6 @@ public class UserAdviceServiceImpl extends BaseServiceImpl<UserAdviceDao, UserAd | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        AdviceDetailResultDTO adviceDetailResultDTO = new AdviceDetailResultDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        BeanUtils.copyProperties(userAdviceEntity, adviceDetailResultDTO); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        adviceDetailResultDTO.setAdviceId(userAdviceEntity.getId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        adviceDetailResultDTO.setAdviceTime(userAdviceEntity.getCreatedTime()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //拼接建议类型
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (!"*".equals(userAdviceEntity.getAdviceType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            StringBuilder type = new StringBuilder(); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -207,7 +204,7 @@ public class UserAdviceServiceImpl extends BaseServiceImpl<UserAdviceDao, UserAd | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @Date 2020/11/9 10:41 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public PageData<UserAdviceDTO> adviceList(AdviceListFormDTO dto) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public PageData<AdviceListResultDTO> adviceList(AdviceListFormDTO dto) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //page分页
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Page<UserAdviceEntity> page = new Page<>(dto.getPageNo(), dto.getPageSize()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //时间降序
 | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -215,9 +212,48 @@ public class UserAdviceServiceImpl extends BaseServiceImpl<UserAdviceDao, UserAd | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //wrapper
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        QueryWrapper<UserAdviceEntity> wrapper = new QueryWrapper<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //客户Id
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        wrapper.eq(StringUtils.isNotBlank(dto.getCustomerId()), "CUSTOMER_ID", dto.getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //是否回复
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if ("1".equals(dto.getIsReply())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            wrapper.ne("REPLY_USER_ID", ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            wrapper.ne("REPLY_CONTENT", ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } else if ("0".equals(dto.getIsReply())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            wrapper.eq("REPLY_USER_ID", ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            wrapper.eq("REPLY_CONTENT", ""); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 组织id
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        wrapper.eq(StringUtils.isNotBlank(dto.getAgencyId()), "AGENCY_ID", dto.getAgencyId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //建议类型
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        wrapper.like(StringUtils.isNotBlank(dto.getAdviceType()), "ADVICE_TYPE", dto.getAdviceType()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //开始时间
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        wrapper.ge(dto.getStartTime() != null, "CREATED_TIME", dto.getStartTime()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //结束时间
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        wrapper.le(dto.getEndTime() != null, "CREATED_TIME", dto.getEndTime()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        IPage<UserAdviceEntity> result = baseDao.selectPage(page, wrapper); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<UserAdviceEntity> records = result.getRecords(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //拼接type
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        for (int i = 0; i < records.size(); i++) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (!"*".equals(records.get(i).getAdviceType())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                StringBuilder type = new StringBuilder(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (records.get(i).getAdviceType().contains("gov")) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    type.append(UserAdviceConstant.GOV_TYPE_TEXT); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (records.get(i).getAdviceType().contains("software")) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (type.length() != 0) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        type.append("\\n"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    type.append(UserAdviceConstant.SOFTWARE_TYPE_TEXT); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                records.get(i).setAdviceType(type.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        result.setRecords(records); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        IPage<UserAdviceEntity> result = baseDao.selectPage(page,wrapper); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return null; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return getPageData(result, AdviceListResultDTO.class); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					} | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
					 | 
				
				 | 
				
					
  |