Browse Source

Merge branch 'dev-V1.10.0' into dev-V1.2

# Conflicts:
#	zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/impl/EfcodeCpNoticeServiceImpl.java
dev-V1.2
vincent 5 days ago
parent
commit
29839f71a5
  1. 1
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/app/enforcement/AppEnfCaseInfoController.java
  2. 78
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/impl/EfcodeCpNoticeServiceImpl.java
  3. 3
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/impl/MoveSupervisionServiceImpl.java
  4. 4
      zdxt-web-client/zdxt-admin-plus-ui/src/api/efcode/report/registration.ts
  5. 2
      zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/report/registration/indexList.vue
  6. 22
      zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementRecord.vue
  7. 3
      zdxt-web-client/zdxt-efcode-enterprise-app/src/api/enterprise/index.js
  8. 114
      zdxt-web-client/zdxt-efcode-enterprise-app/src/util/w6sMedia.js
  9. 1
      zdxt-web-client/zdxt-efcode-enterprise-app/src/views/enterprise/law/lawQuery.vue

1
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/app/enforcement/AppEnfCaseInfoController.java

@ -37,6 +37,7 @@ public class AppEnfCaseInfoController {
/**
* 查询【历史检查信息】列表
*/
@SaIgnore
@GetMapping("/oldQueryXzjcList")
public TableDataInfo<Xzjcjbxx025711> oldQueryXzjcList(Xzjcjbxx025711 xzjcjboxx,PageQuery pageQuery)
{

78
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/impl/EfcodeCpNoticeServiceImpl.java

@ -144,19 +144,19 @@ public class EfcodeCpNoticeServiceImpl implements IEfcodeCpNoticeService {
}
baseMapper.insert(entity);
// // 同步写入 notice_users 表
// syncNoticeUsers(entity.getId(), bo.getEnforceUserNames(), bo.getEnforceUserIds(), bo.getEnforceUserTels());
// // 发布时自动生成系统提示消息
// if (entity.getStatus() != null && entity.getStatus() == 1L) {
// // 调用站内信发送预告消息(发送前内部校验系统参数 sns.send)
// getSendYuGaoMsg(entity);
// }
//
// //同步更新企业电话
// UpdateWrapper<EnterpriseInformation> updateWrapper = new UpdateWrapper<>();
// updateWrapper.eq("enterprise_number",entity.getEnterpriseNumber());
// updateWrapper.set("enterprise_tel",entity.getContactPhone());
// enterpriseInformationMapper.update(updateWrapper);
// 同步写入 notice_users 表
syncNoticeUsers(entity.getId(), bo.getEnforceUserNames(), bo.getEnforceUserIds(), bo.getEnforceUserTels());
// 发布时自动生成系统提示消息
if (entity.getStatus() != null && entity.getStatus() == 1L) {
// 调用站内信发送预告消息(发送前内部校验系统参数 sns.send)
getSendYuGaoMsg(entity);
}
//同步更新企业电话
UpdateWrapper<EnterpriseInformation> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("enterprise_number",entity.getEnterpriseNumber());
updateWrapper.set("enterprise_tel",entity.getContactPhone());
enterpriseInformationMapper.update(updateWrapper);
return "操作成功";
}
@ -179,7 +179,7 @@ public class EfcodeCpNoticeServiceImpl implements IEfcodeCpNoticeService {
paramBo.setEnterpriseId(entity.getEnterpriseId());
paramBo.setEnterpriseName(entity.getEnterpriseName());
paramBo.setCreateByName(LoginHelper.getUsername());
paramBo.setDeptName(entity.getBureauDeptName());
paramBo.setDeptName(entity.getDeptName());
paramBo.setEnforceDate(entity.getEnforceDate());
siqService.sendYuGaoMsg(paramBo);
@ -208,38 +208,46 @@ public class EfcodeCpNoticeServiceImpl implements IEfcodeCpNoticeService {
};
String checkTime = entity.getEnforceDate() + (StringUtils.isBlank(enforceTimeText) ? "" : " " + enforceTimeText);
String content =
"【深圳政务短信平台】尊敬的" + entity.getContactPerson() + "(先生/女士),您好!您收到一则行政检查预告消息。信息内容如下:\n"
+ "企业名称:" + entity.getEnterpriseName() + "\n"
+ "执法单位:" + entity.getBureauDeptName() + "\n"
+ "检查时间:" + checkTime + "\n"
+ "如需了解预告详情,请登录深i企,进入“执法监督码”查看,感谢您的理解!";
"【深圳政务短信平台】尊敬的" + entity.getContactPerson() + "(先生/女士),您好!您收到一则行政检查预告消息。信息内容如下:"
+ "企业名称:" + entity.getEnterpriseName()
+ ";执法单位:" + entity.getBureauDeptName()
+ ";检查时间:" + checkTime
+ "。如需了解预告详情,请登录深i企,进入“执法监督码”查看,感谢您的理解!";
zwSmsClient.asyncSendSms(entity.getContactPhone(), content);
}
/**
* 修改预告(仅草稿可修改)
* 单条 UPDATE 原子完成"草稿校验+更新": 一次DB往返, 行锁仅覆盖单语句执行期, 消除先查后改的竞态窗口
* 修改预告(仅草稿可修改)并同步更新 notice_users 表
*/
@Override
@Transactional(rollbackFor = Exception.class)
public String updateNotice(EfcodeCpNoticeBo bo) {
// 校验:只有草稿(status=0)能修改
EfcodeCpNotice existing = baseMapper.selectById(bo.getId());
if (existing == null) {
return "预告不存在";
}
if (existing.getStatus() != null && existing.getStatus() != 0L) {
return "非草稿状态的预告不能修改";
}
EfcodeCpNotice update = MapstructUtils.convert(bo, EfcodeCpNotice.class);
// 如果此次操作是发布(status=1),设置发布时间
if (update.getStatus() != null && update.getStatus() == 1L) {
update.setPublishTime(new Date());
}
LambdaUpdateWrapper<EfcodeCpNotice> uw = Wrappers.lambdaUpdate();
uw.eq(EfcodeCpNotice::getId, bo.getId())
.eq(EfcodeCpNotice::getStatus, 0L)
.eq(EfcodeCpNotice::getIsDelete, 0L);
int rows = baseMapper.update(update, uw);
// 常态(更新成功)路径不再回查, 仅失败时区分原因
if (rows == 0) {
EfcodeCpNotice existing = baseMapper.selectById(bo.getId());
if (existing == null) {
return "预告不存在";
}
return "非草稿状态的预告不能修改";
baseMapper.updateById(update);
// 同步更新 notice_users 表(先删后插)
syncNoticeUsers(bo.getId(), bo.getEnforceUserNames(), bo.getEnforceUserIds(), bo.getEnforceUserTels());
// 发布时自动生成系统提示消息
if (update.getStatus() != null && update.getStatus() == 1L) {
generateSystemMessage(update);
}
//同步更新企业电话
UpdateWrapper<EnterpriseInformation> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("enterprise_number",bo.getEnterpriseNumber());
updateWrapper.set("enterprise_tel",bo.getContactPhone());
enterpriseInformationMapper.update(updateWrapper);
return "操作成功";
}
@ -342,6 +350,8 @@ public class EfcodeCpNoticeServiceImpl implements IEfcodeCpNoticeService {
lqw.like(StringUtils.isNotBlank(bo.getBureauDeptName()), EfcodeCpNotice::getBureauDeptName, bo.getBureauDeptName());
lqw.eq(StringUtils.isNotBlank(bo.getEnterpriseId()), EfcodeCpNotice::getEnterpriseId, bo.getEnterpriseId());
lqw.like(StringUtils.isNotBlank(bo.getEnterpriseName()), EfcodeCpNotice::getEnterpriseName, bo.getEnterpriseName());
lqw.eq(bo.getStatus() != null, EfcodeCpNotice::getStatus, bo.getStatus());
lqw.eq(bo.getIsDelete() != null, EfcodeCpNotice::getIsDelete, bo.getIsDelete());
//企业统一信用代码(为空时不作为查询条件)
lqw.eq(StringUtils.isNotBlank(bo.getEnterpriseNumber()), EfcodeCpNotice::getEnterpriseNumber, bo.getEnterpriseNumber());
lqw.eq(bo.getStatus() != null, EfcodeCpNotice::getStatus, bo.getStatus());
@ -387,8 +397,6 @@ public class EfcodeCpNoticeServiceImpl implements IEfcodeCpNoticeService {
lqw.apply("DATE_FORMAT(enforce_date, '%Y-%m') = {0}", bo.getDateSearch());
}
return lqw;
}

3
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/impl/MoveSupervisionServiceImpl.java

@ -69,8 +69,7 @@ public class MoveSupervisionServiceImpl implements IMoveSupervisionService {
if (xzzfCount == null || xzzfCount == 0) {
map.put("rqyjl",BigDecimal.ZERO);
} else {
map.put("rqyjl",BigDecimal.valueOf(xzzfCount - (lhzfsCount + ddbmzfCount))
.divide(BigDecimal.valueOf(xzzfCount), 4, RoundingMode.HALF_UP));
map.put("rqyjl",BigDecimal.valueOf(xzzfCount - (lhzfsCount + ddbmzfCount)));
}
// 执法力度

4
zdxt-web-client/zdxt-admin-plus-ui/src/api/efcode/report/registration.ts

@ -179,10 +179,10 @@ export interface UnionRow {
[key: string]: any;
}
/** 联合执法详情:/code/registration/unionList?unionNo=xxx */
/** 联合执法详情:/web/supervision/report/registration/unionList?unionNo=xxx */
export const listUnionList = (unionNo: string | number): AxiosPromise<UnionRow[]> => {
return request({
url: '/code/registration/unionList',
url: `${BASE_URL}/unionList`,
method: 'get',
params: { unionNo }
});

2
zdxt-web-client/zdxt-admin-plus-ui/src/views/efcode/report/registration/indexList.vue

@ -348,7 +348,7 @@ const handleUnionClick = async (row: any) => {
unionLoading.value = true;
try {
const res = await listUnionList(row.unionNo);
unionRows.value = (res as any)?.rows || (Array.isArray(res) ? res : []);
unionRows.value = (res as any)?.data || (Array.isArray(res) ? res : []);
} catch (e) {
unionRows.value = [];
} finally {

22
zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/enforce/enforcementRecord.vue

@ -48,13 +48,13 @@
</div>
<!-- Tab切换栏:执法维度 -->
<van-tabs v-model:active="overviewTab" color="#2563eb" title-active-color="#2563eb"
<van-tabs ref="overviewTabsRef" v-model:active="overviewTab" shrink color="#2563eb" title-active-color="#2563eb"
title-inactive-color="#666" swipeable animated line-width="20px" line-height="2px">
<van-tab title="执法力度"></van-tab>
<van-tab title="执法力量"></van-tab>
<!-- <van-tab title="执法力量"></van-tab>
<van-tab title="执法频次"></van-tab>
<van-tab title="执法效率"></van-tab>
<van-tab title="执法结果"></van-tab>
<van-tab title="执法结果"></van-tab> -->
</van-tabs>
<!-- 执法力度图表 -->
@ -155,7 +155,7 @@
<div class="section-title">预警态势</div>
<!-- 第一行:两列统计 -->
<div class="warning-grid">
<!-- <div class="warning-grid">
<div class="warning-item">
<div class="sv-value">{{ overviewData.fxxyyj ?? '-' }}<span class="sv-unit">条</span></div>
<div class="sv-label">风险信用预警</div>
@ -164,10 +164,10 @@
<div class="sv-value">{{ overviewData.gpjcyj ?? '-' }}<span class="sv-unit">条</span></div>
<div class="sv-label">高额检查预警</div>
</div>
</div>
</div> -->
<!-- 第二行:两列 + 中间竖线分隔 -->
<div class="warning-grid warning-grid-divider">
<!-- <div class="warning-grid warning-grid-divider">
<div class="warning-item">
<div class="sv-value">23<span class="sv-unit">人</span></div>
<div class="sv-label">异常人员</div>
@ -177,7 +177,7 @@
<div class="sv-value">10<span class="sv-unit">次</span></div>
<div class="sv-label">异常行为数</div>
</div>
</div>
</div> -->
<!-- Tab切换:各区域/各领域 -->
<van-tabs v-model:active="warningTab" color="#2563eb" title-active-color="#2563eb"
@ -225,6 +225,7 @@ const activeStep = ref(0);
const isNavFixed = ref(false);
const contentRef = ref(null);
const forceChartRef = ref(null);
const overviewTabsRef = ref(null);
let forceChartInstance = null;
// 接口数据
@ -385,6 +386,7 @@ onMounted(() => {
fetchOverview();
fetchWarningTables();
nextTick(() => {
overviewTabsRef.value?.resize?.();
if (overviewTab.value === 0) {
renderForceChart();
}
@ -426,7 +428,7 @@ const buildTrendTable = (list, nameKey) => {
rowMap.set(name, row);
rows.push(row);
}
rowMap.get(name).statusMap[`${item.year}Q${item.quarter}`] = mapGrade(item.zhpj);
rowMap.get(name).statusMap[`${item.year}Q${item.quarter}`] = item.zhpjDescription || mapGrade(item.zhpj);
});
return {
@ -452,6 +454,7 @@ const fetchOverview = () => {
};
updateForceChartData();
nextTick(() => {
overviewTabsRef.value?.resize?.();
if (overviewTab.value === 0) renderForceChart();
});
}
@ -1004,7 +1007,8 @@ const currentTableData = computed(() => warningTab.value === 0 ? areaTableData.v
background: #d1fae5;
}
&.wt-优良 {
&.wt-优良,
&.wt-优秀 {
color: #1d4ed8;
background: #dbeafe;
}

3
zdxt-web-client/zdxt-efcode-enterprise-app/src/api/enterprise/index.js

@ -90,6 +90,9 @@ export const getSystemConfigByKey = (configKey, params, success, error) => _get(
//法律法规列表(企业端)
export const queryLawListApi = (params, success, error) => _get(enterpriseAppBaseUrl + "/flfg/msg/list", params, success, error)
//法律法规详情(条款内容,企业端)
export const queryLawDetailApi = (params, success, error) => _get(enterpriseAppBaseUrl + "/flfg/detail/list", params, success, error)
//执法单位(部门)列表
export const getDeptList = (params, success, error) => _get("/enforcementcode/virtualUnit/list",params,success,error)

114
zdxt-web-client/zdxt-efcode-enterprise-app/src/util/w6sMedia.js

@ -151,9 +151,79 @@ const formatLocationText = (loc) => {
return [address, coords].filter(Boolean).join(' ')
}
// 拍照并加水印(w6s 原生接口 takePhotoAndAddWaterMark)
// 时间与定位由前端拼入 content,timeEnable/locationEnable 置 false,
// 跳过 SDK 内部再次调 getLocation(该调用易超时阻塞拍照流程)
// 去掉 file:// 前缀(w6s 的 toBase64 在 Android 下会自动补 file://,避免重复前缀导致解析失败)
const stripFileScheme = (p = '') => String(p).replace(/^file:\/\//, '')
// 水印图最长边上限(像素)。原图往往 4000+,整张重新编码是耗时主因,
// 限制到 2048 可大幅缩短耗时并减小上传体积;需要更高清可上调
const WATERMARK_MAX_SIZE = 2048
// 读取水印源图:优先用本地文件 URL(cdvfile:// 由 Cordova 拦截读取),无需把整张图转成 base64;
// 环境/路径不支持时回退到 SDK 的 toBase64
const loadWatermarkSource = async (filePath) => {
const toImg = (src) => new Promise((resolve, reject) => {
const el = document.createElement('img')
el.onload = () => resolve(el)
el.onerror = () => reject(new Error('水印源图片加载失败'))
el.src = src
})
const raw = stripFileScheme(filePath)
if (window.resolveLocalFileSystemURL) {
const fileUrl = /^(cdvfile|content):/i.test(String(filePath)) ? filePath : `file://${raw}`
try {
const entry = await new Promise((resolve, reject) => window.resolveLocalFileSystemURL(fileUrl, resolve, reject))
return await toImg(entry.toURL())
} catch (e) {
console.warn('[w6sMedia] 本地文件 URL 加载失败, 回退 toBase64:', e)
}
}
const evt = await w6s.image.toBase64({ filePath: raw })
return toImg(evt?.target?.result || evt?.result || evt)
}
// 前端给图片叠加水印(时间 + 定位),返回带水印图片的本地文件路径
// 说明:w6s.image.takePhotoAndAddWaterMark 实测不可用(原生加水印接口无有效返回),
// 改为拍照后用 canvas 在前端叠加水印;用 toBlob 直接落盘,省去 base64 编解码开销
const addWaterMark = async (filePath, fileName, text) => {
console.log('[w6sMedia] 开始叠加水印, 源图:', filePath, '水印内容:', text)
const img = await loadWatermarkSource(filePath)
// 按最长边等比缩放,避免整张原图重新编码(编码是耗时主因)
const srcW = img.naturalWidth || img.width
const srcH = img.naturalHeight || img.height
const scale = Math.min(1, WATERMARK_MAX_SIZE / Math.max(srcW, srcH))
const canvas = document.createElement('canvas')
canvas.width = Math.round(srcW * scale)
canvas.height = Math.round(srcH * scale)
const ctx = canvas.getContext('2d')
ctx.drawImage(img, 0, 0, canvas.width, canvas.height)
const fontSize = Math.max(16, Math.round(canvas.width * 0.035))
const pad = Math.round(fontSize * 0.6)
ctx.font = `${fontSize}px sans-serif`
ctx.textAlign = 'left'
ctx.textBaseline = 'bottom'
// 描边提升浅色背景下的可读性
ctx.lineWidth = Math.max(2, Math.round(fontSize * 0.12))
ctx.strokeStyle = 'rgba(0, 0, 0, 0.6)'
ctx.fillStyle = '#FF5858'
const x = pad
const y = canvas.height - pad
ctx.strokeText(text, x, y)
ctx.fillText(text, x, y)
// toBlob 直接产出二进制,避免 toDataURL 的 base64 编码
const blob = await new Promise((resolve, reject) => {
canvas.toBlob((b) => (b ? resolve(b) : reject(new Error('水印图片编码失败'))), 'image/jpeg', 0.9)
})
const out = await writeBlobToLocalFile(blob, fileName)
console.log('[w6sMedia] 水印叠加完成, 输出:', out, '大小:', blob.size)
return out
}
// 拍照并加水印(时间 + 定位由前端拼好后用 canvas 叠加)
// 注:w6s.image.takePhotoAndAddWaterMark 原生接口无有效返回(拍照后一直无数据),
// 因此改为 w6s.image.takePicture + 前端 canvas 叠加水印
export const takePhotoWithWaterMark = async () => {
await ensureW6sAuth()
console.log('[w6sMedia] 鉴权完成, 准备获取定位')
@ -173,24 +243,28 @@ export const takePhotoWithWaterMark = async () => {
const content = [getTimeStr(), locationText].filter(Boolean).join(' ')
console.log('[w6sMedia] 水印 content:', content, '准备调起拍照')
return new Promise((resolve, reject) => {
w6s.image.takePhotoAndAddWaterMark({
content,
fontSize: 14,
color: '#FF5858',
markDisable: false,
timeEnable: false, // 时间已拼入 content
locationEnable: false, // 定位已拼入 content,跳过 SDK 内部 getLocation
success: (res) => {
console.log('[w6sMedia] takePhotoAndAddWaterMark success 原始返回:', res)
resolve(res?.result || res || {})
},
fail: (err) => {
console.error('[w6sMedia] takePhotoAndAddWaterMark fail:', err)
reject(err)
},
// 1. 调起原生拍照,返回 { imageURL(压缩图本地路径), key(原图本地路径), imageInfo, mediaId }
const photo = await w6s.image.takePicture({ editable: false })
.then((res) => {
console.log('[w6sMedia] takePicture success 原始返回:', res)
const result = res?.result || res || {}
console.log('[w6sMedia] 拍照返回 imageURL:', result?.imageURL, 'key:', result?.key)
return result
})
})
.catch((err) => {
console.error('[w6sMedia] takePicture fail:', err)
throw err
})
// 2. 前端叠加水印,产出带水印的图片本地路径
const sourcePath = photo.imageURL || photo.key
if (!sourcePath) {
throw new Error('拍照未返回图片路径')
}
const imageURL = await addWaterMark(sourcePath, `wm-photo-${Date.now()}.jpg`, content)
// 3. 返回结构与原来一致(imageURL 为带水印图片的本地路径,可直接上传)
return { ...photo, imageURL }
}
// 录制视频(w6s 官方 API,文档 https://open.beeworks.cn/js-sdk/video.html)

1
zdxt-web-client/zdxt-efcode-enterprise-app/src/views/enterprise/law/lawQuery.vue

@ -162,6 +162,7 @@ const onLawClick = (item) => {
query: {
id: item.id,
title: item.title,
status: item.status,
publishDate: item.publishDate,
implementDate: item.implementDate,
department: item.department,

Loading…
Cancel
Save