|  |  | @ -35,6 +35,7 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.redis.common.bean.GridInfoCache; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.security.user.LoginUserUtil; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.ConvertUtils; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.DateUtils; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.ExcelUtils; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.Result; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.constant.SystemMessageType; | 
			
		
	
	
		
			
				
					|  |  | @ -69,12 +70,11 @@ import org.springframework.util.CollectionUtils; | 
			
		
	
		
			
				
					|  |  |  | import javax.servlet.http.HttpServletResponse; | 
			
		
	
		
			
				
					|  |  |  | import java.beans.Encoder; | 
			
		
	
		
			
				
					|  |  |  | import java.net.URLEncoder; | 
			
		
	
		
			
				
					|  |  |  | import java.util.ArrayList; | 
			
		
	
		
			
				
					|  |  |  | import java.util.HashMap; | 
			
		
	
		
			
				
					|  |  |  | import java.util.List; | 
			
		
	
		
			
				
					|  |  |  | import java.util.Map; | 
			
		
	
		
			
				
					|  |  |  | import java.util.*; | 
			
		
	
		
			
				
					|  |  |  | import java.util.stream.Collectors; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | import static com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | /** | 
			
		
	
		
			
				
					|  |  |  |  * 巡查例行工作 | 
			
		
	
		
			
				
					|  |  |  |  * | 
			
		
	
	
		
			
				
					|  |  | @ -204,17 +204,17 @@ public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl<PatrolRoutineW | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |     public void pcWorkListExport(PcWorkListFormDTO formDTO, HttpServletResponse response) throws Exception { | 
			
		
	
		
			
				
					|  |  |  |         String fileName = getFileName(formDTO); | 
			
		
	
		
			
				
					|  |  |  |         String name = getFileName(formDTO); | 
			
		
	
		
			
				
					|  |  |  |         ExcelWriter excelWriter = null; | 
			
		
	
		
			
				
					|  |  |  |         try { | 
			
		
	
		
			
				
					|  |  |  |             String name = URLEncoder.encode(fileName, "UTF-8"); | 
			
		
	
		
			
				
					|  |  |  |             response.setCharacterEncoding("UTF-8"); | 
			
		
	
		
			
				
					|  |  |  |             response.setHeader("Content-disposition", "attachment;"); | 
			
		
	
		
			
				
					|  |  |  |             response.setHeader("Access-Control-Expose-Headers", "Content-Disposition"); | 
			
		
	
		
			
				
					|  |  |  |             response.setHeader("Content-Type", "application/vnd.ms-excel"); | 
			
		
	
		
			
				
					|  |  |  |             response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(name, "UTF-8")); | 
			
		
	
		
			
				
					|  |  |  |             excelWriter = EasyExcel.write(ExcelUtils.getOutputStreamForExcel(name,response),PcWorkListExport.class).build(); | 
			
		
	
		
			
				
					|  |  |  |             // 如果同一个sheet只要创建一次
 | 
			
		
	
		
			
				
					|  |  |  |             WriteSheet writeSheet = EasyExcel.writerSheet(name).build(); | 
			
		
	
		
			
				
					|  |  |  |             Integer pageNo = NumConstant.ONE; | 
			
		
	
		
			
				
					|  |  |  |             Integer pageSize = NumConstant.ONE_HUNDRED; | 
			
		
	
		
			
				
					|  |  |  |             Integer pageSize = 1000; | 
			
		
	
		
			
				
					|  |  |  |             Integer num = NumConstant.ZERO; | 
			
		
	
		
			
				
					|  |  |  |             do { | 
			
		
	
		
			
				
					|  |  |  |                 formDTO.setPageNo(pageNo); | 
			
		
	
	
		
			
				
					|  |  | @ -250,16 +250,28 @@ public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl<PatrolRoutineW | 
			
		
	
		
			
				
					|  |  |  |           } | 
			
		
	
		
			
				
					|  |  |  |           name.append(agencyInfo.getOrganizationName()); | 
			
		
	
		
			
				
					|  |  |  |       } | 
			
		
	
		
			
				
					|  |  |  |       name.append("例行工作列表"); | 
			
		
	
		
			
				
					|  |  |  |       name.append(" 例行工作 "); | 
			
		
	
		
			
				
					|  |  |  |       if (StringUtils.isNotBlank(formDTO.getStartTime())){ | 
			
		
	
		
			
				
					|  |  |  |           name.append(formDTO.getStartTime()).append("-").append(formDTO.getEndTime()).append("区间新增值"); | 
			
		
	
		
			
				
					|  |  |  |           name.append(getDate(formDTO.getStartTime())) | 
			
		
	
		
			
				
					|  |  |  |                   .append("至").append(getDate(formDTO.getEndTime())).append("区间增长值"); | 
			
		
	
		
			
				
					|  |  |  |       }else { | 
			
		
	
		
			
				
					|  |  |  |           name.append(formDTO.getEndTime()).append("截止累计值"); | 
			
		
	
		
			
				
					|  |  |  |           name.append("截止至"); | 
			
		
	
		
			
				
					|  |  |  |           name.append(getDate(formDTO.getEndTime())); | 
			
		
	
		
			
				
					|  |  |  |           name.append("累计值"); | 
			
		
	
		
			
				
					|  |  |  |       } | 
			
		
	
		
			
				
					|  |  |  |       name.append(".xlsx"); | 
			
		
	
		
			
				
					|  |  |  |       return name.toString(); | 
			
		
	
		
			
				
					|  |  |  |     }; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     public static String getDate(String dateId){ | 
			
		
	
		
			
				
					|  |  |  |         StringBuilder sb = new StringBuilder(); | 
			
		
	
		
			
				
					|  |  |  |         sb.append(dateId.substring(0,4)).append(StrConstant.HYPHEN); | 
			
		
	
		
			
				
					|  |  |  |         sb.append(dateId.substring(4,6)).append(StrConstant.HYPHEN); | 
			
		
	
		
			
				
					|  |  |  |         sb.append(dateId.substring(6,8)); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         return sb.toString(); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |      * @Description  处理 workTypeName | 
			
		
	
		
			
				
					|  |  |  |      * @param workTypeList | 
			
		
	
	
		
			
				
					|  |  | @ -327,7 +339,7 @@ public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl<PatrolRoutineW | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     public static void main(String[] args) { | 
			
		
	
		
			
				
					|  |  |  |     /*public static void main(String[] args) { | 
			
		
	
		
			
				
					|  |  |  |         String str = "[{\"id\":\"01\",\"pid\":\"0\",\"children\":[{\"id\":\"0101\",\"pid\":\"01\",\"children\":[{\"id\":\"010101\",\"pid\":\"0101\",\"children\":[],\"name\":\"出租房屋巡查\"}],\"name\":\"出租房屋巡查\"},{\"id\":\"0102\",\"pid\":\"01\",\"children\":[],\"name\":\"重点场所巡查\"},{\"id\":\"0103\",\"pid\":\"01\",\"children\":[],\"name\":\"宗教活动\"},{\"id\":\"0199\",\"pid\":\"01\",\"children\":[],\"name\":\"其他\"}],\"name\":\"重点巡查\"},{\"id\":\"02\",\"pid\":\"0\",\"children\":[{\"id\":\"0201\",\"pid\":\"02\",\"children\":[],\"name\":\"刑满释放人员\"},{\"id\":\"0202\",\"pid\":\"02\",\"children\":[],\"name\":\"社区矫正\"},{\"id\":\"0203\",\"pid\":\"02\",\"children\":[],\"name\":\"吸毒人员\"},{\"id\":\"0204\",\"pid\":\"02\",\"children\":[],\"name\":\"信访人员\"},{\"id\":\"0205\",\"pid\":\"02\",\"children\":[],\"name\":\"重点青少年\"},{\"id\":\"0206\",\"pid\":\"02\",\"children\":[],\"name\":\"精神障碍者\"}],\"name\":\"特殊人群\"},{\"id\":\"09\",\"pid\":\"0\",\"children\":[{\"id\":\"0901\",\"pid\":\"09\",\"children\":[],\"name\":\"公共服务\"},{\"id\":\"0902\",\"pid\":\"09\",\"children\":[],\"name\":\"权益保障\"},{\"id\":\"0903\",\"pid\":\"09\",\"children\":[],\"name\":\"政策宣传\"},{\"id\":\"0904\",\"pid\":\"09\",\"children\":[],\"name\":\"便利服务\"},{\"id\":\"0999\",\"pid\":\"09\",\"children\":[],\"name\":\"其他\"}],\"name\":\"为民服务\"}]"; | 
			
		
	
		
			
				
					|  |  |  |         List<DictTreeResultDTO> dtos = JSON.parseArray(str, DictTreeResultDTO.class); | 
			
		
	
		
			
				
					|  |  |  |         Map<String, StringBuilder> result = new HashMap<>(); | 
			
		
	
	
		
			
				
					|  |  | @ -336,6 +348,6 @@ public class PatrolRoutineWorkServiceImpl extends BaseServiceImpl<PatrolRoutineW | 
			
		
	
		
			
				
					|  |  |  |         }); | 
			
		
	
		
			
				
					|  |  |  |         System.out.println(result.get("010101")); | 
			
		
	
		
			
				
					|  |  |  |         System.out.println(JSON.toJSONString(result)); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  |     }*/ | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  | } | 
			
		
	
	
		
			
				
					|  |  | 
 |