Browse Source

计划bug处理

dev-v1.0.2
庄锐波 4 months ago
parent
commit
1f99949d8c
  1. 6
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/impl/EfcodeCpNoticeMessageServiceImpl.java
  2. 30
      zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/my/notice/cp_notice_list.vue
  3. 124
      zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/my/notice/cp_notice_tab_content.vue
  4. 2
      zdxt-web-server/zdxt-admin-web-server/src/main/java/org/dromara/web/service/impl/PasswordAuthStrategy.java

6
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/impl/EfcodeCpNoticeMessageServiceImpl.java

@ -160,12 +160,14 @@ public class EfcodeCpNoticeMessageServiceImpl implements IEfcodeCpNoticeMessageS
}
List<String> noticeIds = notices.stream().map(EfcodeCpNotice::getId).toList();
// 2. 统计这些预告下企业未读的消息数量
// 2. 统计这些预告下企业未读的消息数量(同一预告的多条未读消息只计1条)
LambdaQueryWrapper<EfcodeCpNoticeMessage> msgWrapper = Wrappers.lambdaQuery();
msgWrapper.in(EfcodeCpNoticeMessage::getNoticeId, noticeIds);
msgWrapper.eq(EfcodeCpNoticeMessage::getEnterpriseViewed, 0);
msgWrapper.eq(EfcodeCpNoticeMessage::getIsDelete, 0);
return baseMapper.selectCount(msgWrapper);
msgWrapper.select(EfcodeCpNoticeMessage::getNoticeId);
List<EfcodeCpNoticeMessage> messages = baseMapper.selectList(msgWrapper);
return (long) messages.stream().map(EfcodeCpNoticeMessage::getNoticeId).distinct().count();
}
/**

30
zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/my/notice/cp_notice_list.vue

@ -18,21 +18,6 @@
:border="false"
@change="onTabChange"
>
<van-tab title="草稿" name="draft">
<notice-tab-content
ref="draftRef"
:status="0"
:can-publish="true"
:can-edit="true"
:can-delete="true"
:can-message="false"
:can-reinitiate="false"
@publish="onPublish"
@edit="onEdit"
@delete="onDelete"
@detail="onDetail"
/>
</van-tab>
<van-tab title="待执法预告" name="pending">
<notice-tab-content
ref="pendingRef"
@ -59,6 +44,21 @@
@detail="onDetail"
/>
</van-tab>
<van-tab title="草稿" name="draft">
<notice-tab-content
ref="draftRef"
:status="0"
:can-publish="true"
:can-edit="true"
:can-delete="true"
:can-message="false"
:can-reinitiate="false"
@publish="onPublish"
@edit="onEdit"
@delete="onDelete"
@detail="onDetail"
/>
</van-tab>
</van-tabs>
<!-- 悬浮新增按钮 -->

124
zdxt-web-client/zdxt-efcode-enforcement-app/src/views/enforcement/my/notice/cp_notice_tab_content.vue

@ -54,11 +54,7 @@
</div>
<!-- 操作按钮 -->
<div class="card-actions" v-if="canPublish || canEdit || canDelete || canMessage || canReinitiate || item.planId" @click.stop>
<div v-if="item.planId" class="action-item blue-action" @click="onViewPlan(item.planId)">
<van-icon name="orders-o" />
<span>关联计划</span>
</div>
<div class="card-actions" v-if="canPublish || canEdit || canDelete || canMessage || canReinitiate" @click.stop>
<div v-if="canPublish" class="action-item green-action" @click="$emit('publish', item)">
<van-icon name="passed" />
<span>发布</span>
@ -88,61 +84,11 @@
</van-list>
</van-pull-refresh>
<!-- 关联计划详情弹层 -->
<van-popup v-model:show="showPlanPopup" position="bottom" round :style="{ height: '65%' }">
<div class="plan-detail-popup">
<div class="plan-detail-header">
<span class="plan-detail-title">关联计划详情</span>
<van-icon name="cross" @click="showPlanPopup = false" />
</div>
<div class="plan-detail-body">
<div v-if="planDetailLoading" class="plan-detail-loading">
<van-loading size="18" />&nbsp;加载中...
</div>
<template v-else-if="planDetail">
<div class="plan-info-row">
<div class="plan-info-label">计划日期</div>
<div class="plan-info-value">{{ planDetail.planDate || '-' }} {{ getPlanTimeText(planDetail.planTime) }}</div>
</div>
<div class="plan-info-row">
<div class="plan-info-label">计划类别</div>
<div class="plan-info-value">{{ planDetail.planType === 1 ? '日常计划' : '专项计划' }}</div>
</div>
<div class="plan-info-row">
<div class="plan-info-label">企业名称</div>
<div class="plan-info-value">{{ planDetail.enterpriseName || '-' }}</div>
</div>
<div class="plan-info-row">
<div class="plan-info-label">企业信用代码</div>
<div class="plan-info-value">{{ planDetail.enterpriseNumber || '-' }}</div>
</div>
<div class="plan-info-row">
<div class="plan-info-label">企业联系人</div>
<div class="plan-info-value">{{ planDetail.contactPerson || '-' }}</div>
</div>
<div class="plan-info-row">
<div class="plan-info-label">联系电话</div>
<div class="plan-info-value">{{ planDetail.contactPhone || '-' }}</div>
</div>
<div class="plan-info-row">
<div class="plan-info-label">执法人员</div>
<div class="plan-info-value">{{ planDetail.enforceUserNames || '-' }}</div>
</div>
<div class="plan-info-row">
<div class="plan-info-label">执法事项</div>
<div class="plan-info-value">{{ planDetail.enforceContent || '-' }}</div>
</div>
</template>
<van-empty v-else description="未查询到计划信息" image-size="80" />
</div>
</div>
</van-popup>
</div>
</template>
<script setup>
import { getMyNoticeList } from '@/api/enforcement/notice';
import { getPlanDetail } from '@/api/enforcement/plan';
const props = defineProps({
status: { type: Number, required: true },
@ -229,30 +175,6 @@ const fetchList = () => {
);
};
// 关联计划弹层
const showPlanPopup = ref(false);
const planDetail = ref(null);
const planDetailLoading = ref(false);
const getPlanTimeText = (time) => {
const map = { 1: '上午', 2: '下午', 3: '其他' };
return map[time] || '';
};
const onViewPlan = (planId) => {
showPlanPopup.value = true;
planDetail.value = null;
planDetailLoading.value = true;
getPlanDetail(planId, (res) => {
planDetailLoading.value = false;
if (res.code === 200 && res.data) {
planDetail.value = res.data;
}
}, () => {
planDetailLoading.value = false;
});
};
// 暴露 refresh 方法给父组件
defineExpose({ refresh });
</script>
@ -382,48 +304,4 @@ defineExpose({ refresh });
color: #52c41a;
}
.plan-detail-popup {
display: flex;
flex-direction: column;
height: 100%;
.plan-detail-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 14px 16px 8px;
.plan-detail-title { font-size: 16px; font-weight: 600; color: #333; }
:deep(.van-icon) { font-size: 18px; color: #999; cursor: pointer; }
}
.plan-detail-body {
flex: 1;
overflow-y: auto;
padding: 8px 16px 16px;
}
.plan-detail-loading {
display: flex;
align-items: center;
justify-content: center;
padding: 30px 0;
color: #999;
font-size: 14px;
}
.plan-info-row {
display: flex;
padding: 12px 0;
border-bottom: 1px solid #f0f0f0;
&:last-child { border-bottom: none; }
.plan-info-label {
width: 90px;
flex-shrink: 0;
font-size: 14px;
color: #666;
}
.plan-info-value {
flex: 1;
font-size: 14px;
color: #333;
word-break: break-all;
}
}
}
</style>

2
zdxt-web-server/zdxt-admin-web-server/src/main/java/org/dromara/web/service/impl/PasswordAuthStrategy.java

@ -4,6 +4,7 @@ import cn.dev33.satoken.stp.StpUtil;
import cn.dev33.satoken.stp.parameter.SaLoginParameter;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.zdxt.enforcementcode.common.commonenum.PlatformTypeEnums;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.constant.Constants;
@ -74,6 +75,7 @@ public class PasswordAuthStrategy implements IAuthStrategy {
});
loginUser.setClientKey(client.getClientKey());
loginUser.setDeviceType(client.getDeviceType());
loginUser.setPlatformType(PlatformTypeEnums.SUPERVISION.getKey());
SaLoginParameter model = new SaLoginParameter();
model.setDeviceType(client.getDeviceType());
// 不从数据库读取超时配置,统一使用全局 yml 默认配置(timeout: 86400, active-timeout: 1800)

Loading…
Cancel
Save