瀏覽代碼

代码修改

liubing 3 年之前
父節點
當前提交
ed437ec27d

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/dao/label/WlyyPatientLabelDao.java

@ -17,6 +17,6 @@ public interface WlyyPatientLabelDao extends PagingAndSortingRepository<WlyyPati
    @Query("delete WlyyPatientLabelDO a where a.patient=?1 and a.labelType=?2")
    int deleteByPatientAndLabelType(String patient,String labelType) throws Exception;
    @Query("from WlyyPatientLabelDO w where  w.patient=?1 ")
    @Query("from WlyyPatientLabelDO w where  w.patient=?1 group by w.labelType,w.labelCode order by w.czrq desc")
    List<WlyyPatientLabelDO> findByPatient(String patient);
}

+ 10 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/patient/PatientEndpoint.java

@ -298,4 +298,14 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
        }
    }
    @GetMapping(value = "patientIconStatus")
    @ApiOperation("patientIconStatus")
    public ObjEnvelop patientIconStatus(@ApiParam(name="patient")@RequestParam(value = "patient")String patient){
        try {
            return ObjEnvelop.getSuccess("success",patientService.patientIconStatus(patient));
        }catch (Exception e){
            return failedObjEnvelopException2(e);
        }
    }
}

+ 17 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/patient/CarePatientService.java

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.dao.label.WlyyPatientLabelDao;
import com.yihu.jw.care.service.common.DictService;
import com.yihu.jw.care.service.device.DeviceService;
import com.yihu.jw.care.service.family.PatientFamilyMemberService;
import com.yihu.jw.care.service.sign.CapacityAssessmentRecordService;
import com.yihu.jw.care.service.sign.ServicePackageService;
@ -27,6 +28,7 @@ import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.security.MD5;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -67,6 +69,10 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
    private ImUtil imUtil;
    @Autowired
    private BaseDoctorHospitalDao doctorHospitalDao;
    @Value("${wechat.id}")
    private String wxId;
    @Autowired
    private DeviceService deviceService;
    /**
     * 签约记录
@ -611,4 +617,15 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
        }
        patientDao.save(list);
    }
    public Map<String,Object> patientIconStatus(String patient){
        String sql = "SELECT DISTINCT p.id,p.name,p.photo,p.idcard,p.mobile,p.openid,p.sex,p.pad_imei padImei " +
                "from base_patient p INNER JOIN base_patient_wechat wc on p.id = wc.patient_id where p.del=1 and p.id='"+patient+"' and " +
                " wc.wechat_id = '"+wxId+"' GROUP BY p.id ORDER BY wc.create_time desc";
        Map<String,Object> result = jdbcTemplate.queryForMap(sql);
        result.put("deviceType",deviceService.getPatientDeviceCategoryCode(result.get("id").toString()));
        return result;
    }
}