Просмотр исходного кода

Merge branch 'dev' of yeshijie/patient-co-management into dev

chenweida 7 лет назад
Родитель
Сommit
67b43e6392

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java

@ -67,6 +67,9 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("select count(a) from Message a where a.read = 0 and a.over ='0'  and a.receiver=?1 and a.type=?2 ")
    int findMessageNum(String doctor, Integer type);
    @Query("update Message a set a.prescriptionStatus=?2 where a.relationCode = ?1 and a.type=6 ")
    int updatePreScriptionMessage(String relateCode,String prescriptionStatus);
    @Query("update Message a set a.read = 0,a.over = '0' where a.receiver = ?1 and a.type = ?2")
    @Modifying
    int setMessageReaded(String doctor,Integer type);

+ 8 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -1,23 +1,21 @@
package com.yihu.wlyy.service.app.prescription;
import com.yihu.wlyy.util.HttpUtil;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
import com.yihu.wlyy.wechat.util.WeiXinMessageUtils;
import org.json.JSONObject;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.prescription.*;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.prescription.*;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpUtil;
import com.yihu.wlyy.util.ImUtill;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -59,6 +57,8 @@ public class PrescriptionInfoService extends BaseService {
    private PrescriptionNoticesService prescriptionNoticesService;
    @Autowired
    private ImUtill imUtill;
    @Autowired
    private MessageDao messageDao;
    private static final Logger logger = LoggerFactory.getLogger(HttpUtil.class);
@ -398,6 +398,9 @@ public class PrescriptionInfoService extends BaseService {
                reviewed.setReviewedTime(new Date());
                reviewed.setStatus(PrescriptionReviewed.PrescriptionReviewedStatus.del.getValue());
                //修改系统的续方消息的审核状态
                messageDao.updatePreScriptionMessage(code,"2");
                //审核不用过发送消息
                //发送Im消息
                JSONObject content = new JSONObject();

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/TokenService.java

@ -26,7 +26,7 @@ public class TokenService extends BaseService {
	 * 生成token
	 * @param user 用户标识
	 * @param imei 手机IMEI码
	 * @param platform 1患者,2医生,3患者微信公众号
	 * @param platform 1患者,2医生,3患者微信公众号,4pc端医生
	 * @return
	 * @throws Exception
	 */
@ -49,7 +49,7 @@ public class TokenService extends BaseService {
		token.setUser(user);
		token.setCzrq(czrq);
		// 先删除防止重复
		tokenDao.deleteByUser(user);
		tokenDao.deleteByUserAndPlatform(user,platform);
		// 添加新的token
		token = tokenDao.save(token);
		if (token == null) {