liusheng
2024-07-04 bfdc738a7d11d7a132747c52fe51f6887405fae4
代码提交
已修改4个文件
100 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/HeLibraryController.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/HeLibraryServiceImpl.java 64 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/HeLibraryController.java
@@ -69,7 +69,7 @@
     * 获取宣教资料库详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:library:query')")
    @GetMapping(value = "/{id}")
    @GetMapping(value = "/getInfo/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(heLibraryService.selectHeLibraryById(id));
    }
@@ -79,7 +79,7 @@
     */
    @PreAuthorize("@ss.hasPermi('system:library:add')")
    @Log(title = "宣教资料库", businessType = BusinessType.INSERT)
    @PostMapping
    @PostMapping("/add")
    public AjaxResult add(@RequestBody HeLibrary heLibrary) {
        return toAjax(heLibraryService.insertHeLibrary(heLibrary));
    }
@@ -89,7 +89,7 @@
     */
    @PreAuthorize("@ss.hasPermi('system:library:edit')")
    @Log(title = "宣教资料库", businessType = BusinessType.UPDATE)
    @PutMapping
    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody HeLibrary heLibrary) {
        return toAjax(heLibraryService.updateHeLibrary(heLibrary));
    }
@@ -110,8 +110,8 @@
     */
    @ApiOperation("新增或修改宣教详情")
    @PreAuthorize("@ss.hasPermi('system:script:list')")
    @PostMapping("/saveOrUpdateScript")
    public AjaxResult saveOrUpdateScript(@RequestBody HeLibraryVO heLibraryVO) {
    @PostMapping("/saveOrUpdateHeLibrary")
    public AjaxResult saveOrUpdateHeLibrary(@RequestBody HeLibraryVO heLibraryVO) {
        if (ObjectUtils.isEmpty(heLibraryVO)) {
            throw new BaseException("入参为空,请检查入参");
        }
smartor/src/main/java/com/smartor/service/impl/HeLibraryServiceImpl.java
@@ -113,38 +113,38 @@
            i = heLibraryMapper.updateHeLibrary(heLibrary);
        }
        log.info("新增或修改宣教详情的id为:{}", heLibrary.getId());
        //对标签进行处理
        for (HeLibraryTag heLibraryTag : heLibraryVO.getHeLibraryTagList()) {
            if (heLibraryTag.getIsoperation() != null && heLibraryTag.getIsoperation() == 1) {
                //新增
                heLibraryTag.setHeid(heLibrary.getId());
                heLibraryTagMapper.insertHeLibraryTag(heLibraryTag);
            } else if (heLibraryTag.getIsoperation() != null && heLibraryTag.getIsoperation() == 2) {
                //修改
                heLibraryTag.setHeid(heLibrary.getId());
                heLibraryTagMapper.updateHeLibraryTag(heLibraryTag);
            } else if (heLibraryTag.getIsoperation() != null && heLibraryTag.getIsoperation() == 3) {
                //删除
                if (heLibraryTag.getId() == null) {
                    log.info("删除失败,模板指标id为空");
                } else {
                    heLibraryTagMapper.deleteHeLibraryTagById(heLibraryTag.getId());
                }
            }
        }
        //对科室进行处理
        for (TempDetpRelevance tempDetpRelevance : heLibraryVO.getTempDetpRelevances()) {
            if (tempDetpRelevance.getId() == null) {
                //新增
                tempDetpRelevance.setTempid(heLibrary.getId());
                tempDetpRelevance.setType(3L);
                tempDetpRelevanceMapper.insertTempDetpRelevance(tempDetpRelevance);
            } else {
                tempDetpRelevanceMapper.updateTempDetpRelevance(tempDetpRelevance);
            }
        }
//
//        //对标签进行处理
//        for (HeLibraryTag heLibraryTag : heLibraryVO.getHeLibraryTagList()) {
//            if (heLibraryTag.getIsoperation() != null && heLibraryTag.getIsoperation() == 1) {
//                //新增
//                heLibraryTag.setHeid(heLibrary.getId());
//                heLibraryTagMapper.insertHeLibraryTag(heLibraryTag);
//            } else if (heLibraryTag.getIsoperation() != null && heLibraryTag.getIsoperation() == 2) {
//                //修改
//                heLibraryTag.setHeid(heLibrary.getId());
//                heLibraryTagMapper.updateHeLibraryTag(heLibraryTag);
//            } else if (heLibraryTag.getIsoperation() != null && heLibraryTag.getIsoperation() == 3) {
//                //删除
//                if (heLibraryTag.getId() == null) {
//                    log.info("删除失败,模板指标id为空");
//                } else {
//                    heLibraryTagMapper.deleteHeLibraryTagById(heLibraryTag.getId());
//                }
//            }
//        }
//
//        //对科室进行处理
//        for (TempDetpRelevance tempDetpRelevance : heLibraryVO.getTempDetpRelevances()) {
//            if (tempDetpRelevance.getId() == null) {
//                //新增
//                tempDetpRelevance.setTempid(heLibrary.getId());
//                tempDetpRelevance.setType(3L);
//                tempDetpRelevanceMapper.insertTempDetpRelevance(tempDetpRelevance);
//            } else {
//                tempDetpRelevanceMapper.updateTempDetpRelevance(tempDetpRelevance);
//            }
//        }
        return i;
    }
smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java
@@ -133,13 +133,13 @@
        if (CollectionUtils.isNotEmpty(patArchiveVO.getTagList())) {
            //处理标签(新增、删除)
            for (PatArchivetag patArchivetag : patArchiveVO.getTagList()) {
                if (patArchivetag.getIsoperation() != null && patArchivetag.getIsoperation() == 1) {
                if (patArchivetag.getIsoperation() != null && patArchivetag.getIsoperation() == 1 || patArchivetag.getIsoperation() == null && patArchiveVO.getIsoperation() == 1) {
                    //新增
                    patArchivetag.setUpdateBy(null);
                    patArchivetag.setCreateTime(new Date());
                    patArchivetag.setPatid(patArchive.getPatid());
                    patArchivetagMapper.insertPatArchivetag(patArchivetag);
                } else if (patArchivetag.getIsoperation() != null && patArchivetag.getIsoperation() == 3) {
                } else if (patArchivetag.getIsoperation() != null && patArchivetag.getIsoperation() == 3 || patArchivetag.getIsoperation() == null && patArchiveVO.getIsoperation() == 3) {
                    patArchivetag.setDelFlag("1");
                    //删除
                    log.info("标签的id为:{}", patArchivetag.getTagid());
smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -225,11 +225,9 @@
    <select id="selectPatArchiveInfoByAllhosp" parameterType="com.smartor.domain.PatArchiveReq"
            resultMap="PatArchiveResult">
        select
        c.tagname as tag,
        b.tagid as tagid,
        SELECT
        a.patid,
        a.name,
        a.NAME,
        a.sex,
        a.nation,
        a.native_place,
@@ -254,22 +252,24 @@
        a.isupload,
        a.upload_time,
        a.viptype,
        a.pattype
        from pat_archive a,pat_archivetag b ,base_tag c
        a.pattype,
        b.tagname AS tag,
        b.tagid AS tagid
        FROM
        pat_archive a
        LEFT JOIN pat_archivetag b ON a.patid = b.patid AND b.del_flag = 0
        <where>
            a.patid = b.patid and b.tagid = c.tagid
            a.del_flag = 0
            <if test="name != null  and name != ''">and a.name like concat('%', #{name}, '%')</if>
            <if test="idcardno != null  and idcardno != ''">and a.idcardno = #{idcardno}</if>
            <if test="pid != null  and pid != ''">and a.patid = #{pid}</if>
            <if test="telcode != null  and telcode != ''">and a.telcode = #{telcode}</if>
            <if test="tagIds != null  and tagIds != ''">and c.tagid in
            <if test="tagIds != null  and tagIds != ''">and b.tagid in
                <foreach collection="tagIds" item="tagId" open="(" separator="," close=")">
                    #{tagId}
                </foreach>
            </if>
            AND b.del_flag != 1
            AND c.del_flag != 1
            AND a.del_flag != 1
        </where>
    </select>