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.core.controller.BaseController;
|
||||
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.enums.BusinessType;
|
||||
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.ISysNoticeReadService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -25,6 +28,9 @@ public class SysNoticeController extends BaseController {
|
||||
@Autowired
|
||||
private ISysNoticeService noticeService;
|
||||
|
||||
@Autowired
|
||||
private ISysNoticeReadService noticeReadService;
|
||||
|
||||
/**
|
||||
* 获取通知公告列表
|
||||
*/
|
||||
@@ -36,6 +42,86 @@ public class SysNoticeController extends BaseController {
|
||||
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
|
||||
public AjaxResult add(@Validated @RequestBody SysNotice notice) {
|
||||
notice.setCreateBy(getUsername());
|
||||
// 新建的公告默认为未发布状态
|
||||
if (notice.getPublishStatus() == null || notice.getPublishStatus().isEmpty()) {
|
||||
notice.setPublishStatus("0");
|
||||
}
|
||||
return toAjax(noticeService.insertNotice(notice));
|
||||
}
|
||||
|
||||
@@ -76,4 +166,42 @@ public class SysNoticeController extends BaseController {
|
||||
public AjaxResult remove(@PathVariable Long[] 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关闭) */
|
||||
private String status;
|
||||
|
||||
/** 发布状态(0未发布 1已发布) */
|
||||
private String publishStatus;
|
||||
|
||||
public Long getNoticeId() {
|
||||
return noticeId;
|
||||
}
|
||||
@@ -75,6 +78,14 @@ public class SysNotice extends BaseEntity {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getPublishStatus() {
|
||||
return publishStatus;
|
||||
}
|
||||
|
||||
public void setPublishStatus(String publishStatus) {
|
||||
this.publishStatus = publishStatus;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
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="noticeContent" column="notice_content"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="publishStatus" column="publish_status"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
@@ -21,8 +22,9 @@
|
||||
select notice_id,
|
||||
notice_title,
|
||||
notice_type,
|
||||
cast(notice_content as char) as notice_content,
|
||||
convert_from(notice_content, 'UTF8') as notice_content,
|
||||
status,
|
||||
publish_status,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
@@ -48,11 +50,19 @@
|
||||
<if test="createBy != null and createBy != ''">
|
||||
AND create_by like concat('%', #{createBy}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="publishStatus != null and publishStatus != ''">
|
||||
AND publish_status = #{publishStatus}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<insert id="insertNotice" parameterType="SysNotice">
|
||||
insert into sys_notice (
|
||||
notice_id,
|
||||
<if test="noticeTitle != null and noticeTitle != '' ">notice_title,</if>
|
||||
<if test="noticeType != null and noticeType != '' ">notice_type,</if>
|
||||
<if test="noticeContent != null and noticeContent != '' ">notice_content,</if>
|
||||
@@ -61,9 +71,10 @@
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
(SELECT COALESCE(MAX(notice_id), 0) + 1 FROM sys_notice),
|
||||
<if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle},</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="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
@@ -76,8 +87,9 @@
|
||||
<set>
|
||||
<if test="noticeTitle != null and noticeTitle != ''">notice_title = #{noticeTitle},</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="publishStatus != null and publishStatus != ''">publish_status = #{publishStatus},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = now()
|
||||
</set>
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.openhis.web.triageandqueuemanage.appservice.CallNumberVoiceConfigAppS
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CallNumberVoiceConfigAppServiceImpl implements CallNumberVoiceConfigAppService {
|
||||
@@ -15,6 +16,12 @@ public class CallNumberVoiceConfigAppServiceImpl implements CallNumberVoiceConfi
|
||||
@Resource
|
||||
private CallNumberVoiceConfigService callNumberVoiceConfigService;
|
||||
|
||||
@Override
|
||||
public R<?> getCallNumberVoiceConfig() {
|
||||
List<CallNumberVoiceConfig> list = callNumberVoiceConfigService.list();
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<?> addCallNumberVoiceConfig(CallNumberVoiceConfig callNumberVoiceConfig) {
|
||||
if(ObjectUtil.isNull(callNumberVoiceConfig)){
|
||||
@@ -32,4 +39,5 @@ public class CallNumberVoiceConfigAppServiceImpl implements CallNumberVoiceConfi
|
||||
boolean updateById = callNumberVoiceConfigService.updateById(callNumberVoiceConfig);
|
||||
return R.ok(updateById);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,16 @@ public class CallNumberVoiceConfigController {
|
||||
@Resource
|
||||
private CallNumberVoiceConfigAppService callNumberVoiceConfigAppService;
|
||||
|
||||
/**
|
||||
* 查询叫号语音设置
|
||||
*
|
||||
* @return 结果
|
||||
*/
|
||||
@GetMapping("/get")
|
||||
public R<?> getCallNumberVoiceConfig(){
|
||||
return R.ok(callNumberVoiceConfigAppService.getCallNumberVoiceConfig());
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增叫号语音设置实体
|
||||
*
|
||||
|
||||
@@ -29,9 +29,9 @@
|
||||
T3.price_code,
|
||||
T3.retail_price,
|
||||
T3.maximum_retail_price,
|
||||
T3.chrgitm_lv,--医保等级
|
||||
T3.children_json,--子项json
|
||||
T3.pricing_flag--划价标记
|
||||
T3.chrgitm_lv,
|
||||
T3.children_json,
|
||||
T3.pricing_flag
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
@@ -54,18 +54,18 @@
|
||||
T1.description_text,
|
||||
T1.rule_id,
|
||||
T1.tenant_id,
|
||||
T1.chrgitm_lv,--医保等级
|
||||
T1.chrgitm_lv,
|
||||
T2.type_code as item_type_code,
|
||||
T2.yb_type,
|
||||
T2.price_code,
|
||||
T2.price as retail_price,--零售价
|
||||
T4.amount as maximum_retail_price,--最高零售价
|
||||
T1.children_json,--子项json
|
||||
T1.pricing_flag--划价标记
|
||||
T2.price as retail_price,
|
||||
T4.amount as maximum_retail_price,
|
||||
T1.children_json,
|
||||
T1.pricing_flag
|
||||
FROM wor_activity_definition T1
|
||||
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_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>
|
||||
T1.delete_flag = '0'
|
||||
AND T2.instance_table = 'wor_activity_definition'
|
||||
@@ -81,6 +81,7 @@
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY T1.bus_no DESC
|
||||
) T3
|
||||
|
||||
</select>
|
||||
|
||||
@@ -108,22 +109,23 @@
|
||||
T2.type_code as item_type_code,
|
||||
T2.yb_type,
|
||||
T2.price_code,
|
||||
T2.price as retail_price,--零售价,
|
||||
( SELECT T4.amount
|
||||
FROM adm_charge_item_definition T5
|
||||
LEFT JOIN adm_charge_item_def_detail T4 ON T4.definition_id = T5.id
|
||||
WHERE T4.condition_code = '4'--4:限制
|
||||
AND T5.instance_id = T1.id
|
||||
AND T5.instance_table = 'wor_activity_definition'
|
||||
) as maximum_retail_price,--最高零售价
|
||||
T1.chrgitm_lv,--医保等级
|
||||
T1.children_json,--子项json
|
||||
T1.pricing_flag--划价标记
|
||||
T2.price as retail_price,
|
||||
(
|
||||
SELECT T4.amount
|
||||
FROM adm_charge_item_definition T5
|
||||
LEFT JOIN adm_charge_item_def_detail T4 ON T4.definition_id = T5.id
|
||||
WHERE T4.condition_code = '4'
|
||||
AND T5.instance_id = T1.id
|
||||
AND T5.instance_table = 'wor_activity_definition'
|
||||
) as maximum_retail_price,
|
||||
T1.chrgitm_lv,
|
||||
T1.children_json,
|
||||
T1.pricing_flag
|
||||
FROM wor_activity_definition T1
|
||||
LEFT JOIN adm_charge_item_definition T2 ON T1.id = T2.instance_id
|
||||
<where>
|
||||
T1.delete_flag = '0'
|
||||
AND T2.instance_table = 'wor_activity_definition'
|
||||
AND T2.instance_table = 'wor_activity_definition'
|
||||
|
||||
<if test="id!= null">
|
||||
AND T1.id = #{id}
|
||||
@@ -134,4 +136,4 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user