Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
62d815b1
Commit
62d815b1
authored
Mar 31, 2025
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加二维码下载压缩
parent
74b688da
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
173 additions
and
45 deletions
+173
-45
base-manager/db/add.sql
base-manager/db/add.sql
+0
-2
base-manager/src/main/java/com/mortals/xhx/base/framework/aspect/OperlogAspect.java
.../com/mortals/xhx/base/framework/aspect/OperlogAspect.java
+4
-17
base-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/AuthUserInterceptor.java
...s/xhx/base/framework/interceptor/AuthUserInterceptor.java
+3
-0
base-manager/src/main/java/com/mortals/xhx/common/key/Constant.java
...er/src/main/java/com/mortals/xhx/common/key/Constant.java
+4
-0
base-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DemoStartedService.java
...als/xhx/daemon/applicationservice/DemoStartedService.java
+0
-4
base-manager/src/main/java/com/mortals/xhx/module/matter/service/MatterService.java
.../com/mortals/xhx/module/matter/service/MatterService.java
+5
-0
base-manager/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterServiceImpl.java
...als/xhx/module/matter/service/impl/MatterServiceImpl.java
+112
-14
base-manager/src/main/java/com/mortals/xhx/module/matter/web/MatterController.java
...a/com/mortals/xhx/module/matter/web/MatterController.java
+45
-3
base-manager/src/main/java/com/mortals/xhx/module/site/service/SiteService.java
...java/com/mortals/xhx/module/site/service/SiteService.java
+0
-5
No files found.
base-manager/db/add.sql
View file @
62d815b1
...
...
@@ -331,8 +331,6 @@ CREATE TABLE `mortals_sys_matter_channel` (
ALTER
TABLE
mortals_sys_matter
ADD
COLUMN
`remark`
varchar
(
512
)
COMMENT
'备注信息'
;
-- ----------------------------
-- 社保配置表
-- ----------------------------
...
...
base-manager/src/main/java/com/mortals/xhx/base/framework/aspect/OperlogAspect.java
View file @
62d815b1
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.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
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.stereotype.Component
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
com.mortals.framework.service.ILogService
;
import
com.mortals.framework.service.impl.FileLogServiceImpl
;
import
com.mortals.xhx.base.system.oper.service.OperLogService
;
import
java.util.Date
;
/**
* 操作日志记录
...
...
base-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/AuthUserInterceptor.java
View file @
62d815b1
...
...
@@ -64,6 +64,9 @@ public class AuthUserInterceptor extends BaseInterceptor {
String
referer
=
request
.
getHeader
(
"Referer"
);
RedisTemplate
<
String
,
String
>
redisTemplate
=
cacheService
.
selectDbRedisTemplate
(
portalDb
);
String
trustedReferer
=
redisTemplate
.
opsForValue
().
get
(
RedisKey
.
KEY_REFERERS_CACHE
);
if
(!
ObjectUtils
.
isEmpty
(
referer
))
{
//校验host即可
URI
host
=
URLUtil
.
getHost
(
new
URL
(
referer
));
...
...
base-manager/src/main/java/com/mortals/xhx/common/key/Constant.java
View file @
62d815b1
...
...
@@ -137,4 +137,8 @@ public final class Constant {
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?"
;
}
base-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DemoStartedService.java
View file @
62d815b1
...
...
@@ -4,13 +4,9 @@ import com.mortals.framework.service.ICacheService;
import
com.mortals.framework.springcloud.service.IApplicationStartedService
;
import
com.mortals.framework.util.ThreadPool
;
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
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.context.annotation.Lazy
;
import
org.springframework.stereotype.Component
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
Constant
.
USER_SITE_TREE
;
...
...
base-manager/src/main/java/com/mortals/xhx/module/matter/service/MatterService.java
View file @
62d815b1
...
...
@@ -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.site.model.SiteEntity
;
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.Map
;
...
...
@@ -94,4 +96,7 @@ public interface MatterService extends ICRUDService<MatterEntity, Long> {
Rest
<
String
>
doImportCustomData
(
List
<
MatterCustomImportEntity
>
list
,
Context
context
);
Rest
<
byte
[]>
genQrCode
(
@RequestBody
MatterQuery
query
)
throws
IOException
;
}
\ No newline at end of file
base-manager/src/main/java/com/mortals/xhx/module/matter/service/impl/MatterServiceImpl.java
View file @
62d815b1
package
com.mortals.xhx.module.matter.service.impl
;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.util.PageUtil
;
import
cn.hutool.core.util.RandomUtil
;
import
cn.hutool.core.util.ReflectUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.io.IoUtil
;
import
cn.hutool.core.util.*
;
import
cn.hutool.extra.qrcode.QrCodeUtil
;
import
cn.hutool.setting.Setting
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
...
...
@@ -19,6 +18,7 @@ import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import
com.mortals.framework.util.DataUtil
;
import
com.mortals.framework.util.ThreadPool
;
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.FiletypeEnum
;
import
com.mortals.xhx.common.code.SourceEnum
;
...
...
@@ -58,6 +58,7 @@ import com.mortals.xhx.module.window.service.WindowMatterService;
import
io.netty.handler.timeout.ReadTimeoutException
;
import
lombok.Getter
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.jsoup.Jsoup
;
...
...
@@ -68,13 +69,19 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
javax.imageio.ImageIO
;
import
java.awt.image.BufferedImage
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.net.ConnectException
;
import
java.net.SocketTimeoutException
;
import
java.util.*
;
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
.
QR_CODE
;
/**
* MatterService
...
...
@@ -130,6 +137,8 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
private
AreaService
areaService
;
@Autowired
private
MatterChannelService
matterChannelService
;
@Autowired
private
UploadService
uploadService
;
@Override
...
...
@@ -2170,12 +2179,10 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
matterChannelService
.
save
(
matterChannelEntity
);
SucessCount
++;
}
else
{
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
.
setUpdateUserId
(
1L
);
...
...
@@ -2186,14 +2193,14 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
channelQuery
.
setMatterId
(
matterEntity
.
getId
());
channelQuery
.
setAppType
(
0
);
List
<
MatterChannelEntity
>
matterChannelEntities
=
matterChannelService
.
find
(
channelQuery
);
if
(!
ObjectUtils
.
isEmpty
(
matterChannelEntities
))
{
if
(!
ObjectUtils
.
isEmpty
(
matterChannelEntities
))
{
MatterChannelEntity
matterChannelEntity
=
matterChannelEntities
.
get
(
0
);
matterChannelEntity
.
setName
(
matterCustomImportEntity
.
getWebName
());
matterChannelEntity
.
setUrl
(
matterCustomImportEntity
.
getUrl
());
matterChannelEntity
.
setUpdateTime
(
new
Date
());
matterChannelEntity
.
setUpdateUserId
(
1L
);
matterChannelService
.
update
(
matterChannelEntity
);
}
else
{
}
else
{
//新增渠道
MatterChannelEntity
matterChannelEntity
=
new
MatterChannelEntity
();
matterChannelEntity
.
initAttrValue
();
...
...
@@ -2217,14 +2224,60 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
return
Rest
.
ok
(
"成功:"
+
SucessCount
+
" 更新:"
+
updateCount
+
" 失败:"
+
failCount
);
}
/**
* @param query
* @return
*/
@Override
public
Rest
<
byte
[]>
genQrCode
(
MatterQuery
query
)
throws
IOException
{
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
);
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
throws
IOException
{
String
sss
=
"实施主体性质:法定机关 是否进驻政务大厅:是 村居社区名称:无 权力来源:法定本级行使 村居社区代码:无 法定时限办结说明:自受理之日起,在法定期限内办结 行使层级:县级 到办事现场次数:0 网办类型:全程网办 实施主体:邛崃市司法局 是否网办:是 监督投诉方式:投诉电话:028-12345,028-88794281; 事项类型:公共服务 行使方式:依申请行使 承诺时限办结说明:自受理之日起,在承诺期限内办结 是否支持全省就近取件:否 是否支持预约办理:否 事项版本:16 联办机构:无 办件类型:即办件 通办范围:全省 是否支持上门收取申请材料:无 是否支持自助终端办理:否"
;
/*
String sss = "实施主体性质:法定机关 是否进驻政务大厅:是 村居社区名称:无 权力来源:法定本级行使 村居社区代码:无 法定时限办结说明:自受理之日起,在法定期限内办结 行使层级:县级 到办事现场次数:0 网办类型:全程网办 实施主体:邛崃市司法局 是否网办:是 监督投诉方式:投诉电话:028-12345,028-88794281; 事项类型:公共服务 行使方式:依申请行使 承诺时限办结说明:自受理之日起,在承诺期限内办结 是否支持全省就近取件:否 是否支持预约办理:否 事项版本:16 联办机构:无 办件类型:即办件 通办范围:全省 是否支持上门收取申请材料:无 是否支持自助终端办理:否";
String s = StrUtil.replaceChars(sss, ",", ",");
System
.
out
.
println
(
s
);
System.out.println(s);
*/
/*
ArrayList<MatterEntity> matterEntities = new ArrayList<>();
...
...
@@ -2240,7 +2293,7 @@ public class MatterServiceImpl extends AbstractCRUDServiceImpl<MatterDao, Matter
*/
StringBuilder
sb
=
new
StringBuilder
();
/*
StringBuilder sb = new StringBuilder();
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" +
...
...
@@ -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" +
"住宅专项维修资金交存-收费标准,该事项无收费标准!\n" +
"住宅专项维修资金交存-设定依据,法规类型 部门规章条例 第六条条款内容 下列物业的业主应当按照本办法的规定交存住宅专项维修资金: (一)住宅,但一个业主所有且与其他物业不具有共用部位、共用设施设备的除外; (二)住宅小区内的非住宅或者住宅小区外与单幢住宅结构相连的非住宅。 前款所列物业属于出售公有住房的,售房单位应当按照本办法的规定交存住宅专项维修资金。法律法规名称 住宅专项维修资金管理办法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"
);
}
...
...
base-manager/src/main/java/com/mortals/xhx/module/matter/web/MatterController.java
View file @
62d815b1
...
...
@@ -340,11 +340,11 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
baseAreaQuery
.
setAreaCode
(
areaCode
);
BaseAreaEntity
baseAreaEntity
=
baseAreaService
.
selectOne
(
baseAreaQuery
);
if
(
ObjectUtils
.
isEmpty
(
baseAreaEntity
))
{
throw
new
AppException
(
"区域编码不存在!"
+
areaCode
);
if
(
ObjectUtils
.
isEmpty
(
baseAreaEntity
))
{
throw
new
AppException
(
"区域编码不存在!"
+
areaCode
);
}
// String path = genFilePath + baseAreaEntity.getName() + ".txt";
// String path = genFilePath + baseAreaEntity.getName() + ".txt";
boolean
setnx
=
cacheService
.
setnx
(
"genMatterTxt:"
+
areaCode
,
"1"
,
60
*
20
);
if
(!
setnx
)
{
...
...
@@ -401,4 +401,46 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
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
base-manager/src/main/java/com/mortals/xhx/module/site/service/SiteService.java
View file @
62d815b1
...
...
@@ -4,9 +4,6 @@ import com.mortals.framework.common.Rest;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
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.site.dao.SiteDao
;
import
com.mortals.xhx.module.site.model.SiteEntity
;
...
...
@@ -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.vo.SiteAreaVo
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* SiteService
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment