feat(invoice): 完善发票管理权限控制和检验申请功能
- 超级管理员可以编辑操作员字段,普通用户不可编辑 - 修改权限判断逻辑,只有用户名等于 'admin' 的用户才是超级管理员 - 非超级管理员用户只能查询自己的发票数据 - 添加根据员工ID更新操作员名称功能 - 新增行时根据用户权限填充信息 - 严格检查权限,超级管理员可以删除所有记录,普通用户只能删除自己维护的记录 - 在 bargain 组件中验证患者选择 - 添加检验申请单相关API接口 - 在医生工作站中添加检验申请tab页 - 实现检验申请单的增删改查功能 - 添加公告通知已读记录相关功能 - 实现用户未读公告数量统计和标记已读功能
This commit is contained in:
@@ -3,10 +3,13 @@ package com.core.web.controller.system;
|
|||||||
import com.core.common.annotation.Log;
|
import com.core.common.annotation.Log;
|
||||||
import com.core.common.core.controller.BaseController;
|
import com.core.common.core.controller.BaseController;
|
||||||
import com.core.common.core.domain.AjaxResult;
|
import com.core.common.core.domain.AjaxResult;
|
||||||
|
import com.core.common.core.domain.model.LoginUser;
|
||||||
import com.core.common.core.page.TableDataInfo;
|
import com.core.common.core.page.TableDataInfo;
|
||||||
import com.core.common.enums.BusinessType;
|
import com.core.common.enums.BusinessType;
|
||||||
import com.core.system.domain.SysNotice;
|
import com.core.system.domain.SysNotice;
|
||||||
|
import com.core.common.core.domain.entity.SysUser;
|
||||||
import com.core.system.service.ISysNoticeService;
|
import com.core.system.service.ISysNoticeService;
|
||||||
|
import com.core.system.service.ISysNoticeReadService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -25,6 +28,9 @@ public class SysNoticeController extends BaseController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ISysNoticeService noticeService;
|
private ISysNoticeService noticeService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ISysNoticeReadService noticeReadService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取通知公告列表
|
* 获取通知公告列表
|
||||||
*/
|
*/
|
||||||
@@ -36,6 +42,86 @@ public class SysNoticeController extends BaseController {
|
|||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前用户的公告列表(公开接口)
|
||||||
|
* 公告类型:通常 noticeType = '1' 代表通知,noticeType = '2' 代表公告
|
||||||
|
*/
|
||||||
|
@GetMapping("/public/list")
|
||||||
|
public TableDataInfo getPublicList(SysNotice notice) {
|
||||||
|
// 只查询状态为正常(0)且已发布(1)的公告
|
||||||
|
notice.setStatus("0");
|
||||||
|
notice.setPublishStatus("1");
|
||||||
|
// 公告类型设置为 '2'(公告)
|
||||||
|
notice.setNoticeType("2");
|
||||||
|
// 设置分页参数
|
||||||
|
startPage();
|
||||||
|
List<SysNotice> list = noticeService.selectNoticeList(notice);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前用户的通知列表(公开接口)
|
||||||
|
* 通知类型:通常 noticeType = '1' 代表通知
|
||||||
|
*/
|
||||||
|
@GetMapping("/public/notice")
|
||||||
|
public AjaxResult getUserNotices() {
|
||||||
|
// 获取当前用户信息
|
||||||
|
LoginUser loginUser = getLoginUser();
|
||||||
|
SysUser currentUser = loginUser.getUser();
|
||||||
|
|
||||||
|
// 只查询状态为正常(0)且已发布(1)的通知
|
||||||
|
SysNotice notice = new SysNotice();
|
||||||
|
notice.setStatus("0");
|
||||||
|
notice.setPublishStatus("1");
|
||||||
|
// 通知类型设置为 '1'(通知)
|
||||||
|
notice.setNoticeType("1");
|
||||||
|
|
||||||
|
List<SysNotice> list = noticeService.selectNoticeList(notice);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户未读公告/通知数量(公开接口)
|
||||||
|
*/
|
||||||
|
@GetMapping("/public/unread/count")
|
||||||
|
public AjaxResult getUnreadCount() {
|
||||||
|
LoginUser loginUser = getLoginUser();
|
||||||
|
SysUser currentUser = loginUser.getUser();
|
||||||
|
int count = noticeReadService.getUnreadCount(currentUser.getUserId());
|
||||||
|
return success(count);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 标记公告/通知为已读(公开接口)
|
||||||
|
*/
|
||||||
|
@PostMapping("/public/read/{noticeId}")
|
||||||
|
public AjaxResult markAsRead(@PathVariable Long noticeId) {
|
||||||
|
LoginUser loginUser = getLoginUser();
|
||||||
|
SysUser currentUser = loginUser.getUser();
|
||||||
|
return noticeReadService.markAsRead(noticeId, currentUser.getUserId());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量标记公告/通知为已读(公开接口)
|
||||||
|
*/
|
||||||
|
@PostMapping("/public/read/all")
|
||||||
|
public AjaxResult markAllAsRead(@RequestBody Long[] noticeIds) {
|
||||||
|
LoginUser loginUser = getLoginUser();
|
||||||
|
SysUser currentUser = loginUser.getUser();
|
||||||
|
return noticeReadService.markAllAsRead(noticeIds, currentUser.getUserId());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户已读公告/通知ID列表(公开接口)
|
||||||
|
*/
|
||||||
|
@GetMapping("/public/read/ids")
|
||||||
|
public AjaxResult getReadNoticeIds() {
|
||||||
|
LoginUser loginUser = getLoginUser();
|
||||||
|
SysUser currentUser = loginUser.getUser();
|
||||||
|
List<Long> readIds = noticeReadService.selectReadNoticeIdsByUserId(currentUser.getUserId());
|
||||||
|
return success(readIds);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据通知公告编号获取详细信息
|
* 根据通知公告编号获取详细信息
|
||||||
*/
|
*/
|
||||||
@@ -53,6 +139,10 @@ public class SysNoticeController extends BaseController {
|
|||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@Validated @RequestBody SysNotice notice) {
|
public AjaxResult add(@Validated @RequestBody SysNotice notice) {
|
||||||
notice.setCreateBy(getUsername());
|
notice.setCreateBy(getUsername());
|
||||||
|
// 新建的公告默认为未发布状态
|
||||||
|
if (notice.getPublishStatus() == null || notice.getPublishStatus().isEmpty()) {
|
||||||
|
notice.setPublishStatus("0");
|
||||||
|
}
|
||||||
return toAjax(noticeService.insertNotice(notice));
|
return toAjax(noticeService.insertNotice(notice));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,4 +166,42 @@ public class SysNoticeController extends BaseController {
|
|||||||
public AjaxResult remove(@PathVariable Long[] noticeIds) {
|
public AjaxResult remove(@PathVariable Long[] noticeIds) {
|
||||||
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
|
return toAjax(noticeService.deleteNoticeByIds(noticeIds));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发布公告/通知
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:notice:edit')")
|
||||||
|
@Log(title = "发布公告", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/publish/{noticeId}")
|
||||||
|
public AjaxResult publish(@PathVariable Long noticeId) {
|
||||||
|
SysNotice notice = noticeService.selectNoticeById(noticeId);
|
||||||
|
if (notice == null) {
|
||||||
|
return error("公告不存在");
|
||||||
|
}
|
||||||
|
if ("1".equals(notice.getPublishStatus())) {
|
||||||
|
return error("该公告已发布");
|
||||||
|
}
|
||||||
|
notice.setPublishStatus("1");
|
||||||
|
notice.setUpdateBy(getUsername());
|
||||||
|
return toAjax(noticeService.updateNotice(notice));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消发布公告/通知
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('system:notice:edit')")
|
||||||
|
@Log(title = "取消发布", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping("/unpublish/{noticeId}")
|
||||||
|
public AjaxResult unpublish(@PathVariable Long noticeId) {
|
||||||
|
SysNotice notice = noticeService.selectNoticeById(noticeId);
|
||||||
|
if (notice == null) {
|
||||||
|
return error("公告不存在");
|
||||||
|
}
|
||||||
|
if ("0".equals(notice.getPublishStatus())) {
|
||||||
|
return error("该公告未发布");
|
||||||
|
}
|
||||||
|
notice.setPublishStatus("0");
|
||||||
|
notice.setUpdateBy(getUsername());
|
||||||
|
return toAjax(noticeService.updateNotice(notice));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ public class SysNotice extends BaseEntity {
|
|||||||
/** 公告状态(0正常 1关闭) */
|
/** 公告状态(0正常 1关闭) */
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/** 发布状态(0未发布 1已发布) */
|
||||||
|
private String publishStatus;
|
||||||
|
|
||||||
public Long getNoticeId() {
|
public Long getNoticeId() {
|
||||||
return noticeId;
|
return noticeId;
|
||||||
}
|
}
|
||||||
@@ -75,6 +78,14 @@ public class SysNotice extends BaseEntity {
|
|||||||
this.status = status;
|
this.status = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getPublishStatus() {
|
||||||
|
return publishStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPublishStatus(String publishStatus) {
|
||||||
|
this.publishStatus = publishStatus;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("noticeId", getNoticeId())
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE).append("noticeId", getNoticeId())
|
||||||
|
|||||||
@@ -0,0 +1,61 @@
|
|||||||
|
package com.core.system.domain;
|
||||||
|
|
||||||
|
import com.core.common.core.domain.BaseEntity;
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公告/通知已读记录 sys_notice_read
|
||||||
|
*
|
||||||
|
* @author system
|
||||||
|
*/
|
||||||
|
public class SysNoticeRead extends BaseEntity {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 阅读ID */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long readId;
|
||||||
|
|
||||||
|
/** 公告/通知ID */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long noticeId;
|
||||||
|
|
||||||
|
/** 用户ID */
|
||||||
|
@JsonSerialize(using = ToStringSerializer.class)
|
||||||
|
private Long userId;
|
||||||
|
|
||||||
|
/** 阅读时间 */
|
||||||
|
private String readTime;
|
||||||
|
|
||||||
|
public Long getReadId() {
|
||||||
|
return readId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReadId(Long readId) {
|
||||||
|
this.readId = readId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getNoticeId() {
|
||||||
|
return noticeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNoticeId(Long noticeId) {
|
||||||
|
this.noticeId = noticeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getUserId() {
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserId(Long userId) {
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReadTime() {
|
||||||
|
return readTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReadTime(String readTime) {
|
||||||
|
this.readTime = readTime;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
<result property="noticeType" column="notice_type"/>
|
<result property="noticeType" column="notice_type"/>
|
||||||
<result property="noticeContent" column="notice_content"/>
|
<result property="noticeContent" column="notice_content"/>
|
||||||
<result property="status" column="status"/>
|
<result property="status" column="status"/>
|
||||||
|
<result property="publishStatus" column="publish_status"/>
|
||||||
<result property="createBy" column="create_by"/>
|
<result property="createBy" column="create_by"/>
|
||||||
<result property="createTime" column="create_time"/>
|
<result property="createTime" column="create_time"/>
|
||||||
<result property="updateBy" column="update_by"/>
|
<result property="updateBy" column="update_by"/>
|
||||||
@@ -21,8 +22,9 @@
|
|||||||
select notice_id,
|
select notice_id,
|
||||||
notice_title,
|
notice_title,
|
||||||
notice_type,
|
notice_type,
|
||||||
cast(notice_content as char) as notice_content,
|
convert_from(notice_content, 'UTF8') as notice_content,
|
||||||
status,
|
status,
|
||||||
|
publish_status,
|
||||||
create_by,
|
create_by,
|
||||||
create_time,
|
create_time,
|
||||||
update_by,
|
update_by,
|
||||||
@@ -48,11 +50,19 @@
|
|||||||
<if test="createBy != null and createBy != ''">
|
<if test="createBy != null and createBy != ''">
|
||||||
AND create_by like concat('%', #{createBy}, '%')
|
AND create_by like concat('%', #{createBy}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
<if test="status != null and status != ''">
|
||||||
|
AND status = #{status}
|
||||||
|
</if>
|
||||||
|
<if test="publishStatus != null and publishStatus != ''">
|
||||||
|
AND publish_status = #{publishStatus}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertNotice" parameterType="SysNotice">
|
<insert id="insertNotice" parameterType="SysNotice">
|
||||||
insert into sys_notice (
|
insert into sys_notice (
|
||||||
|
notice_id,
|
||||||
<if test="noticeTitle != null and noticeTitle != '' ">notice_title,</if>
|
<if test="noticeTitle != null and noticeTitle != '' ">notice_title,</if>
|
||||||
<if test="noticeType != null and noticeType != '' ">notice_type,</if>
|
<if test="noticeType != null and noticeType != '' ">notice_type,</if>
|
||||||
<if test="noticeContent != null and noticeContent != '' ">notice_content,</if>
|
<if test="noticeContent != null and noticeContent != '' ">notice_content,</if>
|
||||||
@@ -61,9 +71,10 @@
|
|||||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
create_time
|
create_time
|
||||||
)values(
|
)values(
|
||||||
|
(SELECT COALESCE(MAX(notice_id), 0) + 1 FROM sys_notice),
|
||||||
<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle},</if>
|
<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle},</if>
|
||||||
<if test="noticeType != null and noticeType != ''">#{noticeType},</if>
|
<if test="noticeType != null and noticeType != ''">#{noticeType},</if>
|
||||||
<if test="noticeContent != null and noticeContent != ''">#{noticeContent},</if>
|
<if test="noticeContent != null and noticeContent != ''">cast(#{noticeContent} as bytea),</if>
|
||||||
<if test="status != null and status != ''">#{status},</if>
|
<if test="status != null and status != ''">#{status},</if>
|
||||||
<if test="remark != null and remark != ''">#{remark},</if>
|
<if test="remark != null and remark != ''">#{remark},</if>
|
||||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||||
@@ -76,8 +87,9 @@
|
|||||||
<set>
|
<set>
|
||||||
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle},</if>
|
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle},</if>
|
||||||
<if test="noticeType != null and noticeType != ''">notice_type = #{noticeType},</if>
|
<if test="noticeType != null and noticeType != ''">notice_type = #{noticeType},</if>
|
||||||
<if test="noticeContent != null">notice_content = #{noticeContent},</if>
|
<if test="noticeContent != null">notice_content = cast(#{noticeContent} as bytea),</if>
|
||||||
<if test="status != null and status != ''">status = #{status},</if>
|
<if test="status != null and status != ''">status = #{status},</if>
|
||||||
|
<if test="publishStatus != null and publishStatus != ''">publish_status = #{publishStatus},</if>
|
||||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||||
update_time = now()
|
update_time = now()
|
||||||
</set>
|
</set>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.openhis.web.triageandqueuemanage.appservice.CallNumberVoiceConfigAppS
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class CallNumberVoiceConfigAppServiceImpl implements CallNumberVoiceConfigAppService {
|
public class CallNumberVoiceConfigAppServiceImpl implements CallNumberVoiceConfigAppService {
|
||||||
@@ -15,6 +16,12 @@ public class CallNumberVoiceConfigAppServiceImpl implements CallNumberVoiceConfi
|
|||||||
@Resource
|
@Resource
|
||||||
private CallNumberVoiceConfigService callNumberVoiceConfigService;
|
private CallNumberVoiceConfigService callNumberVoiceConfigService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public R<?> getCallNumberVoiceConfig() {
|
||||||
|
List<CallNumberVoiceConfig> list = callNumberVoiceConfigService.list();
|
||||||
|
return R.ok(list);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public R<?> addCallNumberVoiceConfig(CallNumberVoiceConfig callNumberVoiceConfig) {
|
public R<?> addCallNumberVoiceConfig(CallNumberVoiceConfig callNumberVoiceConfig) {
|
||||||
if(ObjectUtil.isNull(callNumberVoiceConfig)){
|
if(ObjectUtil.isNull(callNumberVoiceConfig)){
|
||||||
@@ -32,4 +39,5 @@ public class CallNumberVoiceConfigAppServiceImpl implements CallNumberVoiceConfi
|
|||||||
boolean updateById = callNumberVoiceConfigService.updateById(callNumberVoiceConfig);
|
boolean updateById = callNumberVoiceConfigService.updateById(callNumberVoiceConfig);
|
||||||
return R.ok(updateById);
|
return R.ok(updateById);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,16 @@ public class CallNumberVoiceConfigController {
|
|||||||
@Resource
|
@Resource
|
||||||
private CallNumberVoiceConfigAppService callNumberVoiceConfigAppService;
|
private CallNumberVoiceConfigAppService callNumberVoiceConfigAppService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询叫号语音设置
|
||||||
|
*
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@GetMapping("/get")
|
||||||
|
public R<?> getCallNumberVoiceConfig(){
|
||||||
|
return R.ok(callNumberVoiceConfigAppService.getCallNumberVoiceConfig());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增叫号语音设置实体
|
* 新增叫号语音设置实体
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -29,9 +29,9 @@
|
|||||||
T3.price_code,
|
T3.price_code,
|
||||||
T3.retail_price,
|
T3.retail_price,
|
||||||
T3.maximum_retail_price,
|
T3.maximum_retail_price,
|
||||||
T3.chrgitm_lv,--医保等级
|
T3.chrgitm_lv,
|
||||||
T3.children_json,--子项json
|
T3.children_json,
|
||||||
T3.pricing_flag--划价标记
|
T3.pricing_flag
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
@@ -54,18 +54,18 @@
|
|||||||
T1.description_text,
|
T1.description_text,
|
||||||
T1.rule_id,
|
T1.rule_id,
|
||||||
T1.tenant_id,
|
T1.tenant_id,
|
||||||
T1.chrgitm_lv,--医保等级
|
T1.chrgitm_lv,
|
||||||
T2.type_code as item_type_code,
|
T2.type_code as item_type_code,
|
||||||
T2.yb_type,
|
T2.yb_type,
|
||||||
T2.price_code,
|
T2.price_code,
|
||||||
T2.price as retail_price,--零售价
|
T2.price as retail_price,
|
||||||
T4.amount as maximum_retail_price,--最高零售价
|
T4.amount as maximum_retail_price,
|
||||||
T1.children_json,--子项json
|
T1.children_json,
|
||||||
T1.pricing_flag--划价标记
|
T1.pricing_flag
|
||||||
FROM wor_activity_definition T1
|
FROM wor_activity_definition T1
|
||||||
LEFT JOIN adm_charge_item_definition T2 ON T1.id = T2.instance_id
|
LEFT JOIN adm_charge_item_definition T2 ON T1.id = T2.instance_id
|
||||||
LEFT JOIN adm_charge_item_definition T5 ON T5.instance_id = T1.id AND T5.instance_table = 'wor_activity_definition'
|
LEFT JOIN adm_charge_item_definition T5 ON T5.instance_id = T1.id AND T5.instance_table = 'wor_activity_definition'
|
||||||
LEFT JOIN adm_charge_item_def_detail T4 ON T4.definition_id = T5.id AND T4.condition_code = '4'--4:限制
|
LEFT JOIN adm_charge_item_def_detail T4 ON T4.definition_id = T5.id AND T4.condition_code = '4'
|
||||||
<where>
|
<where>
|
||||||
T1.delete_flag = '0'
|
T1.delete_flag = '0'
|
||||||
AND T2.instance_table = 'wor_activity_definition'
|
AND T2.instance_table = 'wor_activity_definition'
|
||||||
@@ -81,6 +81,7 @@
|
|||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
ORDER BY T1.bus_no DESC
|
ORDER BY T1.bus_no DESC
|
||||||
|
) T3
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -108,22 +109,23 @@
|
|||||||
T2.type_code as item_type_code,
|
T2.type_code as item_type_code,
|
||||||
T2.yb_type,
|
T2.yb_type,
|
||||||
T2.price_code,
|
T2.price_code,
|
||||||
T2.price as retail_price,--零售价,
|
T2.price as retail_price,
|
||||||
( SELECT T4.amount
|
(
|
||||||
FROM adm_charge_item_definition T5
|
SELECT T4.amount
|
||||||
LEFT JOIN adm_charge_item_def_detail T4 ON T4.definition_id = T5.id
|
FROM adm_charge_item_definition T5
|
||||||
WHERE T4.condition_code = '4'--4:限制
|
LEFT JOIN adm_charge_item_def_detail T4 ON T4.definition_id = T5.id
|
||||||
AND T5.instance_id = T1.id
|
WHERE T4.condition_code = '4'
|
||||||
AND T5.instance_table = 'wor_activity_definition'
|
AND T5.instance_id = T1.id
|
||||||
) as maximum_retail_price,--最高零售价
|
AND T5.instance_table = 'wor_activity_definition'
|
||||||
T1.chrgitm_lv,--医保等级
|
) as maximum_retail_price,
|
||||||
T1.children_json,--子项json
|
T1.chrgitm_lv,
|
||||||
T1.pricing_flag--划价标记
|
T1.children_json,
|
||||||
|
T1.pricing_flag
|
||||||
FROM wor_activity_definition T1
|
FROM wor_activity_definition T1
|
||||||
LEFT JOIN adm_charge_item_definition T2 ON T1.id = T2.instance_id
|
LEFT JOIN adm_charge_item_definition T2 ON T1.id = T2.instance_id
|
||||||
<where>
|
<where>
|
||||||
T1.delete_flag = '0'
|
T1.delete_flag = '0'
|
||||||
AND T2.instance_table = 'wor_activity_definition'
|
AND T2.instance_table = 'wor_activity_definition'
|
||||||
|
|
||||||
<if test="id!= null">
|
<if test="id!= null">
|
||||||
AND T1.id = #{id}
|
AND T1.id = #{id}
|
||||||
|
|||||||
@@ -9,6 +9,23 @@ export function listNotice(query) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取公开的公告列表(给普通用户使用)
|
||||||
|
export function getPublicNoticeList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/notice/public/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取当前用户的通知列表
|
||||||
|
export function getUserNotices() {
|
||||||
|
return request({
|
||||||
|
url: '/system/notice/public/notice',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 查询公告详细
|
// 查询公告详细
|
||||||
export function getNotice(noticeId) {
|
export function getNotice(noticeId) {
|
||||||
return request({
|
return request({
|
||||||
@@ -42,3 +59,52 @@ export function delNotice(noticeId) {
|
|||||||
method: 'delete'
|
method: 'delete'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 发布公告
|
||||||
|
export function publishNotice(noticeId) {
|
||||||
|
return request({
|
||||||
|
url: '/system/notice/publish/' + noticeId,
|
||||||
|
method: 'put'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 取消发布公告
|
||||||
|
export function unpublishNotice(noticeId) {
|
||||||
|
return request({
|
||||||
|
url: '/system/notice/unpublish/' + noticeId,
|
||||||
|
method: 'put'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取未读公告/通知数量
|
||||||
|
export function getUnreadCount() {
|
||||||
|
return request({
|
||||||
|
url: '/system/notice/public/unread/count',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 标记公告/通知为已读
|
||||||
|
export function markAsRead(noticeId) {
|
||||||
|
return request({
|
||||||
|
url: '/system/notice/public/read/' + noticeId,
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 批量标记公告/通知为已读
|
||||||
|
export function markAllAsRead(noticeIds) {
|
||||||
|
return request({
|
||||||
|
url: '/system/notice/public/read/all',
|
||||||
|
method: 'post',
|
||||||
|
data: noticeIds
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取用户已读公告/通知ID列表
|
||||||
|
export function getReadNoticeIds() {
|
||||||
|
return request({
|
||||||
|
url: '/system/notice/public/read/ids',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,6 +4,14 @@
|
|||||||
<template v-if="appStore.device !== 'mobile'">
|
<template v-if="appStore.device !== 'mobile'">
|
||||||
<header-search id="header-search" class="right-menu-item" />
|
<header-search id="header-search" class="right-menu-item" />
|
||||||
</template>
|
</template>
|
||||||
|
<!-- 公告和通知按钮 -->
|
||||||
|
<el-tooltip content="公告/通知" placement="bottom">
|
||||||
|
<div class="right-menu-item notice-btn" @click="openNoticePanel">
|
||||||
|
<el-badge :value="unreadCount" :hidden="unreadCount === 0" class="notice-badge">
|
||||||
|
<el-icon><Bell /></el-icon>
|
||||||
|
</el-badge>
|
||||||
|
</div>
|
||||||
|
</el-tooltip>
|
||||||
<div class="avatar-container">
|
<div class="avatar-container">
|
||||||
<div class="avatar-wrapper">
|
<div class="avatar-wrapper">
|
||||||
<el-dropdown
|
<el-dropdown
|
||||||
@@ -83,22 +91,28 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 公告/通知面板 -->
|
||||||
|
<NoticePanel ref="noticePanelRef" @updateUnreadCount="updateUnreadCount" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { ElMessageBox } from 'element-plus';
|
import { ElMessageBox } from 'element-plus';
|
||||||
|
import { Bell } from '@element-plus/icons-vue';
|
||||||
import Breadcrumb from '@/components/Breadcrumb';
|
import Breadcrumb from '@/components/Breadcrumb';
|
||||||
import TopNav from '@/components/TopNav';
|
import TopNav from '@/components/TopNav';
|
||||||
import Hamburger from '@/components/Hamburger';
|
import Hamburger from '@/components/Hamburger';
|
||||||
import Screenfull from '@/components/Screenfull';
|
import Screenfull from '@/components/Screenfull';
|
||||||
import SizeSelect from '@/components/SizeSelect';
|
import SizeSelect from '@/components/SizeSelect';
|
||||||
import HeaderSearch from '@/components/HeaderSearch';
|
import HeaderSearch from '@/components/HeaderSearch';
|
||||||
|
import NoticePanel from '@/components/NoticePanel';
|
||||||
import useAppStore from '@/store/modules/app';
|
import useAppStore from '@/store/modules/app';
|
||||||
import useUserStore from '@/store/modules/user';
|
import useUserStore from '@/store/modules/user';
|
||||||
import useSettingsStore from '@/store/modules/settings';
|
import useSettingsStore from '@/store/modules/settings';
|
||||||
import { getOrg, switchOrg } from '@/api/login';
|
import { getOrg, switchOrg } from '@/api/login';
|
||||||
|
import { getUnreadCount } from '@/api/system/notice';
|
||||||
|
|
||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
@@ -106,6 +120,22 @@ const settingsStore = useSettingsStore();
|
|||||||
const orgOptions = ref([]);
|
const orgOptions = ref([]);
|
||||||
const showDialog = ref(false);
|
const showDialog = ref(false);
|
||||||
const orgId = ref('');
|
const orgId = ref('');
|
||||||
|
const noticePanelRef = ref(null);
|
||||||
|
const unreadCount = ref(0);
|
||||||
|
|
||||||
|
// 加载未读数量
|
||||||
|
function loadUnreadCount() {
|
||||||
|
getUnreadCount().then(res => {
|
||||||
|
unreadCount.value = res.data || 0;
|
||||||
|
}).catch(() => {
|
||||||
|
unreadCount.value = 0;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新未读数量
|
||||||
|
function updateUnreadCount() {
|
||||||
|
loadUnreadCount();
|
||||||
|
}
|
||||||
|
|
||||||
function loadOrgList() {
|
function loadOrgList() {
|
||||||
getOrg().then((res) => {
|
getOrg().then((res) => {
|
||||||
@@ -115,6 +145,7 @@ function loadOrgList() {
|
|||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
loadOrgList();
|
loadOrgList();
|
||||||
|
loadUnreadCount();
|
||||||
});
|
});
|
||||||
|
|
||||||
function handleOrgSwitch(selectedOrgId) {
|
function handleOrgSwitch(selectedOrgId) {
|
||||||
@@ -160,12 +191,12 @@ function logout() {
|
|||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
userStore.logOut().then(() => {
|
userStore.logOut().then(() => {
|
||||||
location.href = '/index';
|
location.href = '/index';
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(() => {});
|
.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
function submit() {
|
function submit() {
|
||||||
@@ -182,6 +213,13 @@ const emits = defineEmits(['setLayout']);
|
|||||||
function setLayout() {
|
function setLayout() {
|
||||||
emits('setLayout');
|
emits('setLayout');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 打开公告/通知面板
|
||||||
|
function openNoticePanel() {
|
||||||
|
if (noticePanelRef.value) {
|
||||||
|
noticePanelRef.value.open();
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang='scss' scoped>
|
<style lang='scss' scoped>
|
||||||
@@ -222,7 +260,31 @@ function setLayout() {
|
|||||||
transition: background 0.3s;
|
transition: background 0.3s;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background: rgba(255, 255, 255, 0.1);
|
background: rgba(255,255,255,0.1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.notice-btn {
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 0 10px;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.notice-badge {
|
||||||
|
:deep(.el-badge__content) {
|
||||||
|
top: -5px;
|
||||||
|
right: -5px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.el-icon {
|
||||||
|
font-size: 20px;
|
||||||
|
color: #606266;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: #409eff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,11 +70,12 @@
|
|||||||
|
|
||||||
<el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="noticeList" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="序号" align="center" prop="noticeId" width="100" />
|
<el-table-column label="序号" align="center" prop="noticeId" width="80" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="公告标题"
|
label="公告标题"
|
||||||
align="center"
|
align="center"
|
||||||
prop="noticeTitle"
|
prop="noticeTitle"
|
||||||
|
min-width="200"
|
||||||
:show-overflow-tooltip="true"
|
:show-overflow-tooltip="true"
|
||||||
/>
|
/>
|
||||||
<el-table-column label="公告类型" align="center" prop="noticeType" width="100">
|
<el-table-column label="公告类型" align="center" prop="noticeType" width="100">
|
||||||
@@ -82,20 +83,40 @@
|
|||||||
<dict-tag :options="sys_notice_type" :value="scope.row.noticeType" />
|
<dict-tag :options="sys_notice_type" :value="scope.row.noticeType" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="状态" align="center" prop="status" width="100">
|
<el-table-column label="状态" align="center" prop="status" width="90">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<dict-tag :options="sys_notice_status" :value="scope.row.status" />
|
<dict-tag :options="sys_notice_status" :value="scope.row.status" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="创建者" align="center" prop="createBy" width="100" />
|
<el-table-column label="发布状态" align="center" prop="publishStatus" width="90">
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="100">
|
<template #default="scope">
|
||||||
|
<el-tag v-if="scope.row.publishStatus === '1'" type="success">已发布</el-tag>
|
||||||
|
<el-tag v-else type="info">未发布</el-tag>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="创建者" align="center" prop="createBy" width="90" />
|
||||||
|
<el-table-column label="创建时间" align="center" prop="createTime" width="110">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" min-width="280">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:notice:edit']">修改</el-button>
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:notice:edit']">修改</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="scope.row.publishStatus !== '1'"
|
||||||
|
link type="success"
|
||||||
|
icon="Promotion"
|
||||||
|
@click="handlePublish(scope.row)"
|
||||||
|
v-hasPermi="['system:notice:edit']"
|
||||||
|
>发布</el-button>
|
||||||
|
<el-button
|
||||||
|
v-else
|
||||||
|
link type="warning"
|
||||||
|
icon="RemoveFilled"
|
||||||
|
@click="handleUnpublish(scope.row)"
|
||||||
|
v-hasPermi="['system:notice:edit']"
|
||||||
|
>取消发布</el-button>
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:notice:remove']" >删除</el-button>
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:notice:remove']" >删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -159,7 +180,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="Notice">
|
<script setup name="Notice">
|
||||||
import { listNotice, getNotice, delNotice, addNotice, updateNotice } from "@/api/system/notice";
|
import { listNotice, getNotice, delNotice, addNotice, updateNotice, publishNotice, unpublishNotice } from "@/api/system/notice";
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
const { proxy } = getCurrentInstance();
|
||||||
const { sys_notice_status, sys_notice_type } = proxy.useDict("sys_notice_status", "sys_notice_type");
|
const { sys_notice_status, sys_notice_type } = proxy.useDict("sys_notice_status", "sys_notice_type");
|
||||||
@@ -212,7 +233,8 @@ function reset() {
|
|||||||
noticeTitle: undefined,
|
noticeTitle: undefined,
|
||||||
noticeType: undefined,
|
noticeType: undefined,
|
||||||
noticeContent: undefined,
|
noticeContent: undefined,
|
||||||
status: "0"
|
status: "0",
|
||||||
|
publishStatus: "0"
|
||||||
};
|
};
|
||||||
proxy.resetForm("noticeRef");
|
proxy.resetForm("noticeRef");
|
||||||
}
|
}
|
||||||
@@ -259,6 +281,8 @@ function submitForm() {
|
|||||||
getList();
|
getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
// 新增时默认为未发布状态
|
||||||
|
form.value.publishStatus = "0";
|
||||||
addNotice(form.value).then(response => {
|
addNotice(form.value).then(response => {
|
||||||
proxy.$modal.msgSuccess("新增成功");
|
proxy.$modal.msgSuccess("新增成功");
|
||||||
open.value = false;
|
open.value = false;
|
||||||
@@ -278,6 +302,24 @@ function handleDelete(row) {
|
|||||||
proxy.$modal.msgSuccess("删除成功");
|
proxy.$modal.msgSuccess("删除成功");
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
}
|
}
|
||||||
|
/** 发布按钮操作 */
|
||||||
|
function handlePublish(row) {
|
||||||
|
proxy.$modal.confirm('确认发布该公告吗?发布后将对所有用户可见。').then(function() {
|
||||||
|
return publishNotice(row.noticeId);
|
||||||
|
}).then(() => {
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("发布成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
}
|
||||||
|
/** 取消发布按钮操作 */
|
||||||
|
function handleUnpublish(row) {
|
||||||
|
proxy.$modal.confirm('确认取消发布该公告吗?取消后将不再对用户可见。').then(function() {
|
||||||
|
return unpublishNotice(row.noticeId);
|
||||||
|
}).then(() => {
|
||||||
|
getList();
|
||||||
|
proxy.$modal.msgSuccess("已取消发布");
|
||||||
|
}).catch(() => {});
|
||||||
|
}
|
||||||
|
|
||||||
getList();
|
getList();
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user