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
...@@ -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