fhx
2024-08-14 d8c79f56b0fa8fba176d92f835511535ce71d557
Merge branch 'fhx-base-治疗单改版0729' into master-test
1个文件已修改
30 ■■■■■ 已修改文件
phi_platform_user/src/main/java/com/hx/phip/controller/treat/TreatDataController.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
phi_platform_user/src/main/java/com/hx/phip/controller/treat/TreatDataController.java
@@ -1,5 +1,7 @@
package com.hx.phip.controller.treat;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@@ -7,21 +9,27 @@
import com.hx.exception.TipsException;
import com.hx.guide.util.AuthUtil;
import com.hx.mybatisTool.SqlSentence;
import com.hx.phiappt.common.LabelAscriptionConstants;
import com.hx.phiappt.common.TreatSingleConstants;
import com.hx.phiappt.dao.mapper.*;
import com.hx.phiappt.model.BaseEntity;
import com.hx.resultTool.Result;
import com.hx.util.DateUtil;
import com.hx.util.MapUtil;
import com.hx.util.StringUtils;
import com.hz.his.dto.treat.TreatSingleQueryDto;
import com.hz.his.feign.service.phis.SLabelService;
import com.hz.his.vo.label.LabelFindVo;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * 治疗单数据
@@ -31,6 +39,9 @@
@RestController
@RequestMapping("/treat/single/data")
public class TreatDataController extends BaseController {
    @Resource
    private SLabelService sLabelService;
    /** 治疗单列表 */
    @RequestMapping(value = "/list")
@@ -202,8 +213,8 @@
                .append(" , ts.drugStatus, ts.isUserSign, ts.isWillPhoto, ts.isRd, ts.isFirstFm  ")
                .append(" , ts.aDoctorName as doctorName, ts.aNurseName as nurseName, ts.anStatus, ts.orderClassify ")
                .append(" , ts.remarkInfo, ts.allergyInfo, ts.aRemark, ts.roomName ")
                .append(" , DATE_FORMAT(ts.createTime, '%H:%i %m/%d') AS createTime ")
                .append(" , o.userId, u.name as userName, u.CIQ, u.userLevel ")
                .append(" , DATE_FORMAT(ts.createTime, '%Y-%m-%d %H:%i:%s') AS createTime ")
                .append(" , o.userId, u.name as userName, u.CIQ, u.userLevel, u.gender ")
                .append(" , t.treatEndTime ")
                .append(" from treat_single ts ")
                .append(" left join v_visit_order o on o.id = ts.visitOrderId ")
@@ -218,6 +229,21 @@
            throw new TipsException("查询不到治疗单信息!");
        }
        //查询用户标签
        String userId = MapUtil.getString(dataMap, "userId");
        List<String> labelList = null;
        LabelFindVo labelFindVo = new LabelFindVo();
        labelFindVo.setRangeCodeNew(LabelAscriptionConstants.TYPE_USER_EXPERIENCE);
        labelFindVo.setUserId(userId);
        Result result = sLabelService.getLabelUserLabel(labelFindVo);
        if(result.checkCode()){
            JSONArray arr = JSONArray.parseArray(JSON.toJSONString(result.getData()));
            if(arr != null && arr.size() > 0){
                labelList = arr.stream().map(s->((JSONObject) s).getString("name")).collect(Collectors.toList());
            }
        }
        dataMap.put("labelList", labelList);
        //治疗单签名信息
        sqlSentence.setSqlSentence(" select signPerType, signPerName, signImg, opMan from treat_single_sign s where isDel = 0 and treatSingleId = #{m.id} order by sortNo asc ");
        List<Map<String, Object>> signList = commonService.selectListMap(TreatSingleSignMapper.class, sqlSentence);