Kaynağa Gözat

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

yeshijie 7 yıl önce
ebeveyn
işleme
ca811123f5

+ 9 - 9
patient-co/patient-co-wlyy/pom.xml

@ -422,15 +422,15 @@
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <!--<configuration>-->
                    <!--<source>1.8</source>-->
                    <!--<target>1.8</target>-->
                    <!--<compilerArguments>-->
                        <!--<verbose/>-->
                        <!--<bootclasspath>${java.home}/lib/rt.jar:${java.home}/lib/jce.jar</bootclasspath>-->
                    <!--</compilerArguments>-->
                <!--</configuration>-->
                <version>3.6.2</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <compilerArguments>
                        <verbose/>
                        <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
                    </compilerArguments>
                </configuration>
                <version>3.1</version>
            </plugin>
        </plugins>
        <resources>

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

@ -2,7 +2,6 @@ package com.yihu.wlyy.service.app.prescription;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.organization.Hospital;
import com.yihu.wlyy.entity.organization.HospitalDept;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.prescription.*;
import com.yihu.wlyy.repository.doctor.DoctorDao;
@ -10,18 +9,13 @@ import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.prescription.*;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.SystemConf;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
/**
 * Created by chenweida on 2017/7/27.
@ -41,7 +35,8 @@ public class PrescriptionExpressageService {
    private PrescriptionNoticesService prescriptionNoticesService;
    @Autowired
    private PrescriptionExpressageLogDao prescriptionExpressageLogDao;
    @Autowired
    private PrescriptionService prescriptionService;
    @Autowired
    private DoctorDao doctorDao;
    @Autowired
@ -328,6 +323,9 @@ public class PrescriptionExpressageService {
        prescriptionLog.setUserType(2);
        prescriptionLog.setRemark("团队长分配健管师配送");
        prescriptionLogDao.save(prescriptionLog);
        //提醒健管师待取药
        prescriptionService.waitExpressageMessage(prescriptionCode,code);
    }
    @Transactional

+ 46 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java

@ -132,6 +132,52 @@ public class PrescriptionService extends BaseService {
        logger.info("配药完成,提示居民或健管师取药:"+code+",status="+prescription.getStatus());
    }
    /**
     * 提醒健管师待取药
     * @param code
     * @param healthDoctor
     */
    public void waitExpressageMessage(String code,String healthDoctor){
        try{
            Prescription prescription = prescriptionDao.findByCode(code);
            if(PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue()==prescription.getStatus()){
                //配药完成之后才分配健管师,分配健管师后,提示健管师待取药
                List<Message> list = messageDao.findByReceiverAndRelationCode(healthDoctor,code,7);
                if(list.size()==0){
                    PrescriptionExpressage expressage = prescriptionExpressageDao.findByPrescriptionCode(code);
                    if(StringUtils.isNotBlank(expressage.getExpressageCode())){
                        String content = "您有一条新的续方订单待取药!";
                        Message message = new Message();
                        message.setCzrq(new Date());
                        message.setCreateTime(new Date());
                        message.setRead(1);//设置未读
                        message.setOver("1");
                        message.setReceiver(expressage.getExpressageCode());
                        message.setSender("system");
                        message.setCode(getCode());
                        message.setSenderName("系统");
                        message.setTitle("居民"+prescription.getPatientName()+"的续方订单待取药");
                        message.setContent("您有一条新的续方订单待取药!");
                        message.setType(7);//续方订单待取药
                        message.setReadonly(1);//是否只读消息
                        message.setDel("1");
                        message.setRelationCode(prescription.getCode());
                        message.setPrescriptionStatus("0");//待取药
                        //获取居民团队code
                        DoctorTeam dt = doctorTeamDao.findByParientCode(prescription.getPatient());
                        message.setData(dt.getCode());
                        messageDao.save(message);
                        pushMsgTask.put(expressage.getExpressageCode(), MessageType.MESSAGE_TYPE_PRESCRIPTION_WAIT_TAKE_DRUG.D_P_WRD.name(), MessageType.MESSAGE_TYPE_PRESCRIPTION_WAIT_TAKE_DRUG.续方消息.name(), content, prescription.getCode());
                    }
                }
            }
        }catch (Exception e){
            e.printStackTrace();
            logger.info("提醒健管师待取药,消息新增失败");
        }
    }
    /**
     * 返回支付信息
     * @param cardNo 医保卡号