fhx
2024-09-18 c4bd0e006d941d8f83058795937e5110f1301626
1.修改美际资源数据转换显示问题
3个文件已修改
101 ■■■■■ 已修改文件
phi_platform_user/src/main/java/com/hx/phip/controller/meiji/MeiJiDataController.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/micro/MicroRecordController.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/micro/MicroRecordV2Controller.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/meiji/MeiJiDataController.java
@@ -2,10 +2,7 @@
import com.alibaba.fastjson.JSONObject;
import com.hx.common.BaseController;
import com.hx.mybatisTool.SqlSentence;
import com.hx.phiappt.common.enums.MeiJiResourceFileEnum;
import com.hx.phiappt.constants.tool.comparePhoto.ComparePhotoUtil;
import com.hx.phiappt.dao.mapper.MjResourceFileMapper;
import com.hx.phiappt.constants.tool.meiji.MeiJiDataTool;
import com.hx.resultTool.Result;
import com.hx.util.StringUtils;
import com.hz.his.dto.meiji.MeiJiDataDto;
@@ -18,7 +15,6 @@
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.*;
/**
 * 美际数据
@@ -41,35 +37,8 @@
            throw new PlatTipsException(PlatformCode.ERROR_PARAMETER_NULL, "美际皮肤报告标识不能为空!");
        }
        SqlSentence sqlSentence = new SqlSentence();
        Map<String, Object> values = new HashMap<>();
        sqlSentence.setM(values);
        values.put("mjSkinReportId", dto.getMjSkinReportId());
        sqlSentence.setSqlSentence(" select fileName, fileUrl from mj_resource_file where isDel = 0 and mjSkinReportId = #{m.mjSkinReportId} ");
        List<Map<String, Object>> list = commonService.selectListMap(MjResourceFileMapper.class, sqlSentence);
        if(list != null && list.size() > 0){
            String flag;
            for(Map<String, Object> map : list){
                //文件验签访问
                map.put("fileUrl", ComparePhotoUtil.getDecryptImagesUrl(sFileService, map.get("fileUrl").toString()));
                //遍历根据文件名转换展示名和排序号
                flag = map.get("fileName").toString();
                flag = flag.toLowerCase(Locale.ROOT);
                for (MeiJiResourceFileEnum meiJiResourceFileEnum : MeiJiResourceFileEnum.values()) {
                    if (Objects.equals(meiJiResourceFileEnum.getFlag(), flag)){
                        map.put("sortNum", meiJiResourceFileEnum.getSortNum());
                        map.put("showName", meiJiResourceFileEnum.getShowName());
                        break;
                    }
                }
            }
            //排序
            list.sort(Comparator.comparing((Map<String, Object> h) -> ((int) h.get("sortNum"))));
        }
        JSONObject data = new JSONObject();
        data.put("list", list);
        data.put("list", MeiJiDataTool.getMjFileList(commonService, sFileService, dto.getMjSkinReportId()));
        return Result.success(data);
    }
phi_platform_user/src/main/java/com/hx/phip/controller/micro/MicroRecordController.java
@@ -9,9 +9,7 @@
import com.hx.common.service.CommonService;
import com.hx.mybatisTool.SqlSentence;
import com.hx.phiappt.common.BaseClassifyConstants;
import com.hx.phiappt.common.enums.MeiJiResourceFileEnum;
import com.hx.phiappt.constants.tool.UserInfoTool;
import com.hx.phiappt.constants.tool.comparePhoto.ComparePhotoUtil;
import com.hx.phiappt.constants.tool.employee.EmployeeTool;
import com.hx.phiappt.constants.tool.meiji.MeiJiDataTool;
import com.hx.phiappt.constants.tool.shop.ShopTool;
@@ -472,29 +470,7 @@
            mjData.remove("contents");
            //查询对应关联资源文件记录
            values.put("mjSkinReportId", mjData.get("id"));
            sqlSentence.setSqlSentence(" select fileName, fileUrl from mj_resource_file where isDel = 0 and mjSkinReportId = #{m.mjSkinReportId} ");
            List<Map<String, Object>> list = commonService.selectListMap(MjResourceFileMapper.class, sqlSentence);
            if(list != null && list.size() > 0){
                String flag;
                for(Map<String, Object> map : list){
                    //文件验签访问
                    map.put("fileUrl", ComparePhotoUtil.getDecryptImagesUrl(sFileService, map.get("fileUrl").toString()));
                    //遍历根据文件名转换展示名和排序号
                    flag = map.get("fileName").toString();
                    flag = flag.toLowerCase(Locale.ROOT);
                    for (MeiJiResourceFileEnum meiJiResourceFileEnum : MeiJiResourceFileEnum.values()) {
                        if (Objects.equals(meiJiResourceFileEnum.getFlag(), flag)){
                            map.put("sortNum", meiJiResourceFileEnum.getSortNum());
                            map.put("showName", meiJiResourceFileEnum.getShowName());
                            break;
                        }
                    }
                }
                //排序
                list.sort(Comparator.comparing((Map<String, Object> h) -> ((int) h.get("sortNum"))));
                mjData.put("rsList", list);
            }
            mjData.put("rsList", MeiJiDataTool.getMjFileList(commonService, sFileService, MapUtil.getString(mjData, "id")));
        }
    }
phi_platform_user/src/main/java/com/hx/phip/controller/micro/MicroRecordV2Controller.java
@@ -9,9 +9,7 @@
import com.hx.exception.TipsException;
import com.hx.mybatisTool.SqlSentence;
import com.hx.phiappt.common.BaseClassifyConstants;
import com.hx.phiappt.common.enums.MeiJiResourceFileEnum;
import com.hx.phiappt.constants.tool.UserInfoTool;
import com.hx.phiappt.constants.tool.comparePhoto.ComparePhotoUtil;
import com.hx.phiappt.constants.tool.employee.EmployeeTool;
import com.hx.phiappt.constants.tool.meiji.MeiJiDataTool;
import com.hx.phiappt.constants.tool.shop.ShopTool;
@@ -679,7 +677,7 @@
            }
            data.put("mjSkinReport",mjSkinReport);
            //查询对应关联资源文件记录
            data.put("rsList",getMjFileList(mjRecordId));
            data.put("rsList", MeiJiDataTool.getMjFileList(commonService, sFileService, mjRecordId));
            //查询治疗方案
            Map<String, List<MicroPlanItem>> microPlanItemMap = new HashMap<>();
@@ -1162,47 +1160,13 @@
        mjData.put("treatPlanItemList", treatPlanItemListMap);
        //查询对应关联资源文件记录
        List<Map<String, Object>> rsList = getMjFileList(mjData.get("id").toString());
        List<Map<String, Object>> rsList = MeiJiDataTool.getMjFileList(commonService, sFileService, mjData.get("id").toString());
        if (rsList != null && rsList.size() > 0){
            mjData.put("rsList", rsList);
        }
        return mjData;
    }
    /**查询美际文件资料*/
    private List<Map<String, Object>> getMjFileList(String id) {
        if (StringUtils.isEmpty(id)){
            return new ArrayList<>();
        }
        Map<String, Object> values = new HashMap<>();
        values.put("mjSkinReportId",id);
        SqlSentence sqlSentence = new SqlSentence();
        sqlSentence.sqlSentence(" SELECT id,fileName,fileUrl FROM mj_resource_file WHERE isDel = 0 AND mjSkinReportId = #{m.mjSkinReportId} ", values);
        List<Map<String, Object>> rsList = commonService.selectListMap(MjResourceFileMapper.class, sqlSentence);
        if (rsList != null && rsList.size() > 0) {
            //美际资源文件标识
            String flag;
            for (Map<String, Object> map : rsList) {
                //文件验签访问
                map.put("fileUrl", ComparePhotoUtil.getDecryptImagesUrl(sFileService, map.get("fileUrl").toString()));
                //遍历根据文件名转换展示名和排序号
                flag = map.get("fileName").toString();
                flag = flag.toLowerCase(Locale.ROOT);
                for (MeiJiResourceFileEnum meiJiResourceFileEnum : MeiJiResourceFileEnum.values()) {
                    if (Objects.equals(meiJiResourceFileEnum.getFlag(), flag)) {
                        map.put("sortNum", meiJiResourceFileEnum.getSortNum());
                        map.put("showName", meiJiResourceFileEnum.getShowName());
                        break;
                    }
                }
            }
            //排序
            rsList.sort(Comparator.comparing((Map<String, Object> h) -> ((int) h.get("sortNum"))));
        }
        return rsList;
    }
    /**