Commit 62d815b1 authored by 赵啸非's avatar 赵啸非

添加二维码下载压缩

parent 74b688da
...@@ -331,8 +331,6 @@ CREATE TABLE `mortals_sys_matter_channel` ( ...@@ -331,8 +331,6 @@ CREATE TABLE `mortals_sys_matter_channel` (
ALTER TABLE mortals_sys_matter ADD COLUMN `remark` varchar(512) COMMENT '备注信息'; ALTER TABLE mortals_sys_matter ADD COLUMN `remark` varchar(512) COMMENT '备注信息';
-- ---------------------------- -- ----------------------------
-- 社保配置表 -- 社保配置表
-- ---------------------------- -- ----------------------------
......
package com.mortals.xhx.base.framework.aspect; package com.mortals.xhx.base.framework.aspect;
import java.util.Date;
import javax.servlet.http.HttpServletRequest;
import com.mortals.framework.model.OperateLogPdu; import com.mortals.framework.model.OperateLogPdu;
import com.mortals.framework.service.ILogService;
import com.mortals.framework.service.impl.FileLogServiceImpl;
import com.mortals.xhx.base.system.oper.service.OperLogService;
import com.mortals.xhx.system.MessageProducer; import com.mortals.xhx.system.MessageProducer;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.checkerframework.checker.units.qual.A;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import com.mortals.framework.service.ILogService; import java.util.Date;
import com.mortals.framework.service.impl.FileLogServiceImpl;
import com.mortals.xhx.base.system.oper.service.OperLogService;
/** /**
* 操作日志记录 * 操作日志记录
......
...@@ -64,6 +64,9 @@ public class AuthUserInterceptor extends BaseInterceptor { ...@@ -64,6 +64,9 @@ public class AuthUserInterceptor extends BaseInterceptor {
String referer = request.getHeader("Referer"); String referer = request.getHeader("Referer");
RedisTemplate<String, String> redisTemplate = cacheService.selectDbRedisTemplate(portalDb); RedisTemplate<String, String> redisTemplate = cacheService.selectDbRedisTemplate(portalDb);
String trustedReferer =redisTemplate.opsForValue().get(RedisKey.KEY_REFERERS_CACHE); String trustedReferer =redisTemplate.opsForValue().get(RedisKey.KEY_REFERERS_CACHE);
if (!ObjectUtils.isEmpty(referer)) { if (!ObjectUtils.isEmpty(referer)) {
//校验host即可 //校验host即可
URI host = URLUtil.getHost(new URL(referer)); URI host = URLUtil.getHost(new URL(referer));
......
...@@ -137,4 +137,8 @@ public final class Constant { ...@@ -137,4 +137,8 @@ public final class Constant {
public final static String USER_SITE_TREE = "user:site:tree"; public final static String USER_SITE_TREE = "user:site:tree";
public final static String QR_CODE = "https://tftb.sczwfw.gov.cn:8085/jmopenpub/jmopen_files/unzip/708da07c16d8405bbaaa542d2c64e8f9/dzqyfwsxwbzqyvpty/html/matterDetails.html?";
} }
...@@ -4,13 +4,9 @@ import com.mortals.framework.service.ICacheService; ...@@ -4,13 +4,9 @@ import com.mortals.framework.service.ICacheService;
import com.mortals.framework.springcloud.service.IApplicationStartedService; import com.mortals.framework.springcloud.service.IApplicationStartedService;
import com.mortals.framework.util.ThreadPool; import com.mortals.framework.util.ThreadPool;
import com.mortals.xhx.base.system.user.service.UserService; import com.mortals.xhx.base.system.user.service.UserService;
import com.mortals.xhx.feign.user.IUserFeign;
import com.mortals.xhx.module.site.service.SiteService; import com.mortals.xhx.module.site.service.SiteService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import static com.mortals.xhx.common.key.Constant.USER_SITE_TREE; import static com.mortals.xhx.common.key.Constant.USER_SITE_TREE;
......
...@@ -13,7 +13,9 @@ import com.mortals.xhx.module.matter.model.vo.MatterCustomImportEntity; ...@@ -13,7 +13,9 @@ import com.mortals.xhx.module.matter.model.vo.MatterCustomImportEntity;
import com.mortals.xhx.module.matter.model.vo.MatterInfo; import com.mortals.xhx.module.matter.model.vo.MatterInfo;
import com.mortals.xhx.module.site.model.SiteEntity; import com.mortals.xhx.module.site.model.SiteEntity;
import com.mortals.xhx.module.site.model.SiteMatterEntity; import com.mortals.xhx.module.site.model.SiteMatterEntity;
import org.springframework.web.bind.annotation.RequestBody;
import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -94,4 +96,7 @@ public interface MatterService extends ICRUDService<MatterEntity, Long> { ...@@ -94,4 +96,7 @@ public interface MatterService extends ICRUDService<MatterEntity, Long> {
Rest<String> doImportCustomData(List<MatterCustomImportEntity> list, Context context); Rest<String> doImportCustomData(List<MatterCustomImportEntity> list, Context context);
Rest<byte[]> genQrCode(@RequestBody MatterQuery query) throws IOException;
} }
\ No newline at end of file
package com.mortals.xhx.module.matter.service.impl; package com.mortals.xhx.module.matter.service.impl;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.PageUtil; import cn.hutool.core.io.IoUtil;
import cn.hutool.core.util.RandomUtil; import cn.hutool.core.util.*;
import cn.hutool.core.util.ReflectUtil; import cn.hutool.extra.qrcode.QrCodeUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.setting.Setting; import cn.hutool.setting.Setting;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
...@@ -19,6 +18,7 @@ import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; ...@@ -19,6 +18,7 @@ import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.DataUtil; import com.mortals.framework.util.DataUtil;
import com.mortals.framework.util.ThreadPool; import com.mortals.framework.util.ThreadPool;
import com.mortals.xhx.base.framework.config.InterceptorConfig; import com.mortals.xhx.base.framework.config.InterceptorConfig;
import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.common.code.AppTypeEnum; import com.mortals.xhx.common.code.AppTypeEnum;
import com.mortals.xhx.common.code.FiletypeEnum; import com.mortals.xhx.common.code.FiletypeEnum;
import com.mortals.xhx.common.code.SourceEnum; import com.mortals.xhx.common.code.SourceEnum;
...@@ -58,6 +58,7 @@ import com.mortals.xhx.module.window.service.WindowMatterService; ...@@ -58,6 +58,7 @@ import com.mortals.xhx.module.window.service.WindowMatterService;
import io.netty.handler.timeout.ReadTimeoutException; import io.netty.handler.timeout.ReadTimeoutException;
import lombok.Getter; import lombok.Getter;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.jsoup.Jsoup; import org.jsoup.Jsoup;
...@@ -68,13 +69,19 @@ import org.springframework.beans.factory.annotation.Value; ...@@ -68,13 +69,19 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.net.ConnectException; import java.net.ConnectException;
import java.net.SocketTimeoutException; import java.net.SocketTimeoutException;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import static com.mortals.xhx.common.key.Constant.MAX_RETRY_COUNT; import static com.mortals.xhx.common.key.Constant.MAX_RETRY_COUNT;
import static com.mortals.xhx.common.key.Constant.QR_CODE;
/** /**
* MatterService * MatterService
...@@ -130,6 +137,8 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -130,6 +137,8 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
private AreaService areaService; private AreaService areaService;
@Autowired @Autowired
private MatterChannelService matterChannelService; private MatterChannelService matterChannelService;
@Autowired
private UploadService uploadService;
@Override @Override
...@@ -2170,12 +2179,10 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -2170,12 +2179,10 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
matterChannelService.save(matterChannelEntity); matterChannelService.save(matterChannelEntity);
SucessCount++; SucessCount++;
} else { } else {
log.info("事项已存在,更新事项:" + matterEntity.getMatterName()); log.info("事项已存在,更新事项:" + matterEntity.getMatterName());
BeanUtils.copyProperties(matterCustomImportEntity, matterEntity, new String[]{"id","areaCode", "deptName", "matterName"}); BeanUtils.copyProperties(matterCustomImportEntity, matterEntity, new String[]{"id", "areaCode", "deptName", "matterName"});
matterEntity.setUpdateTime(new Date()); matterEntity.setUpdateTime(new Date());
matterEntity.setUpdateUserId(1L); matterEntity.setUpdateUserId(1L);
...@@ -2186,14 +2193,14 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -2186,14 +2193,14 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
channelQuery.setMatterId(matterEntity.getId()); channelQuery.setMatterId(matterEntity.getId());
channelQuery.setAppType(0); channelQuery.setAppType(0);
List<MatterChannelEntity> matterChannelEntities = matterChannelService.find(channelQuery); List<MatterChannelEntity> matterChannelEntities = matterChannelService.find(channelQuery);
if(!ObjectUtils.isEmpty(matterChannelEntities)){ if (!ObjectUtils.isEmpty(matterChannelEntities)) {
MatterChannelEntity matterChannelEntity = matterChannelEntities.get(0); MatterChannelEntity matterChannelEntity = matterChannelEntities.get(0);
matterChannelEntity.setName(matterCustomImportEntity.getWebName()); matterChannelEntity.setName(matterCustomImportEntity.getWebName());
matterChannelEntity.setUrl(matterCustomImportEntity.getUrl()); matterChannelEntity.setUrl(matterCustomImportEntity.getUrl());
matterChannelEntity.setUpdateTime(new Date()); matterChannelEntity.setUpdateTime(new Date());
matterChannelEntity.setUpdateUserId(1L); matterChannelEntity.setUpdateUserId(1L);
matterChannelService.update(matterChannelEntity); matterChannelService.update(matterChannelEntity);
}else{ } else {
//新增渠道 //新增渠道
MatterChannelEntity matterChannelEntity = new MatterChannelEntity(); MatterChannelEntity matterChannelEntity = new MatterChannelEntity();
matterChannelEntity.initAttrValue(); matterChannelEntity.initAttrValue();
...@@ -2217,14 +2224,60 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -2217,14 +2224,60 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
return Rest.ok("成功:" + SucessCount + " 更新:" + updateCount + " 失败:" + failCount); return Rest.ok("成功:" + SucessCount + " 更新:" + updateCount + " 失败:" + failCount);
} }
/**
* @param query
* @return
*/
@Override
public Rest<byte[]> genQrCode(MatterQuery query) throws IOException {
public static void main(String[] args) { List<MatterEntity> matterEntities = new ArrayList<>();
MatterQuery matterQuery = new MatterQuery();
if (!ObjectUtils.isEmpty(query.getIdList())) {
//针对指定ids的 生成二维码 并压缩包
matterQuery.setIdList(query.getIdList());
}
if (!ObjectUtils.isEmpty(query.getAreaCode())) {
//针对指定ids的 生成二维码 并压缩包
matterQuery.setAreaCode(query.getAreaCode());
}
matterEntities = this.find(matterQuery);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
try (ZipOutputStream zipOutputStream = new ZipOutputStream(byteArrayOutputStream)) {
for (MatterEntity matterEntity : matterEntities) {
String qrCode = QR_CODE + "areaCode=" + matterEntity.getAreaCode() + "&matterId=" + matterEntity.getId();
String qrFileName = matterEntity.getAreaName() + "." + matterEntity.getMatterName()+".png";
// 生成二维码
BufferedImage qrCodeImage = QrCodeUtil.generate(qrCode, 300, 300);
// 将二维码写入 ByteArrayOutputStream
ByteArrayOutputStream imgOutputStream = new ByteArrayOutputStream();
ImageIO.write(qrCodeImage, "png", imgOutputStream);
// 将图片流转换为字节数组
byte[] qrBytes = imgOutputStream.toByteArray();
ZipEntry zipEntry = new ZipEntry(qrFileName);
zipOutputStream.putNextEntry(zipEntry);
zipOutputStream.write(qrBytes);
zipOutputStream.closeEntry();
}
}catch (Exception e){
return Rest.fail();
}
byte[] byteArray = byteArrayOutputStream.toByteArray();
// FileUtil.writeBytes(byteArray, "E:\\1.zip");
return Rest.ok(byteArray);
}
String sss = "实施主体性质:法定机关 是否进驻政务大厅:是 村居社区名称:无 权力来源:法定本级行使 村居社区代码:无 法定时限办结说明:自受理之日起,在法定期限内办结 行使层级:县级 到办事现场次数:0 网办类型:全程网办 实施主体:邛崃市司法局 是否网办:是 监督投诉方式:投诉电话:028-12345,028-88794281; 事项类型:公共服务 行使方式:依申请行使 承诺时限办结说明:自受理之日起,在承诺期限内办结 是否支持全省就近取件:否 是否支持预约办理:否 事项版本:16 联办机构:无 办件类型:即办件 通办范围:全省 是否支持上门收取申请材料:无 是否支持自助终端办理:否";
public static void main(String[] args) throws IOException {
/* String sss = "实施主体性质:法定机关 是否进驻政务大厅:是 村居社区名称:无 权力来源:法定本级行使 村居社区代码:无 法定时限办结说明:自受理之日起,在法定期限内办结 行使层级:县级 到办事现场次数:0 网办类型:全程网办 实施主体:邛崃市司法局 是否网办:是 监督投诉方式:投诉电话:028-12345,028-88794281; 事项类型:公共服务 行使方式:依申请行使 承诺时限办结说明:自受理之日起,在承诺期限内办结 是否支持全省就近取件:否 是否支持预约办理:否 事项版本:16 联办机构:无 办件类型:即办件 通办范围:全省 是否支持上门收取申请材料:无 是否支持自助终端办理:否";
String s = StrUtil.replaceChars(sss, ",", ","); String s = StrUtil.replaceChars(sss, ",", ",");
System.out.println(s); System.out.println(s);*/
/* /*
ArrayList<MatterEntity> matterEntities = new ArrayList<>(); ArrayList<MatterEntity> matterEntities = new ArrayList<>();
...@@ -2240,7 +2293,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -2240,7 +2293,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
*/ */
StringBuilder sb = new StringBuilder(); /* StringBuilder sb = new StringBuilder();
sb.append("问:小区经业主大会续聘(或选聘)物业服务企业的,物业服务合同备案对召开会议时间是否有要求? 答:有。根据《四川省业主大会和业主委员会指导规则》相关要求,业主委员会应当自提议确定之日起,将业主大会会议拟表决事项在物业管理区域内显著位置公示并告知相关的居民(村民)委员会,公示期不少于15日。\n" + sb.append("问:小区经业主大会续聘(或选聘)物业服务企业的,物业服务合同备案对召开会议时间是否有要求? 答:有。根据《四川省业主大会和业主委员会指导规则》相关要求,业主委员会应当自提议确定之日起,将业主大会会议拟表决事项在物业管理区域内显著位置公示并告知相关的居民(村民)委员会,公示期不少于15日。\n" +
"住宅专项维修资金交存-基本信息,是否支持全省就近办理 否是否支持物流快递 否业务办理项编码 11510821008501563R451201700100301认证等级需求 实名认证名称 操作承诺办结时限 1个工作日基本编码 512017001003计划生效日期 无法定办结时限 1个工作日实施主体编码 11510821008501563R网办地址 点击访问服务对象 自然人咨询方式 咨询电话:0825-5428572;事项状态 在用办理时间 星期一至星期五 上午:08:30-12:00 下午:14:00-17:30 备注:法定节假日除外;实施主体性质 受委托组织是否进驻政务大厅 是村居社区名称 无权力来源 上级下放村居社区代码 无法定时限办结说明 自受理之日起,在法定期限内办结行使层级 县级到办事现场次数 0住宅专项维修资金交存-基本信息,网办类型 全程网办实施主体 蓬溪县住房和城乡建设局是否网办 是监督投诉方式 投诉电话:0825-12345;事项类型 公共服务行使方式 依申请行使承诺时限办结说明 自受理之日起,在承诺期限内办结是否支持全省就近取件 否是否支持预约办理 否事项版本 19联办机构 无办件类型 即办件通办范围 无是否支持上门收取申请材料 否是否支持自助终端办理 否数量限制 无办理形式 窗口办理、网上办理乡镇街道名称 无是否支持网上支付 否委托部门 蓬溪县住房保障和房屋管理局乡镇街道代码 无是否收费 否网上办理深度 互联网咨询、互联网收件、互联网预审、互联网受理、互联网办理、互联网办理结果信息反馈实施编码 11510821008501563R4512017001003特别程序 必须到现场原因 无住宅专项维修资金交存-基本信息,办理地点 四川省-遂宁市-蓬溪县-蜀北中路街道-108号,详细地址:蓬溪县住房保障和房屋管理局三楼办公室;计划取消日期 无\n" + "住宅专项维修资金交存-基本信息,是否支持全省就近办理 否是否支持物流快递 否业务办理项编码 11510821008501563R451201700100301认证等级需求 实名认证名称 操作承诺办结时限 1个工作日基本编码 512017001003计划生效日期 无法定办结时限 1个工作日实施主体编码 11510821008501563R网办地址 点击访问服务对象 自然人咨询方式 咨询电话:0825-5428572;事项状态 在用办理时间 星期一至星期五 上午:08:30-12:00 下午:14:00-17:30 备注:法定节假日除外;实施主体性质 受委托组织是否进驻政务大厅 是村居社区名称 无权力来源 上级下放村居社区代码 无法定时限办结说明 自受理之日起,在法定期限内办结行使层级 县级到办事现场次数 0住宅专项维修资金交存-基本信息,网办类型 全程网办实施主体 蓬溪县住房和城乡建设局是否网办 是监督投诉方式 投诉电话:0825-12345;事项类型 公共服务行使方式 依申请行使承诺时限办结说明 自受理之日起,在承诺期限内办结是否支持全省就近取件 否是否支持预约办理 否事项版本 19联办机构 无办件类型 即办件通办范围 无是否支持上门收取申请材料 否是否支持自助终端办理 否数量限制 无办理形式 窗口办理、网上办理乡镇街道名称 无是否支持网上支付 否委托部门 蓬溪县住房保障和房屋管理局乡镇街道代码 无是否收费 否网上办理深度 互联网咨询、互联网收件、互联网预审、互联网受理、互联网办理、互联网办理结果信息反馈实施编码 11510821008501563R4512017001003特别程序 必须到现场原因 无住宅专项维修资金交存-基本信息,办理地点 四川省-遂宁市-蓬溪县-蜀北中路街道-108号,详细地址:蓬溪县住房保障和房屋管理局三楼办公室;计划取消日期 无\n" +
...@@ -2249,7 +2302,52 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter ...@@ -2249,7 +2302,52 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
"住宅专项维修资金交存-办理流程,转外时限 0个工作日sort 1办理流程 受理办理流程说明 1.申请:申请人到政务服务中心综合 窗口提交申请材料;2.受理:窗口工作人员收到申请材料当场或者规定工作日内作出受理或不予受理决定。材料不齐全或不符合法定形式的,办理机关应在规定工作日内一次性告知申请人需要补正的全部内容,对不属于受理范围的,出具不予受理通知书;3.审查:办理人员对申请人提交的材料进行审查,提出初步审查意见;4.决定:办理机关负责人依据审查意见签署审批结果。对予批准办理的,由办理机关向申请人核发办理结果,不予批准的,由办理机关书面通知申请人并说明理由,并告知申请人对结果有异议的,可依法申请行政复议或者提起行政诉讼;5.制证:制证部门完成制证;6.颁发和送达:申请人凭个人身份证明(有效的身份证、临时居住证、户口簿等)和受理通知书到申办窗口领取办理结果。办理时长 0个工作日转外时限 0个工作日sort 2办理流程 办结办理时长 0个工作日\n" + "住宅专项维修资金交存-办理流程,转外时限 0个工作日sort 1办理流程 受理办理流程说明 1.申请:申请人到政务服务中心综合 窗口提交申请材料;2.受理:窗口工作人员收到申请材料当场或者规定工作日内作出受理或不予受理决定。材料不齐全或不符合法定形式的,办理机关应在规定工作日内一次性告知申请人需要补正的全部内容,对不属于受理范围的,出具不予受理通知书;3.审查:办理人员对申请人提交的材料进行审查,提出初步审查意见;4.决定:办理机关负责人依据审查意见签署审批结果。对予批准办理的,由办理机关向申请人核发办理结果,不予批准的,由办理机关书面通知申请人并说明理由,并告知申请人对结果有异议的,可依法申请行政复议或者提起行政诉讼;5.制证:制证部门完成制证;6.颁发和送达:申请人凭个人身份证明(有效的身份证、临时居住证、户口簿等)和受理通知书到申办窗口领取办理结果。办理时长 0个工作日转外时限 0个工作日sort 2办理流程 办结办理时长 0个工作日\n" +
"住宅专项维修资金交存-收费标准,该事项无收费标准!\n" + "住宅专项维修资金交存-收费标准,该事项无收费标准!\n" +
"住宅专项维修资金交存-设定依据,法规类型 部门规章条例 第六条条款内容 下列物业的业主应当按照本办法的规定交存住宅专项维修资金: (一)住宅,但一个业主所有且与其他物业不具有共用部位、共用设施设备的除外; (二)住宅小区内的非住宅或者住宅小区外与单幢住宅结构相连的非住宅。 前款所列物业属于出售公有住房的,售房单位应当按照本办法的规定交存住宅专项维修资金。法律法规名称 住宅专项维修资金管理办法sort 1法规类型 地方法规条例 第六十九条条款内容 住宅物业和住宅区内的非住宅物业出售时,物业出售人和买受人应当按照国家和省的规定交存专项维修资金。法律法规名称 四川省物业管理条例sort 2"); "住宅专项维修资金交存-设定依据,法规类型 部门规章条例 第六条条款内容 下列物业的业主应当按照本办法的规定交存住宅专项维修资金: (一)住宅,但一个业主所有且与其他物业不具有共用部位、共用设施设备的除外; (二)住宅小区内的非住宅或者住宅小区外与单幢住宅结构相连的非住宅。 前款所列物业属于出售公有住房的,售房单位应当按照本办法的规定交存住宅专项维修资金。法律法规名称 住宅专项维修资金管理办法sort 1法规类型 地方法规条例 第六十九条条款内容 住宅物业和住宅区内的非住宅物业出售时,物业出售人和买受人应当按照国家和省的规定交存专项维修资金。法律法规名称 四川省物业管理条例sort 2");
System.out.println(sb.length()); System.out.println(sb.length());*/
/* String qrCode = QR_CODE ;
String qrFileName = "1.zip";
// 生成二维码
BufferedImage qrCodeImage = QrCodeUtil.generate(qrCode, 300, 300);
ByteArrayOutputStream zipOutputStream = new ByteArrayOutputStream();
ZipOutputStream zipOut = new ZipOutputStream(zipOutputStream);
// 将二维码写入 ByteArrayOutputStream
ByteArrayOutputStream imgOutputStream = new ByteArrayOutputStream();
ImageIO.write(qrCodeImage, "png", imgOutputStream);
// 将图片流转换为字节数组
byte[] qrBytes = imgOutputStream.toByteArray();
ZipEntry zipEntry = new ZipEntry(qrFileName + ".png");
zipOut.putNextEntry(zipEntry);
// IOUtils.write(qrBytes, zipOut);
zipOut.write(qrBytes);
zipOut.flush();
zipOut.closeEntry();
System.out.println(zipOutputStream.toByteArray().length);
FileUtil.writeBytes(zipOutputStream.toByteArray(),"E:\\1.zip");
FileUtil.writeBytes(qrBytes,"E:\\1.png");*/
String qrCode = QR_CODE;
BufferedImage qrCodeImage = QrCodeUtil.generate(qrCode, 300, 300);
ByteArrayOutputStream imgOutputStream = new ByteArrayOutputStream();
ImageIO.write(qrCodeImage, "png", imgOutputStream);
//byte[] data = "Hello ZIP".getBytes();
byte[] data = imgOutputStream.toByteArray();
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
try (ZipOutputStream zipOutputStream = new ZipOutputStream(byteArrayOutputStream)) {
ZipEntry zipEntry = new ZipEntry("1.png");
zipOutputStream.putNextEntry(zipEntry);
zipOutputStream.write(data);
zipOutputStream.closeEntry();
}
FileUtil.writeBytes(byteArrayOutputStream.toByteArray(), "E:\\1.zip");
} }
......
...@@ -340,8 +340,8 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe ...@@ -340,8 +340,8 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
baseAreaQuery.setAreaCode(areaCode); baseAreaQuery.setAreaCode(areaCode);
BaseAreaEntity baseAreaEntity = baseAreaService.selectOne(baseAreaQuery); BaseAreaEntity baseAreaEntity = baseAreaService.selectOne(baseAreaQuery);
if(ObjectUtils.isEmpty(baseAreaEntity)){ if (ObjectUtils.isEmpty(baseAreaEntity)) {
throw new AppException("区域编码不存在!"+areaCode); throw new AppException("区域编码不存在!" + areaCode);
} }
// String path = genFilePath + baseAreaEntity.getName() + ".txt"; // String path = genFilePath + baseAreaEntity.getName() + ".txt";
...@@ -401,4 +401,46 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe ...@@ -401,4 +401,46 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
return ret.toJSONString(); return ret.toJSONString();
} }
/**
* 生成二维码
*
* @author: zxfei
* @date: 2025/3/29 9:50
*/
@PostMapping(value = "genQrCode")
@UnAuth
public Rest<Object> genQrCode(@RequestBody MatterQuery query) {
Rest<Object> ret = new Rest<>();
Map<String, Object> model = new HashMap<>();
Context context = this.getContext();
String busiDesc = "生成二维码" + this.getModuleDesc();
int code = VALUE_RESULT_SUCCESS;
String fileName = "_qrcodes.zip";
try {
if (ObjectUtils.isEmpty(query.getAreaCode()) && ObjectUtils.isEmpty(query.getIdList())) {
throw new AppException("区域编码不能为空!");
}
if (!ObjectUtils.isEmpty(query.getAreaCode())) {
BaseAreaEntity baseAreaEntity = baseAreaService.selectOne(new BaseAreaQuery().areaCode(query.getAreaCode()));
if (ObjectUtils.isEmpty(baseAreaEntity)) {
throw new AppException("区域编码不存在!" + query.getAreaCode());
}
fileName = baseAreaEntity.getName() + fileName;
}
Rest<byte[]> rest = this.service.genQrCode(query);
this.responseStream(response, rest.getData(), fileName);
} catch (Exception e) {
code = VALUE_RESULT_FAILURE;
this.doException(request, busiDesc, model, e);
}
ret.setCode(code);
ret.setData(model);
ret.setMsg(model.get(MESSAGE_INFO) == null ? "" : model.remove(MESSAGE_INFO).toString());
return ret;
}
} }
\ No newline at end of file
...@@ -4,9 +4,6 @@ import com.mortals.framework.common.Rest; ...@@ -4,9 +4,6 @@ import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDCacheService; import com.mortals.framework.service.ICRUDCacheService;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.area.model.AreaEntity;
import com.mortals.xhx.module.area.model.AreaTreeSelect;
import com.mortals.xhx.module.matter.model.MatterEntity; import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.module.site.dao.SiteDao; import com.mortals.xhx.module.site.dao.SiteDao;
import com.mortals.xhx.module.site.model.SiteEntity; import com.mortals.xhx.module.site.model.SiteEntity;
...@@ -14,10 +11,8 @@ import com.mortals.xhx.module.site.model.SiteQuery; ...@@ -14,10 +11,8 @@ import com.mortals.xhx.module.site.model.SiteQuery;
import com.mortals.xhx.module.site.model.SiteTreeSelect; import com.mortals.xhx.module.site.model.SiteTreeSelect;
import com.mortals.xhx.module.site.model.vo.SiteAreaVo; import com.mortals.xhx.module.site.model.vo.SiteAreaVo;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
/** /**
* SiteService * SiteService
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment