zjh
2025-06-20 ac544c1d85c53e7f51e4ea76aa2489a14aef03d9
zjh20250620
16个文件已修改
4个文件已添加
333 ■■■■■ 已修改文件
ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysNoticeController.java 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysUserController.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjDwGroupingController.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/domain/SysNoticeUser.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/SysNoticeUserMapper.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjDwGroupingMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/service/ITjDwGroupingService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/service/SysNoticeUserService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/SysNoticeUserServiceImpl.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjDwGroupingServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-hosp/src/main/resources/mapper/hosp/TjDwGroupingMapper.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-system/src/main/java/com/ltkj/system/domain/SysNotice.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-system/src/main/java/com/ltkj/system/mapper/SysDeptMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-system/src/main/java/com/ltkj/system/mapper/SysNoticeMapper.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-system/src/main/java/com/ltkj/system/service/ISysDeptService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-system/src/main/java/com/ltkj/system/service/ISysNoticeService.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-system/src/main/java/com/ltkj/system/service/impl/SysDeptServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-system/src/main/java/com/ltkj/system/service/impl/SysNoticeServiceImpl.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-system/src/main/resources/mapper/system/SysDeptMapper.xml 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-system/src/main/resources/mapper/system/SysNoticeMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysNoticeController.java
@@ -1,9 +1,20 @@
package com.ltkj.web.controller.system;
import java.util.List;
import java.util.stream.Collectors;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ltkj.common.core.domain.entity.SysUser;
import com.ltkj.common.core.domain.model.LoginUser;
import com.ltkj.common.utils.SecurityUtils;
import com.ltkj.hosp.domain.SysNoticeUser;
import com.ltkj.hosp.service.SysNoticeUserService;
import com.ltkj.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
@@ -31,6 +42,10 @@
public class SysNoticeController extends BaseController {
    @Autowired
    private ISysNoticeService noticeService;
    @Autowired
    private SysNoticeUserService sysNoticeUserService;
    @Autowired
    private ISysUserService userService;
    /**
     * 获取通知公告列表
@@ -40,6 +55,15 @@
    public TableDataInfo list(SysNotice notice) {
        startPage();
        List<SysNotice> list = noticeService.selectNoticeList(notice);
        for (SysNotice sysNotice : list) {
            LambdaQueryWrapper<SysNoticeUser> wq = new LambdaQueryWrapper<>();
            wq.eq(SysNoticeUser::getNoticeId, sysNotice.getNoticeId());
            List<SysNoticeUser> sysNoticeUsers = sysNoticeUserService.list(wq);
            if(null != sysNoticeUsers && !sysNoticeUsers.isEmpty()){
                List<String> longList = sysNoticeUsers.stream().map(i -> i.getUserId().toString()).collect(Collectors.toList());
                sysNotice.setUserIds(longList);
            }
        }
        return getDataTable(list);
    }
@@ -49,7 +73,15 @@
//    @PreAuthorize("@ss.hasPermi('system:notice:query')")
    @GetMapping(value = "/{noticeId}")
    public AjaxResult getInfo(@PathVariable Long noticeId) {
        return success(noticeService.selectNoticeById(noticeId));
        SysNotice byId = noticeService.getById(noticeId);
        LambdaQueryWrapper<SysNoticeUser> wq = new LambdaQueryWrapper<>();
        wq.eq(SysNoticeUser::getNoticeId, noticeId);
        List<SysNoticeUser> sysNoticeUsers = sysNoticeUserService.list(wq);
        if(null != sysNoticeUsers && !sysNoticeUsers.isEmpty()){
            List<String> longList = sysNoticeUsers.stream().map(i -> i.getUserId().toString()).collect(Collectors.toList());
            byId.setUserIds(longList);
        }
        return success(byId);
    }
    /**
@@ -58,9 +90,30 @@
//    @PreAuthorize("@ss.hasPermi('system:notice:add')")
    @Log(title = "通知公告", businessType = BusinessType.INSERT)
    @PostMapping
    @Transactional
    public AjaxResult add(@Validated @RequestBody SysNotice notice) {
        notice.setCreateBy(getUsername());
        return toAjax(noticeService.insertNotice(notice));
        notice.setNoticeId(IdUtil.getSnowflake().nextId());
        boolean insertNotice = noticeService.save(notice);
        if (insertNotice){
            if (notice.getUserIds() == null || notice.getUserIds().isEmpty()){
                if (StrUtil.isBlank(notice.getDeptId())){
                    notice.setUserIds(userService.list().stream().map(i -> String.valueOf(i.getUserId())).collect(Collectors.toList()));
                }else {
                    LambdaQueryWrapper<SysUser> wrapper = new LambdaQueryWrapper<>();
                    wrapper.eq(SysUser::getDeptId, notice.getDeptId());
                    notice.setUserIds(userService.list(wrapper).stream().map(i -> String.valueOf(i.getUserId())).collect(Collectors.toList()));
                }
            }
            for (String userId : notice.getUserIds()) {
                SysNoticeUser user = new SysNoticeUser();
                user.setId(IdUtil.getSnowflake().nextId());
                user.setNoticeId(notice.getNoticeId());
                user.setUserId(Long.valueOf(userId));
                sysNoticeUserService.save(user);
            }
        }else return AjaxResult.error();
        return AjaxResult.success();
    }
    /**
@@ -71,7 +124,24 @@
    @PutMapping
    public AjaxResult edit(@Validated @RequestBody SysNotice notice) {
        notice.setUpdateBy(getUsername());
        return toAjax(noticeService.updateNotice(notice));
        List<String> userIds = notice.getUserIds();
        if (noticeService.updateById(notice)) {
            if(null !=userIds && !userIds.isEmpty()){
                LambdaQueryWrapper<SysNoticeUser> wq = new LambdaQueryWrapper<>();
                wq.eq(SysNoticeUser::getNoticeId, notice.getNoticeId());
                sysNoticeUserService.remove(wq);
                for (String userId : userIds) {
                    SysNoticeUser user = new SysNoticeUser();
                    user.setId(IdUtil.getSnowflake().nextId());
                    user.setNoticeId(notice.getNoticeId());
                    user.setUserId(Long.valueOf(userId));
                    sysNoticeUserService.save(user);
                }
            }
            return AjaxResult.success();
        }
        return AjaxResult.error();
    }
    /**
@@ -83,4 +153,14 @@
    public AjaxResult remove(@PathVariable Long[] noticeIds) {
        return toAjax(noticeService.deleteNoticeByIds(noticeIds));
    }
    @GetMapping("/noticeToday")
    public AjaxResult noticeToday(){
        LoginUser loginUser = SecurityUtils.getLoginUser();
        if (loginUser.getUserId().equalsIgnoreCase("1")){
            return AjaxResult.success(noticeService.selectAllByAdmin());
        }else {
            return AjaxResult.success(noticeService.selectAll(loginUser.getUserId()));
        }
    }
}
ltkj-admin/src/main/java/com/ltkj/web/controller/system/SysUserController.java
@@ -20,6 +20,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import jodd.util.StringUtil;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -324,6 +325,16 @@
        return ajax;
    }
    @GetMapping("/userListByDeptId")
    public AjaxResult userListByDeptId(@RequestParam(required = false) String deptId){
        LambdaQueryWrapper<SysUser> wrapper = new LambdaQueryWrapper<>();
        if(StringUtil.isNotBlank(deptId)){
            List<Long> deptIds = deptService.getDeptTreeById(deptId);
            wrapper.in(SysUser::getDeptId,deptIds);
        }
        return AjaxResult.success(userService.list(wrapper));
    }
    /**
     * 用户授权角色
     */
ltkj-admin/src/main/java/com/ltkj/web/controller/system/TjDwGroupingController.java
@@ -290,4 +290,29 @@
        List<TjProject> tjProjectList = projectService.list(wq);
        return success(tjProjectList);
    }
    @GetMapping("/huoqutuantitaocanxiangmuList")
    @ApiOperation(value = "获取所有单位团体套餐项目")
    public AjaxResult huoqutuantitaocanxiangmuList(@RequestParam(required = false) String dwId) {
        List<TjPackage> list=  tjDwGroupingService.huoqutuantitaocanxiangmuhuoqutuantitaocanxiangmuList(dwId);
        if (null !=list && !list.isEmpty()){
            for (TjPackage tjPackage : list) {
                List<TjProject> res=new ArrayList<>();
                LambdaQueryWrapper<TjGroupingPro> wqq=new LambdaQueryWrapper<>();
                wqq.eq(TjGroupingPro::getGroupingId,tjPackage.getPacId());
                final List<TjGroupingPro> groupingProList = groupingProService.list(wqq);
                if (null !=groupingProList && !groupingProList.isEmpty()){
                    for (TjGroupingPro pro : groupingProList) {
                        final TjProject byId = projectService.getById(pro.getProId());
                        if(null !=byId){
                            res.add(byId);
                        }
                    }
                    tjPackage.setTjProjectList(res);
                }
            }
        }
        return AjaxResult.success(list);
    }
}
ltkj-hosp/src/main/java/com/ltkj/hosp/domain/SysNoticeUser.java
New file
@@ -0,0 +1,34 @@
package com.ltkj.hosp.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;
/**
 *
 * @TableName sys_notice_user
 */
@TableName(value ="sys_notice_user")
@Data
public class SysNoticeUser implements Serializable {
    /**
     *
     */
    @TableId
    private Long id;
    /**
     *
     */
    private Long noticeId;
    /**
     *
     */
    private Long userId;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/SysNoticeUserMapper.java
New file
@@ -0,0 +1,18 @@
package com.ltkj.hosp.mapper;
import com.ltkj.hosp.domain.SysNoticeUser;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @author w
* @description 针对表【sys_notice_user】的数据库操作Mapper
* @createDate 2025-06-13 16:07:05
* @Entity com.ltkj.hosp.domain.SysNoticeUser
*/
public interface SysNoticeUserMapper extends BaseMapper<SysNoticeUser> {
}
ltkj-hosp/src/main/java/com/ltkj/hosp/mapper/TjDwGroupingMapper.java
@@ -111,4 +111,7 @@
            " tj_dw_grouping a  JOIN tj_grouping_pro b ON b.grouping_id=a.id \n" +
            "WHERE a.deleted=0 and a.dw_id=#{dwId} AND (a.sex=#{sex} or a.sex=2) GROUP BY b.grouping_id")
    List<TjPackage> huoqutuantitaocanxiangmu(@Param("dwId") String dwId,@Param("sex") Long sex);
    List<TjPackage> huoqutuantitaocanxiangmuhuoqutuantitaocanxiangmuList(@Param("dwId") String dwId);
}
ltkj-hosp/src/main/java/com/ltkj/hosp/service/ITjDwGroupingService.java
@@ -69,4 +69,6 @@
    public int selectTjDwGroupingByDwId(String dwId);
    List<TjPackage> huoqutuantitaocanxiangmu(String dwId, Long sex);
    List<TjPackage> huoqutuantitaocanxiangmuhuoqutuantitaocanxiangmuList(String dwId);
}
ltkj-hosp/src/main/java/com/ltkj/hosp/service/SysNoticeUserService.java
New file
@@ -0,0 +1,13 @@
package com.ltkj.hosp.service;
import com.ltkj.hosp.domain.SysNoticeUser;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author w
* @description 针对表【sys_notice_user】的数据库操作Service
* @createDate 2025-06-13 16:07:05
*/
public interface SysNoticeUserService extends IService<SysNoticeUser> {
}
ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/SysNoticeUserServiceImpl.java
New file
@@ -0,0 +1,22 @@
package com.ltkj.hosp.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ltkj.hosp.domain.SysNoticeUser;
import com.ltkj.hosp.service.SysNoticeUserService;
import com.ltkj.hosp.mapper.SysNoticeUserMapper;
import org.springframework.stereotype.Service;
/**
* @author w
* @description 针对表【sys_notice_user】的数据库操作Service实现
* @createDate 2025-06-13 16:07:05
*/
@Service
public class SysNoticeUserServiceImpl extends ServiceImpl<SysNoticeUserMapper, SysNoticeUser>
    implements SysNoticeUserService{
}
ltkj-hosp/src/main/java/com/ltkj/hosp/service/impl/TjDwGroupingServiceImpl.java
@@ -111,4 +111,9 @@
    public List<TjPackage> huoqutuantitaocanxiangmu(String dwId, Long sex) {
        return tjDwGroupingMapper.huoqutuantitaocanxiangmu(dwId,sex);
    }
    @Override
    public List<TjPackage> huoqutuantitaocanxiangmuhuoqutuantitaocanxiangmuList(String dwId) {
        return tjDwGroupingMapper.huoqutuantitaocanxiangmuhuoqutuantitaocanxiangmuList(dwId);
    }
}
ltkj-hosp/src/main/resources/mapper/hosp/TjDwGroupingMapper.xml
@@ -211,4 +211,18 @@
            #{id}
        </foreach>
    </delete>
</mapper>
    <select id="huoqutuantitaocanxiangmuhuoqutuantitaocanxiangmuList" parameterType="string"
            resultType="com.ltkj.hosp.domain.TjPackage">
        SELECT a.id pac_id,grouping_name pac_name,a.ys_price price , GROUP_CONCAT(b.pro_name ORDER BY b.pro_name)
        allProName FROM
        tj_dw_grouping a JOIN tj_grouping_pro b ON b.grouping_id=a.id
        <where>
            <if test="dwId != null" >
                and a.dw_id = #{dwId}
            </if>
            and a.deleted=0 GROUP BY b.grouping_id
        </where>
    </select>
</mapper>
ltkj-system/src/main/java/com/ltkj/system/domain/SysNotice.java
@@ -3,10 +3,17 @@
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.ltkj.tduck.handler.LongToStringSerializer;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ltkj.common.core.domain.BaseEntity;
import com.ltkj.common.xss.Xss;
import java.util.List;
/**
 * 通知公告表 sys_notice
@@ -19,6 +26,8 @@
    /**
     * 公告ID
     */
    @TableId
    @JsonSerialize(using = LongToStringSerializer.class)
    private Long noticeId;
    /**
@@ -41,6 +50,28 @@
     */
    private String status;
    //    @TableField(exist = false)
    private String deptId;
    @TableField(exist = false)
    private List<String> userIds;
    public String getDeptId() {
        return deptId;
    }
    public void setDeptId(String deptId) {
        this.deptId = deptId;
    }
    public List<String> getUserIds() {
        return userIds;
    }
    public void setUserIds(List<String> userIds) {
        this.userIds = userIds;
    }
    public Long getNoticeId() {
        return noticeId;
    }
ltkj-system/src/main/java/com/ltkj/system/mapper/SysDeptMapper.java
@@ -163,4 +163,7 @@
     @Select("SELECT e.dept_name FROM sys_dept e WHERE e.dept_id=#{deptId}")
    String getprentks(String deptId);
    List<Long> getDeptTreeById(@Param("deptId") String deptId);
}
ltkj-system/src/main/java/com/ltkj/system/mapper/SysNoticeMapper.java
@@ -2,14 +2,17 @@
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ltkj.system.domain.SysNotice;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
 * 通知公告表 数据层
 *
 * @author ltkj
 */
public interface SysNoticeMapper {
public interface SysNoticeMapper extends BaseMapper<SysNotice> {
    /**
     * 查询公告信息
     *
@@ -57,4 +60,13 @@
     * @return 结果
     */
    public int deleteNoticeByIds(Long[] noticeIds);
    @Select("SELECT s.* FROM sys_notice s\n" +
            "  JOIN sys_notice_user n ON s.notice_id = n.notice_id\n" +
            " WHERE DATE(s.create_time) = CURDATE() AND n.user_id = #{userId}")
    List<SysNotice> selectAll(@Param("userId") String userId);
    @Select("SELECT s.* FROM sys_notice s\n" +
            " WHERE DATE(s.create_time) = CURDATE()")
    List<SysNotice> selectAllByAdmin();
}
ltkj-system/src/main/java/com/ltkj/system/service/ISysDeptService.java
@@ -162,4 +162,6 @@
    List<String> getCzDeptIds();
    String getprentks(String deptId);
    List<Long> getDeptTreeById(String deptId);
}
ltkj-system/src/main/java/com/ltkj/system/service/ISysNoticeService.java
@@ -2,6 +2,8 @@
import java.util.List;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ltkj.common.core.domain.AjaxResult;
import com.ltkj.system.domain.SysNotice;
/**
@@ -9,7 +11,7 @@
 *
 * @author ltkj
 */
public interface ISysNoticeService {
public interface ISysNoticeService extends IService<SysNotice> {
    /**
     * 查询公告信息
     *
@@ -57,4 +59,8 @@
     * @return 结果
     */
    public int deleteNoticeByIds(Long[] noticeIds);
    List<SysNotice> selectAllByAdmin();
    List<SysNotice> selectAll(String userId);
}
ltkj-system/src/main/java/com/ltkj/system/service/impl/SysDeptServiceImpl.java
@@ -459,4 +459,9 @@
    public String getprentks(String deptId) {
        return deptMapper.getprentks(deptId);
    }
    @Override
    public List<Long> getDeptTreeById(String deptId) {
        return deptMapper.getDeptTreeById(deptId);
    }
}
ltkj-system/src/main/java/com/ltkj/system/service/impl/SysNoticeServiceImpl.java
@@ -2,6 +2,8 @@
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ltkj.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ltkj.system.domain.SysNotice;
@@ -14,7 +16,7 @@
 * @author ltkj
 */
@Service
public class SysNoticeServiceImpl implements ISysNoticeService {
public class SysNoticeServiceImpl extends ServiceImpl<SysNoticeMapper,SysNotice> implements ISysNoticeService {
    @Autowired
    private SysNoticeMapper noticeMapper;
@@ -83,4 +85,14 @@
    public int deleteNoticeByIds(Long[] noticeIds) {
        return noticeMapper.deleteNoticeByIds(noticeIds);
    }
    @Override
    public List<SysNotice> selectAllByAdmin() {
        return noticeMapper.selectAllByAdmin();
    }
    @Override
    public List<SysNotice> selectAll(String userId) {
        return noticeMapper.selectAll(userId);
    }
}
ltkj-system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -396,5 +396,18 @@
              )}
    </select>
    <select id="getDeptTreeById" resultType="java.lang.Long">
        WITH RECURSIVE dept_tree AS (
            SELECT dept_id
            FROM sys_dept
            WHERE dept_id = #{deptId}
            UNION ALL
            SELECT d.dept_id
            FROM sys_dept d
                     INNER JOIN dept_tree dt ON d.parent_id = dt.dept_id
        )
        SELECT dept_id FROM dept_tree;
    </select>
</mapper>
ltkj-system/src/main/resources/mapper/system/SysNoticeMapper.xml
@@ -27,7 +27,9 @@
               create_time,
               update_by,
               update_time,
               remark
               remark,
               dept_id
        from sys_notice
    </sql>
@@ -53,6 +55,7 @@
    <insert id="insertNotice" parameterType="SysNotice">
        insert into sys_notice (
        <if test="noticeId != null and noticeId != '' ">notice_id,</if>
        <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,6 +64,7 @@
        <if test="createBy != null and createBy != ''">create_by,</if>
        create_time
        )values(
        <if test="noticeId != null and noticeId != '' ">#{noticeId},</if>
        <if test="noticeTitle != null and noticeTitle != ''">#{noticeTitle},</if>
        <if test="noticeType != null and noticeType != ''">#{noticeType},</if>
        <if test="noticeContent != null and noticeContent != ''">#{noticeContent},</if>
@@ -97,4 +101,4 @@
        </foreach>
    </delete>
</mapper>
</mapper>