浏览代码

我的消息列表代码提交

liuwenbin 6 年之前
父节点
当前提交
45378b8884

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/message/dao/MessageDao.java

@ -26,4 +26,6 @@ public interface MessageDao extends PagingAndSortingRepository<BaseMessageDO, St
    @Query("update BaseMessageDO t set t.readState = ?1 where t.id=?2 ")
    int updateStatusById(Integer readState,Integer id);
//    List<BaseMessageDO> getBy(String receiver,String sender,String msgTypeCode,Integer platform);
}

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/message/service/MessageService.java

@ -74,6 +74,7 @@ public class MessageService extends BaseJpaService<BaseMessageDO, MessageDao> {
        List<Map<String, Object>> unReadResult = messageListSql(platform,code,0,page,unReadPageSize);
        for(Map<String, Object> one:unReadResult){
            Map<String,Object> unReadMap = new HashedMap();
            unReadMap.put("patientCode",one.get("sender"));
            unReadMap.put("name",one.get("sender_name"));
            unReadMap.put("count",one.get("num"));
            unReadMap.put("message",one.get("msg_content"));
@ -85,6 +86,7 @@ public class MessageService extends BaseJpaService<BaseMessageDO, MessageDao> {
            List<Map<String, Object>> readResult = messageListSql(platform,code,1,page,unReadPageSize);
            for(Map<String, Object> one:readResult){
                Map<String,Object> readMap = new HashedMap();
                readMap.put("patientCode",one.get("sender"));
                readMap.put("name",one.get("sender_name"));
                readMap.put("count",one.get("num"));
                readMap.put("message",one.get("msg_content"));

+ 2 - 2
business/base-service/src/main/java/com/yihu/jw/patient/dao/BasePatientDao.java

@ -15,7 +15,7 @@ import java.util.Map;
 */
public interface BasePatientDao extends PagingAndSortingRepository<BasePatientDO, String>, JpaSpecificationExecutor<BasePatientDO> {
    BasePatientDO findByIdAndDel(String id, String del);
    BasePatientDO findById(String id);
    @Query("select id as id,idcard as idcard,name as name,case sex when 1 then '男' when 2 then '女' else '未知' end as sex,mobile as phone,committeeName as committeeName,concat(provinceName,cityName,townName,streetName) as address from BasePatientDO where idcard like ?1")
    List<Map<String,Object>> findByIdcard(String idcard, Pageable pageable);
@ -28,7 +28,7 @@ public interface BasePatientDao extends PagingAndSortingRepository<BasePatientDO
    boolean existsByIdcardAndIdNot(String idcard,String id);
    boolean existsByIdcardAndDel(String idcard,Integer del);
    boolean existsByIdcardAndDel(String idcard,String del);
    @Query("from BasePatientDO where mobile = ?1")
    List<BasePatientDO> findByMobile(String mobile);

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java

@ -169,7 +169,7 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
     * @return
     */
    public BasePatientDO findByIdAndDel(String patient) throws Exception{
        BasePatientDO basePatientDO = basePatientDao.findByIdAndDel(patient,"1");
        BasePatientDO basePatientDO = basePatientDao.findById(patient);
        if(basePatientDO==null){
            throw new Exception("not patient");
        }

+ 4 - 0
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/message/MyMessageService.java

@ -25,4 +25,8 @@ public class MyMessageService {
        messageService.updateStatusById(readState,id);
    }
    public void messagedetailList(Integer type,String reciever,String sender){
        
    }
}

+ 1 - 1
svr/svr-patient/src/main/java/com/yihu/jw/patient/service/personal_Info/PatientService.java

@ -295,7 +295,7 @@ public class PatientService extends BasePatientService<BasePatientDO, BasePatien
     */
    public boolean existsByIdcard(String idcard) {
        Preconditions.checkNotNull(idcard, "身份证不可为空");
        return basePatientDao.existsByIdcardAndDel(idcard,1);
        return basePatientDao.existsByIdcardAndDel(idcard,"1");
    }