Browse Source

bug对应

zdm 6 years ago
parent
commit
e1371eb626

+ 31 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java

@ -1040,6 +1040,13 @@ public class SpecialistService{
     * @throws Exception
     */
    public ObjEnvelop<SpecialistPatientRelationDO> createPatientInSpeciaRelation(SpecialistPatientRelationDO specialistPatientRelationDO) throws Exception {
        if(StringUtils.isNotEmpty(specialistPatientRelationDO.getId())){
            //获取
            Map<String,Object> m=  getMessageByRelationId(specialistPatientRelationDO.getId());
            if(null!=m){
                updateMessageByRelationId(specialistPatientRelationDO.getId());
            }
        }
        specialistPatientRelationDO.setSignStatus("1");
        specialistPatientRelationDO.setSignDate(new Date());
        specialistPatientRelationDO.setCreateTime(new Date());
@ -1170,4 +1177,28 @@ public class SpecialistService{
        SpecialistPatientRelationDO specialistPatientRelationDO=null!=relationDOS&&relationDOS.size()>0?relationDOS.get(0):new SpecialistPatientRelationDO();
        return specialistPatientRelationDO;
    }
    /**
     * 根据签约关系id获取消息
     * @param relationId
     * @return
     */
    public Map<String,Object> getMessageByRelationId(String relationId){
        String sql = "select w.* from wlyy_message w where w.type='16' and  w.relation_code='" + relationId + "' ";
       List<Map<String,Object>> res= jdbcTemplate.queryForList(sql);
       if(null!=res&&res.size()>0){
           return res.get(0);
       }
       return null;
    }
    /**
     * 更新消息
     * @param relationId
     * @return
     */
    public void updateMessageByRelationId(String relationId){
        String sql = "update wlyy_message set has_read=0 ,over=0  where relation_code='" + relationId + "' ";
        jdbcTemplate.execute(sql);
    }
}