Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/mobile_community
| | |
| | | for (LargeKeyGridUserImport largeKeyGridUserImport : largeKeyGridUserImports) { |
| | | if (!StringUtils.hasLength(largeKeyGridUserImport.getGridInfo())){ |
| | | result.append("第"+i+"行:[", "网格"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeKeyGridUserImport.getCommunityName())){ |
| | | result.append("第"+i+"行:[", "小区名称"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeKeyGridUserImport.getBuildingInfo())){ |
| | | result.append("第"+i+"行:[", "楼栋信息"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeKeyGridUserImport.getUnitNumber())){ |
| | | result.append("第"+i+"行:[", "单元号"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeKeyGridUserImport.getHouseNumber())){ |
| | | result.append("第"+i+"行:[", "门牌号"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeKeyGridUserImport.getUserName())){ |
| | | result.append("第"+i+"行:[", "姓名"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeKeyGridUserImport.getUserSexStr())){ |
| | | result.append("第"+i+"行:[", "性别"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeKeyGridUserImport.getIdCard())){ |
| | | result.append("第"+i+"行:[", "身份证号"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (largeKeyGridUserImport.getIdCard().matches("^$|(^[1-9]\\\\d{7}((0\\\\d)|(1[0-2]))(([0-2]\\\\d)|3[0-1])\\\\d{3}$)|(^[1-9]\\\\d{5}[1-9]\\\\d{3}((0\\\\d)|(1[0-2]))(([0-2]\\\\d)|3[0-1])((\\\\d{4})|\\\\d{3}[Xx])$)")){ |
| | | if (!largeKeyGridUserImport.getIdCard().matches("^$|(^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$)|(^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])((\\d{4})|\\d{3}[Xx])$)")){ |
| | | result.append("第"+i+"行:[", "身份证号"+"]格式不正确"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeKeyGridUserImport.getContactNumber())){ |
| | | result.append("第"+i+"行:[", "联系电话"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (largeKeyGridUserImport.getContactNumber().matches("^1[3-9]\\\\d{9}$")){ |
| | | if (!largeKeyGridUserImport.getContactNumber().matches("^$|^1[3-9]\\d{9}$")){ |
| | | result.append("第"+i+"行:[", "联系电话"+"]格式不正确"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeKeyGridUserImport.getTypeName())){ |
| | | result.append("第"+i+"行:[", "类型名称"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | TLargeKeyGridUser largeKeyGridUser = new TLargeKeyGridUser(); |
| | |
| | | break; |
| | | default: |
| | | result.append("第"+i+"行:[", "性别"+"]格式错误"); |
| | | i++; |
| | | continue; |
| | | } |
| | | |
| | |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(largeKeyPersonnelType)){ |
| | | result.append("第"+i+"行:[", "类型名称"+"]不存在"); |
| | | i++; |
| | | continue; |
| | | } |
| | | largeKeyGridUser.setTypeId(largeKeyPersonnelType.getId()); |
| | |
| | | for (LargeKeyGridUserImport largeKeyGridUserImport : largeKeyGridUserImports) { |
| | | if (!StringUtils.hasLength(largeKeyGridUserImport.getGridInfo())){ |
| | | result.append("第"+i+"行:[", "网格"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeKeyGridUserImport.getCommunityName())){ |
| | | result.append("第"+i+"行:[", "小区名称"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeKeyGridUserImport.getBuildingInfo())){ |
| | | result.append("第"+i+"行:[", "楼栋信息"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeKeyGridUserImport.getUnitNumber())){ |
| | | result.append("第"+i+"行:[", "单元号"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeKeyGridUserImport.getHouseNumber())){ |
| | | result.append("第"+i+"行:[", "门牌号"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeKeyGridUserImport.getUserName())){ |
| | | result.append("第"+i+"行:[", "姓名"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeKeyGridUserImport.getUserSexStr())){ |
| | | result.append("第"+i+"行:[", "性别"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeKeyGridUserImport.getIdCard())){ |
| | | result.append("第"+i+"行:[", "身份证号"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (largeKeyGridUserImport.getIdCard().matches("^$|(^[1-9]\\\\d{7}((0\\\\d)|(1[0-2]))(([0-2]\\\\d)|3[0-1])\\\\d{3}$)|(^[1-9]\\\\d{5}[1-9]\\\\d{3}((0\\\\d)|(1[0-2]))(([0-2]\\\\d)|3[0-1])((\\\\d{4})|\\\\d{3}[Xx])$)")){ |
| | | if (!largeKeyGridUserImport.getIdCard().matches("^$|(^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$)|(^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])((\\d{4})|\\d{3}[Xx])$)")){ |
| | | result.append("第"+i+"行:[", "身份证号"+"]格式不正确"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeKeyGridUserImport.getContactNumber())){ |
| | | result.append("第"+i+"行:[", "联系电话"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (largeKeyGridUserImport.getContactNumber().matches("^1[3-9]\\\\d{9}$")){ |
| | | if (!largeKeyGridUserImport.getContactNumber().matches("^$|^1[3-9]\\d{9}$")){ |
| | | result.append("第"+i+"行:[", "联系电话"+"]格式不正确"); |
| | | i++; |
| | | continue; |
| | | } |
| | | TLargeKeyGridUser largeKeyGridUser = new TLargeKeyGridUser(); |
| | |
| | | break; |
| | | default: |
| | | result.append("第"+i+"行:[", "性别"+"]格式错误"); |
| | | i++; |
| | | continue; |
| | | } |
| | | |
| | |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(largeKeyPersonnelType)){ |
| | | result.append("第"+i+"行:[", "类型名称"+"]不存在"); |
| | | i++; |
| | | continue; |
| | | } |
| | | largeKeyGridUser.setTypeId(largeKeyPersonnelType.getId()); |
| | |
| | | for (LargeOrganizationImport largeOrganizationImport : largeOrganizationImports) { |
| | | if (!StringUtils.hasLength(largeOrganizationImport.getOrganizationName())){ |
| | | result.append("第"+i+"行:[", "组织名称"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeOrganizationImport.getOrganizationPerson())){ |
| | | result.append("第"+i+"行:[", "组织负责人"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeOrganizationImport.getAddress())){ |
| | | result.append("第"+i+"行:[", "地址"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeOrganizationImport.getContactNumber())){ |
| | | result.append("第"+i+"行:[", "联系电话"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (largeOrganizationImport.getContactNumber().matches("^1[3-9]\\\\d{9}$")){ |
| | | if (!largeOrganizationImport.getContactNumber().matches("^$|^1[3-9]\\d{9}$")){ |
| | | result.append("第"+i+"行:[", "联系电话"+"]格式不正确"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeOrganizationImport.getBusinessScope())){ |
| | | result.append("第"+i+"行:[", "业务范围"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | TLargeOrganization largeOrganization = new TLargeOrganization(); |
| | |
| | | for (LargeResourceImport largeResourceImport : largeResourceImports) { |
| | | if (!StringUtils.hasLength(largeResourceImport.getTypeParentName())){ |
| | | result.append("第"+i+"行:[", "一级类型名称"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeResourceImport.getTypeChildrenName())){ |
| | | result.append("第"+i+"行:[", "二级类型名称"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeResourceImport.getResourceUnit())){ |
| | | result.append("第"+i+"行:[", "资源单位"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeResourceImport.getResourceNameDesc())){ |
| | | result.append("第"+i+"行:[", "资源名称描述"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeResourceImport.getResourceSource())){ |
| | | result.append("第"+i+"行:[", "资源来源"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeResourceImport.getQuantityScale())){ |
| | | result.append("第"+i+"行:[", "数量规模"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeResourceImport.getContactPerson())){ |
| | | result.append("第"+i+"行:[", "联系人"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeResourceImport.getContactNumber())){ |
| | | result.append("第"+i+"行:[", "联系电话"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (largeResourceImport.getContactNumber().matches("^1[3-9]\\\\d{9}$")){ |
| | | if (!largeResourceImport.getContactNumber().matches("^$|^1[3-9]\\d{9}$")){ |
| | | result.append("第"+i+"行:[", "联系电话"+"]格式不正确"); |
| | | i++; |
| | | continue; |
| | | } |
| | | TLargeResource largeResource = new TLargeResource(); |
| | |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(parent)){ |
| | | result.append("第"+i+"行:[", "一级类型名称"+"]不存在"); |
| | | i++; |
| | | continue; |
| | | } |
| | | largeResource.setTypeParentId(parent.getId()); |
| | |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(children)){ |
| | | result.append("第"+i+"行:[", "二级类型名称"+"]不存在"); |
| | | i++; |
| | | continue; |
| | | } |
| | | largeResource.setTypeChildrenId(children.getId()); |
| | |
| | | import cn.afterturn.easypoi.excel.ExcelImportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ExportParams; |
| | | import cn.afterturn.easypoi.excel.entity.ImportParams; |
| | | import cn.afterturn.easypoi.excel.entity.TemplateExportParams; |
| | | import cn.hutool.core.io.resource.ClassPathResource; |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.annotation.Log; |
| | |
| | | import java.io.InputStream; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @ApiOperation(value = "社会工作者信息导入模板下载") |
| | | @GetMapping("/import-template") |
| | | public void importTemplate() { |
| | | List<LargeSocialWorkerImport> largeLargeSocialWorkerImports = new ArrayList<>(); |
| | | LargeSocialWorkerImport largeLargeSocialWorkerImport = new LargeSocialWorkerImport(); |
| | | largeLargeSocialWorkerImports.add(largeLargeSocialWorkerImport); |
| | | Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), LargeSocialWorkerImport.class, largeLargeSocialWorkerImports); |
| | | Map<String, Object> result = new HashMap<>(); |
| | | ClassPathResource classPathResource = new ClassPathResource("template/社会工作者导入模板.xlsx"); |
| | | TemplateExportParams params = new TemplateExportParams(classPathResource.getPath()); |
| | | Workbook workbook = ExcelExportUtil.exportExcel(params, result); |
| | | HttpServletResponse response = WebUtils.response(); |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | ServletOutputStream outputStream = null; |
| | | try { |
| | | String fileName = URLEncoder.encode("社会工作者信息导入模板.xls", "utf-8"); |
| | | String fileName = URLEncoder.encode("社会工作者信息导入模板.xlsx", "utf-8"); |
| | | response.setHeader("Content-Disposition", "attachment;filename=" + fileName); |
| | | response.setHeader("content-Type", "application/vnd.ms-excel"); |
| | | response.setHeader("Pragma", "no-cache"); |
| | |
| | | for (LargeSocialWorkerImport largeSocialWorkerImport : largeSocialWorkerImports) { |
| | | if (!StringUtils.hasLength(largeSocialWorkerImport.getUserName())){ |
| | | result.append("第"+i+"行:[", "姓名"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeSocialWorkerImport.getUserSexStr())){ |
| | | result.append("第"+i+"行:[", "性别"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeSocialWorkerImport.getBirthDateStr())){ |
| | | result.append("第"+i+"行:[", "出生日期"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeSocialWorkerImport.getEducationalLevel())){ |
| | | result.append("第"+i+"行:[", "文化程度"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeSocialWorkerImport.getPoliticalStatus())){ |
| | | result.append("第"+i+"行:[", "政治面貌"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeSocialWorkerImport.getContactNumber())){ |
| | | result.append("第"+i+"行:[", "联系电话"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (largeSocialWorkerImport.getContactNumber().matches("^1[3-9]\\\\d{9}$")){ |
| | | if (!largeSocialWorkerImport.getContactNumber().matches("^$|^1[3-9]\\d{9}$")){ |
| | | result.append("第"+i+"行:[", "联系电话"+"]格式不正确"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeSocialWorkerImport.getEmployerPosition())){ |
| | | result.append("第"+i+"行:[", "工作单位及职务"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeSocialWorkerImport.getQualificationLevelStr())){ |
| | | result.append("第"+i+"行:[", "职业资格等级"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | TLargeSocialWorker largeSocialWorker = new TLargeSocialWorker(); |
| | |
| | | break; |
| | | default: |
| | | result.append("第"+i+"行:[", "性别"+"]格式错误"); |
| | | i++; |
| | | continue; |
| | | } |
| | | |
| | |
| | | break; |
| | | default: |
| | | result.append("第"+i+"行:[", "职业资格等级"+"]格式错误"); |
| | | i++; |
| | | continue; |
| | | } |
| | | try{ |
| | | largeSocialWorker.setBirthDate(DateUtils.stringToLocalDate(largeSocialWorkerImport.getBirthDateStr())); |
| | | }catch (Exception e){ |
| | | result.append("第"+i+"行:[", "出生日期"+"]格式错误"); |
| | | i++; |
| | | continue; |
| | | } |
| | | largeSocialWorkers.add(largeSocialWorker); |
| | |
| | | for (LargeVolunteerImport largeVolunteerImport : largeVolunteerImports) { |
| | | if (!StringUtils.hasLength(largeVolunteerImport.getUserName())){ |
| | | result.append("第"+i+"行:[", "姓名"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeVolunteerImport.getUserSexStr())){ |
| | | result.append("第"+i+"行:[", "性别"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeVolunteerImport.getBirthDateStr())){ |
| | | result.append("第"+i+"行:[", "出生日期"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeVolunteerImport.getServiceArea())){ |
| | | result.append("第"+i+"行:[", "服务区域"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeVolunteerImport.getRegisterDateStr())){ |
| | | result.append("第"+i+"行:[", "注册日期"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (Objects.isNull(largeVolunteerImport.getTotalServiceDuration())){ |
| | | result.append("第"+i+"行:[", "总服务时长"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(largeVolunteerImport.getJoinTeamDateStr())){ |
| | | result.append("第"+i+"行:[", "加入队伍时间"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | TLargeVolunteer largeVolunteer = new TLargeVolunteer(); |
| | |
| | | break; |
| | | default: |
| | | result.append("第"+i+"行:[", "性别"+"]格式错误"); |
| | | i++; |
| | | continue; |
| | | } |
| | | try{ |
| | | largeVolunteer.setBirthDate(DateUtils.stringToLocalDate(largeVolunteerImport.getBirthDateStr())); |
| | | }catch (Exception e){ |
| | | result.append("第"+i+"行:[", "出生日期"+"]格式错误"); |
| | | i++; |
| | | continue; |
| | | } |
| | | try{ |
| | | largeVolunteer.setRegisterDate(DateUtils.stringToLocalDateTime(largeVolunteerImport.getRegisterDateStr())); |
| | | }catch (Exception e){ |
| | | result.append("第"+i+"行:[", "注册日期"+"]格式错误"); |
| | | i++; |
| | | continue; |
| | | } |
| | | try{ |
| | | largeVolunteer.setJoinTeamDate(DateUtils.stringToLocalDateTime(largeVolunteerImport.getJoinTeamDateStr())); |
| | | }catch (Exception e){ |
| | | result.append("第"+i+"行:[", "加入队伍时间"+"]格式错误"); |
| | | i++; |
| | | continue; |
| | | } |
| | | largeVolunteers.add(largeVolunteer); |
| | |
| | | for (MerchantImport merchantImport : merchantImports) { |
| | | if (!StringUtils.hasLength(merchantImport.getMerchantName())){ |
| | | result.append("第"+i+"行:[", "商户名称"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(merchantImport.getMerchantPhone())){ |
| | | result.append("第"+i+"行:[", "商户电话"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(merchantImport.getTypeName())){ |
| | | result.append("第"+i+"行:[", "商户分类"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(merchantImport.getAddress())){ |
| | | result.append("第"+i+"行:[", "商户地址"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | TMerchantType merchantType = merchantTypeService.getOne(Wrappers.lambdaQuery(TMerchantType.class) |
| | |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(merchantType)){ |
| | | result.append("第"+i+"行:[", "商户分类"+"]不存在"); |
| | | i++; |
| | | continue; |
| | | } |
| | | TMerchant merchant = new TMerchant(); |
| | |
| | | for (OldsterImport oldsterImport : assetHouseInspectionImports) { |
| | | if (!StringUtils.hasLength(oldsterImport.getOldsterName())){ |
| | | result.append("第"+i+"行:[", "老人姓名"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(oldsterImport.getOldsterSexStr())){ |
| | | result.append("第"+i+"行:[", "老人性别"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(oldsterImport.getContactPhone())){ |
| | | result.append("第"+i+"行:[", "联系方式"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(oldsterImport.getOldsterTypeStr())){ |
| | | result.append("第"+i+"行:[", "人员类型"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | if (!StringUtils.hasLength(oldsterImport.getAddress())){ |
| | | result.append("第"+i+"行:[", "居住地址"+"]不能为空"); |
| | | i++; |
| | | continue; |
| | | } |
| | | TOldster tOldster = new TOldster(); |
| | |
| | | tOldster.setBirthDate(localDate); |
| | | }catch (Exception e){ |
| | | result.append("第"+i+"行:[", "出生日期"+"]格式错误"); |
| | | i++; |
| | | continue; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.ruoyi.web.controller.tool; |
| | | |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | |
| | | public class IDCardValidatorWithEmpty { |
| | | // 定义支持空字符串的身份证号校验的正则表达式 |
| | | private static final String ID_CARD_REGEX = "^$|(^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$)|(^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])((\\d{4})|\\d{3}[Xx])$)"; |
| | | private static final String PHONE_REGEX = "^$|^1[3-9]\\d{9}$"; |
| | | private static final Pattern ID_CARD_PATTERN = Pattern.compile(ID_CARD_REGEX); |
| | | private static final Pattern PHONE_PATTERN = Pattern.compile(PHONE_REGEX); |
| | | |
| | | /** |
| | | * 校验身份证号的方法,允许空字符串 |
| | | * @param idCard 待校验的身份证号 |
| | | * @return 如果身份证号格式正确或者为空字符串返回 true,否则返回 false |
| | | */ |
| | | public static boolean isValidIDCard(String idCard) { |
| | | Matcher matcher = ID_CARD_PATTERN.matcher(idCard); |
| | | return matcher.matches(); |
| | | } |
| | | public static boolean isValidPhone(String phone) { |
| | | Matcher matcher = PHONE_PATTERN.matcher(phone); |
| | | return matcher.matches(); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | // 测试用的 15 位身份证号 |
| | | String idCard15 = "110105880620517"; |
| | | // 测试用的 18 位身份证号 |
| | | String idCard18 = "51370119990231853X"; |
| | | // 无效的身份证号 |
| | | String invalidIdCard = "123456789012345678"; |
| | | // 空字符串 |
| | | String emptyIdCard = ""; |
| | | String phone = "11212312312"; |
| | | |
| | | // 调用校验方法并输出结果 |
| | | System.out.println(idCard15 + " 是否为有效的身份证号: " + isValidIDCard(idCard15)); |
| | | System.out.println(idCard18 + " 是否为有效的身份证号: " + isValidIDCard(idCard18)); |
| | | System.out.println(invalidIdCard + " 是否为有效的身份证号: " + isValidIDCard(invalidIdCard)); |
| | | System.out.println("空字符串是否允许: " + isValidIDCard(emptyIdCard)); |
| | | System.out.println(phone + "是否为有效的手机号: " + isValidPhone(phone)); |
| | | } |
| | | } |
| | |
| | | # 开发环境配置 |
| | | server: |
| | | # 服务器的HTTP端口,默认为8080 |
| | | port: 8081 |
| | | port: 9908 |
| | | servlet: |
| | | # 应用的访问路径 |
| | | context-path: /laboratory/ |
| | | context-path: / |
| | | tomcat: |
| | | # tomcat的URI编码 |
| | | uri-encoding: UTF-8 |
| | |
| | | # 数据库索引 |
| | | database: 0 |
| | | # 密码 |
| | | password: 123456 |
| | | password: Yidongshequ@2025Redis! |
| | | # 连接超时时间 |
| | | timeout: 10s |
| | | lettuce: |
| | |
| | | druid: |
| | | # 主库数据源 |
| | | master: |
| | | url: jdbc:mysql://127.0.0.1:10633/laboratory?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true |
| | | url: jdbc:mysql://127.0.0.1:10633/mobile_community?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true |
| | | username: root |
| | | password: Laboratory@2025! |
| | | password: Yidongshequ@2025Mysql! |
| | | # 从库数据源 |
| | | slave: |
| | | # 从数据源开关/默认关闭 |
| | |
| | | allowExt: .jpg|.png|.gif|.jpeg|.doc|.docx|.apk|.MP4|.mp4|.pdf|.PDF|.xls|.xlsx|.rar|.zip|.rar|.ppt|.PPT|.pptx|.CAJ|.caj|.bmp |
| | | wx: |
| | | conf: |
| | | appId: |
| | | secretId: |
| | | appId: wx618aa69186bf2ed6 |
| | | secretId: d4af107e0b11236c1db24c1453f28bb3 |
| | | payment: |
| | | wx: |
| | | # 微信appid |
| | | appId: wx618aa69186bf2ed6 |
| | | # 微信商户号 |
| | | mchId: 1733623796 |
| | | # 秘钥 |
| | | secretId: d4af107e0b11236c1db24c1453f28bb3 |
| | | v3: |
| | | # 加签串 |
| | | apiKey: GZPkka0vgfzjhgAKg6E2PxKkKOKkC24c |
| | | # 加签证书地址 |
| | | privateKeyPath: /usr/local/project/cert/apiclient_key.pem |
| | | # 微信支付公钥id |
| | | publicKeyId: PUB_KEY_ID_0117336237962025120100192279000801 |
| | | # 微信支付公钥证书 |
| | | publicKeyPath: /usr/local/project/cert/pub_key.pem |
| | | # 证书序列号 |
| | | mchSerialNo: 5ED4C99FE5657DA2579BE5E7AE4255C9468627D9 |
| | | # 支付成功回调地址 |
| | | notifyPayUrl: https://rhljsq.pzhsoar.com/applet/wx/pay/notify |
| | | # 支付退款回调地址 |
| | | notifyRefundUrl: https://rhljsq.pzhsoar.com/applet/wx/refund/notify |
| | |
| | | allowExt: .jpg|.png|.gif|.jpeg|.doc|.docx|.apk|.MP4|.mp4|.pdf|.PDF|.xls|.xlsx|.rar|.zip|.rar |
| | | wx: |
| | | conf: |
| | | appId: |
| | | secretId: |
| | | appId: wx618aa69186bf2ed6 |
| | | secretId: d4af107e0b11236c1db24c1453f28bb3 |
| | | payment: |
| | | wx: |
| | | # 微信appid |
| | | appId: |
| | | appId: wx618aa69186bf2ed6 |
| | | # 微信商户号 |
| | | mchId: |
| | | mchId: 1733623796 |
| | | # 秘钥 |
| | | secretId: |
| | | secretId: d4af107e0b11236c1db24c1453f28bb3 |
| | | v3: |
| | | # 加签串 |
| | | apiKey: |
| | | apiKey: GZPkka0vgfzjhgAKg6E2PxKkKOKkC24c |
| | | # 加签证书地址 |
| | | privateKeyPath: |
| | | privateKeyPath: E:\qiyeweixin\WXWork\1688857859704927\Cache\File\2025-12\1733623796_20251202_cert\apiclient_key.pem |
| | | # 微信支付公钥id |
| | | publicKeyId: |
| | | publicKeyId: PUB_KEY_ID_0117336237962025120100192279000801 |
| | | # 微信支付公钥证书 |
| | | publicKeyPath: |
| | | publicKeyPath: E:\qiyeweixin\WXWork\1688857859704927\Cache\File\2025-12\pub_key.pem |
| | | # 证书序列号 |
| | | mchSerialNo: |
| | | mchSerialNo: 5ED4C99FE5657DA2579BE5E7AE4255C9468627D9 |
| | | # 支付成功回调地址 |
| | | notifyPayUrl: |
| | | notifyPayUrl: http://221.182.45.100:9100/wx/pay/notify |
| | | # 支付退款回调地址 |
| | | notifyRefundUrl: |
| | | notifyRefundUrl: http://221.182.45.100:9100/wx/refund/notify |
| | |
| | | # 项目相关配置 |
| | | spring: |
| | | profiles: |
| | | active: test |
| | | active: prod |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.time.LocalDateTime; |
| | |
| | | private final TDeliberationVoteService tDeliberationVoteService; |
| | | private final TDeliberationVoteOptionService tDeliberationVoteOptionService; |
| | | private final TAppealServicesService tAppealServicesService; |
| | | private final TAppUserService appUserService; |
| | | |
| | | public ConvenienceController(THtmlConfigService tHtmlConfigService, TServiceGuideFileService tServiceGuideFileService, TConvenientInformationService tConvenientInformationService, TMicroWishService tMicroWishService, TokenService tokenService, TCommunityActivityService tCommunityActivityService, TCommunityActivityRegistrationService tCommunityActivityRegistrationService, TDeliberationVoteService tDeliberationVoteService, TDeliberationVoteOptionService tDeliberationVoteOptionService, TAppealServicesService tAppealServicesService) { |
| | | public ConvenienceController(THtmlConfigService tHtmlConfigService, TServiceGuideFileService tServiceGuideFileService, TConvenientInformationService tConvenientInformationService, TMicroWishService tMicroWishService, TokenService tokenService, TCommunityActivityService tCommunityActivityService, TCommunityActivityRegistrationService tCommunityActivityRegistrationService, TDeliberationVoteService tDeliberationVoteService, TDeliberationVoteOptionService tDeliberationVoteOptionService, TAppealServicesService tAppealServicesService, TAppUserService appUserService) { |
| | | this.tHtmlConfigService = tHtmlConfigService; |
| | | this.tServiceGuideFileService = tServiceGuideFileService; |
| | | this.tConvenientInformationService = tConvenientInformationService; |
| | |
| | | this.tDeliberationVoteService = tDeliberationVoteService; |
| | | this.tDeliberationVoteOptionService = tDeliberationVoteOptionService; |
| | | this.tAppealServicesService = tAppealServicesService; |
| | | this.appUserService = appUserService; |
| | | } |
| | | |
| | | |
| | |
| | | public R<Page<TMicroWish>> getMicroWishList(@RequestBody MicroWishListQuery query) { |
| | | Page<TMicroWish> page = new Page<>(query.getPageNum(), query.getPageSize()); |
| | | Page<TMicroWish> tMicroWishPage = tMicroWishService.page(page, new LambdaQueryWrapper<TMicroWish>().eq(TMicroWish::getWishType, 1).eq(TMicroWish::getStatus, 2).like(Objects.nonNull(query.getWishDescription()), TMicroWish::getWishDescription, query.getWishDescription()).orderByDesc(BaseModel::getCreateTime)); |
| | | List<TMicroWish> records = tMicroWishPage.getRecords(); |
| | | List<String> appUserIds = records.stream().map(TMicroWish::getAppUserId).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(appUserIds)){ |
| | | List<TAppUser> appUsers = appUserService.list(Wrappers.lambdaQuery(TAppUser.class) |
| | | .in(TAppUser::getId, appUserIds)); |
| | | for (TMicroWish microWish : records) { |
| | | List<TAppUser> appUserList = appUsers.stream().filter(appUser -> microWish.getAppUserId().equals(appUser.getId())).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(appUserList)){ |
| | | microWish.setUserName(appUserList.get(0).getNickName()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | return R.ok(tMicroWishPage); |
| | | } |
| | | |
| | |
| | | # 开发环境配置 |
| | | server: |
| | | # 服务器的HTTP端口,默认为8080 |
| | | port: 8082 |
| | | port: 9909 |
| | | servlet: |
| | | # 应用的访问路径 |
| | | context-path: / |
| | |
| | | # password: 123456 |
| | | host: 127.0.0.1 |
| | | # 端口,默认为6379 |
| | | port: 16379 |
| | | port: 6379 |
| | | # 数据库索引 |
| | | database: 0 |
| | | # 密码 |
| | | password: 8f5z9g52gx4bg |
| | | password: Yidongshequ@2025Redis! |
| | | # 连接超时时间 |
| | | timeout: 10s |
| | | lettuce: |
| | |
| | | druid: |
| | | # 主库数据源 |
| | | master: |
| | | url: jdbc:mysql://172.27.0.13:3306/xizang?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai |
| | | username: xzgt |
| | | password: changyun!6f2gshj6h3j |
| | | url: jdbc:mysql://127.0.0.1:10633/mobile_community?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true |
| | | username: root |
| | | password: Yidongshequ@2025Mysql! |
| | | # 从库数据源 |
| | | slave: |
| | | # 从数据源开关/默认关闭 |
| | |
| | | prefix: https://xzgt.test.591taxi.cn:${server.port}${server.servlet.context-path} |
| | | wx: |
| | | conf: |
| | | appId: wxe91f1af7638aa5dd |
| | | secretId: a787e1a462715604e0c9528b6d8960d1 |
| | | #OSS及短信配置 |
| | | code: |
| | | config: |
| | | templateCodeTest: "SMS_154950909" |
| | | signNameTest: "阿里云短信测试" |
| | | accessKeyId: LTAI5tAdba8HtT1C6UqtSxBt |
| | | accessKeySecret: 0SRb6XGkciQDPWn2rYqbJtq2qRMDY8 |
| | | signName: "四川金达通信工程" |
| | | templateCode: "SMS_293985284" |
| | | cos: |
| | | client: |
| | | accessKey: AKIDCF5EF2c0DE1e5JK8r4EGJF4mNsMgp26x |
| | | secretKey: lLl184rUyFOOE0d5KNGC3kmfNsCWk4GU |
| | | bucket: xzgttest-1305134071 |
| | | bucketAddr: ap-chengdu |
| | | rootSrc: https://xzgttest-1305134071.cos.ap-chengdu.myqcloud.com/ |
| | | location: xizang |
| | | sms: |
| | | enable: true |
| | | appId: 1400957506 |
| | | secretid: AKIDCF5EF2c0DE1e5JK8r4EGJF4mNsMgp26x |
| | | secretkey: lLl184rUyFOOE0d5KNGC3kmfNsCWk4GU |
| | | sign: 畅云出行 |
| | | appId: wx618aa69186bf2ed6 |
| | | secretId: d4af107e0b11236c1db24c1453f28bb3 |
| | | payment: |
| | | wx: |
| | | # 微信appid |
| | | appId: wx618aa69186bf2ed6 |
| | | # 微信商户号 |
| | | mchId: 1733623796 |
| | | # 秘钥 |
| | | secretId: d4af107e0b11236c1db24c1453f28bb3 |
| | | v3: |
| | | # 加签串 |
| | | apiKey: GZPkka0vgfzjhgAKg6E2PxKkKOKkC24c |
| | | # 加签证书地址 |
| | | privateKeyPath: /usr/local/project/cert/apiclient_key.pem |
| | | # 微信支付公钥id |
| | | publicKeyId: PUB_KEY_ID_0117336237962025120100192279000801 |
| | | # 微信支付公钥证书 |
| | | publicKeyPath: /usr/local/project/cert/pub_key.pem |
| | | # 证书序列号 |
| | | mchSerialNo: 5ED4C99FE5657DA2579BE5E7AE4255C9468627D9 |
| | | # 支付成功回调地址 |
| | | notifyPayUrl: https://rhljsq.pzhsoar.com/applet/wx/pay/notify |
| | | # 支付退款回调地址 |
| | | notifyRefundUrl: https://rhljsq.pzhsoar.com/applet/wx/refund/notify |
| | |
| | | # 项目相关配置 |
| | | spring: |
| | | profiles: |
| | | active: test |
| | | active: prod |
| | |
| | | } |
| | | String TimeDir =new SimpleDateFormat("yyyy-MM-dd").format(new Date()); |
| | | // String realPath = fileUploadConfig.getLocation() + TimeDir; |
| | | String realPath = "F:\\file\\mobile\\" + TimeDir; |
| | | String realPath = "/user/local/project/file/" + TimeDir; |
| | | File file = new File(realPath); |
| | | // 没有目录就创建 |
| | | if (!file.exists()) { |
| | |
| | | |
| | | @Excel(name = "性别[男|女]", width = 20) |
| | | private String userSexStr; |
| | | |
| | | private Integer userSex; |
| | | |
| | | @Excel(name = "出生日期[yyyy-mm-dd]", width = 20) |
| | | private String birthDateStr; |
| | | |
| | | private LocalDate birthDate; |
| | | |
| | | @Excel(name = "文化程度", width = 20) |
| | |
| | | @Excel(name = "工作单位及职务", width = 20) |
| | | private String employerPosition; |
| | | |
| | | @Excel(name = "职业资格等级[助理社会工作师(初级)|社会工作师(中级)|高级社会工作师(高级)]", width = 20) |
| | | @Excel(name = "职业资格等级[助理社会工作师(初级)|社会工作师(中级)|高级社会工作师(高级)]", width = 40) |
| | | private String qualificationLevelStr; |
| | | |
| | | private Integer qualificationLevel; |
| | | |
| | | } |
| | |
| | | @TableField("user_sex") |
| | | private Integer userSex; |
| | | |
| | | // @Pattern(regexp = "^$|(^[1-9]\\\\d{7}((0\\\\d)|(1[0-2]))(([0-2]\\\\d)|3[0-1])\\\\d{3}$)|(^[1-9]\\\\d{5}[1-9]\\\\d{3}((0\\\\d)|(1[0-2]))(([0-2]\\\\d)|3[0-1])((\\\\d{4})|\\\\d{3}[Xx])$)",message = "身份证号格式不正确") |
| | | @Pattern(regexp = "^$|(^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$)|(^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])((\\d{4})|\\d{3}[Xx])$)",message = "身份证号格式不正确") |
| | | @ApiModelProperty(value = "身份证号") |
| | | @TableField("id_card") |
| | | private String idCard; |
| | | |
| | | // @Pattern(regexp = "^1[3-9]\\\\d{9}$",message = "手机号格式不正确") |
| | | @Pattern(regexp = "^$|^1[3-9]\\d{9}$",message = "手机号格式不正确") |
| | | @ApiModelProperty(value = "联系电话") |
| | | @TableField("contact_number") |
| | | private String contactNumber; |
| | |
| | | @TableField("address") |
| | | private String address; |
| | | |
| | | // @Pattern(regexp = "^1[3-9]\\\\d{9}$",message = "手机号格式不正确") |
| | | @Pattern(regexp = "^$|^1[3-9]\\d{9}$",message = "手机号格式不正确") |
| | | @ApiModelProperty(value = "联系电话") |
| | | @TableField("contact_number") |
| | | private String contactNumber; |
| | |
| | | @TableField("contact_person") |
| | | private String contactPerson; |
| | | |
| | | // @Pattern(regexp = "^1[3-9]\\\\d{9}$",message = "手机号格式不正确") |
| | | @Pattern(regexp = "^$|^1[3-9]\\d{9}$",message = "手机号格式不正确") |
| | | @ApiModelProperty(value = "联系电话") |
| | | @TableField("contact_number") |
| | | private String contactNumber; |
| | |
| | | @TableField("political_status") |
| | | private String politicalStatus; |
| | | |
| | | // @Pattern(regexp = "^1[3-9]\\\\d{9}$",message = "手机号格式不正确") |
| | | @Pattern(regexp = "^$|^1[3-9]\\d{9}$",message = "手机号格式不正确") |
| | | @ApiModelProperty(value = "联系电话") |
| | | @TableField("contact_number") |
| | | private String contactNumber; |
| | |
| | | @TableField("user_name") |
| | | private String userName; |
| | | |
| | | // @Pattern(regexp = "^1[3-9]\\\\d{9}$",message = "手机号格式不正确") |
| | | @Pattern(regexp = "^$|^1[3-9]\\d{9}$",message = "手机号格式不正确") |
| | | @ApiModelProperty(value = "手机号") |
| | | @TableField("user_phone") |
| | | private String userPhone; |
| | |
| | | @TableField("process_time") |
| | | private LocalDateTime processTime; |
| | | |
| | | @ApiModelProperty(value = "用户姓名") |
| | | @TableField("user_name") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value = "身份证号") |
| | | @TableField("id_card") |
| | | private String idCard; |
| | | |
| | | @ApiModelProperty(value = "头像") |
| | | @TableField(exist = false) |
| | | private String avatar; |
| | | |
| | | } |
| | |
| | | <result column="process_result" property="processResult" /> |
| | | <result column="process_pictures" property="processPictures" /> |
| | | <result column="process_time" property="processTime" /> |
| | | <result column="user_name" property="userName" /> |
| | | <result column="id_card" property="idCard" /> |
| | | <result column="create_time" property="createTime" /> |
| | | <result column="update_time" property="updateTime" /> |
| | | <result column="create_by" property="createBy" /> |
| | |
| | | <!-- 通用查询结果列 --> |
| | | <sql id="Base_Column_List"> |
| | | id, app_user_id, wish_type, wish_description, pictures, contact_person, contact_phone, address, status, audit_remark, |
| | | process_result, process_pictures, process_time, create_time, update_time, create_by, update_by, disabled |
| | | process_result, process_pictures, process_time,user_name, id_card, create_time, update_time, create_by, update_by, disabled |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.system.vo.TMicroWishVO"> |
| | | select |