| | |
| | | |
| | | 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; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 美际数据 |
| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | 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"))); |
| | | } |
| | | } |
| | | |
| | |
| | | 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; |
| | |
| | | } |
| | | data.put("mjSkinReport",mjSkinReport); |
| | | //查询对应关联资源文件记录 |
| | | data.put("rsList",getMjFileList(mjRecordId)); |
| | | data.put("rsList", MeiJiDataTool.getMjFileList(commonService, sFileService, mjRecordId)); |
| | | |
| | | //查询治疗方案 |
| | | Map<String, List<MicroPlanItem>> microPlanItemMap = new HashMap<>(); |
| | |
| | | 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; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |