ソースを参照

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

chenyongxing 7 年 前
コミット
5e8d7ae9f8

+ 3 - 3
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionInfo.java

@ -23,7 +23,7 @@ public class PrescriptionInfo extends IdEntity{
    private String drugRate;               //吃药频率
    private String drugRateName;          //用药频次名称
    private String drugFormat;             //药品规格
    private Integer num;                    //药品数目
    private Integer num;                    //药品总量(用来计算价格)
    private Integer isRefrigerate;         //是否冷藏 1是 0否
    private String direction;               //药品用法
    private Integer price;                    //药品单价 单位是分
@ -31,7 +31,7 @@ public class PrescriptionInfo extends IdEntity{
    private String jwSubCode;//智业子处方号
    private String drugNumUnit;//数量单位编码
    private String drugNumUnitName;//数量单位名称
    private Integer cost;//金额 单位是分
    private Integer cost;//计算总额(num*price) 单位是分
    private Integer charge;//自付 单位是分
    private String bindFlag;//成组标志, 0.非成组,1.成组
    private Integer dayCount;//用药天数
@ -40,7 +40,7 @@ public class PrescriptionInfo extends IdEntity{
    private String physicDose;//用药剂量
    private String physicDoseUnit;//剂量单位编码
    private String physicDoseUnitName;//剂量单位名称
    private String physicAmount;//用药总量
    private String physicAmount;//用药总量(实际用药量)
    private String physicAmountUnit;//总量单位编码
    private String physicAmountUnitName;//总量单位名称
    private String physicInjectPlace;//注射地点编码

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

@ -259,6 +259,22 @@ public class PrescriptionService extends ZysoftBaseService{
                    prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue());
                    prescriptionDao.save(prescription);
                    //新增log表
                    PrescriptionLog log = new PrescriptionLog();
                    log.setPrescriptionCode(prescription.getCode());
                    log.setCode(getCode());
                    log.setCreateTime(new Date());
                    log.setType(PrescriptionLog.PrescriptionLogType.zy.getValue());
                    log.setUserType(2);
                    log.setHospital(prescription.getHospital());
                    log.setHospitalName(prescription.getHospitalName());
                    log.setUserName(prescription.getDoctorName());
                    log.setFlag(1);
                    log.setRemark("配药成功");
                    log.setUserCode(prescription.getDoctor());
                    log.setStatus(PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue());
                    prescriptionLogDao.save(log);
                }
                //判断健管师配送要添加续方消息,提示健管师有续方代配送

+ 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>

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

@ -78,6 +78,9 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Modifying
    int setSysMessageReaded(String doctor);
    @Query("from Message a where a.receiver = ?1 and relationCode = ?2 and a.type=?3 ")
    List<Message> findByReceiverAndRelationCode(String receiver,String relationCode,Integer type);
    //查询患者最近7天的体征异常记录
    @Query(value = "SELECT COUNT(1) FROM wlyy_message WHERE type = '2' and sender = ?1 and create_time>=date_add(now(),interval -7 day) ", nativeQuery = true)
    int findTzMessage(String patient);

+ 8 - 12
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
@ -300,20 +295,18 @@ public class PrescriptionExpressageService {
     * 全科医生分配健管师
     *
     * @param code             健管师code
     * @param name             健管师名称
     * @param mobile           健管师联系电话
     * @param prescriptionCode 处方code
     * @param doctorQK         分配的全科
     */
    @Transactional
    public void updateExpressageJGS(String code, String name, String mobile, String prescriptionCode, String doctorQK) {
    public void updateExpressageJGS(String code, String prescriptionCode, String doctorQK) {
        Doctor doctor = doctorDao.findByCode(code);
        Hospital hospital = hospitalDao.findByCode(doctor.getHospital());
        //更新配送表 新增配送人员记录
        PrescriptionExpressage prescriptionExpressage = prescriptionExpressageDao.findByPrescriptionPay(prescriptionCode);
        prescriptionExpressage.setExpressageCode(code);
        prescriptionExpressage.setExpressageMobile(mobile);
        prescriptionExpressage.setExpressageName(name);
        prescriptionExpressage.setExpressageMobile(doctor.getMobile());
        prescriptionExpressage.setExpressageName(doctor.getName());
        prescriptionExpressage.setExpressageHospitalAddress(hospital.getAddress());
        prescriptionExpressage.setExpressageHospitalCode(doctor.getHospital());
        prescriptionExpressage.setExpressageHospitalName(doctor.getHospitalName());
@ -330,6 +323,9 @@ public class PrescriptionExpressageService {
        prescriptionLog.setUserType(2);
        prescriptionLog.setRemark("团队长分配健管师配送");
        prescriptionLogDao.save(prescriptionLog);
        //提醒健管师待取药
        prescriptionService.waitExpressageMessage(prescriptionCode,code);
    }
    @Transactional

ファイルの差分が大きいため隠しています
+ 397 - 377
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java


+ 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 医保卡号

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionExpressageController.java

@ -42,7 +42,7 @@ public class PrescriptionExpressageController extends WeixinBaseController {
            @ApiParam(required = true, name = "mobile", value = "健管师code") @RequestParam(value = "mobile", required = true) String mobile,
            @ApiParam(required = true, name = "prescriptionCode", value = "处方code") @RequestParam(value = "prescriptionCode", required = true) String prescriptionCode) throws Exception {
        try {
            expressageService.updateExpressageJGS(code, name, mobile, prescriptionCode, getUID());
            expressageService.updateExpressageJGS(code, prescriptionCode, getUID());
            return success("修改成功");
        } catch (Exception e) {
            return error(-1, "获取失败");

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.doctor.prescription;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.adapter.PresModeAdapter;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
@ -16,7 +17,6 @@ import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -171,7 +171,7 @@ public class PrescriptionInfoController extends BaseController {
    public String prescriptionFollow(
            @RequestParam(required = true) @ApiParam(value = "处方code", name = "prescriptionCode") String prescriptionCode) {
        try {
            net.sf.json.JSONObject jo = new net.sf.json.JSONObject();
           JSONObject jo = new JSONObject();
            //获取处方信息
            Prescription prescription = prescriptionService.findByCode(prescriptionCode);
            //获取处方药品信息
@ -331,7 +331,7 @@ public class PrescriptionInfoController extends BaseController {
             @RequestParam(required = true) @ApiParam(value = "健康管理师Code", name = "healthDoctor") String
                     healthDoctor) {
        try {
            return write(200, "操作成功!", "data", prescriptionInfoService.distributionHealthDoctor(codes, healthDoctor));
            return write(200, "操作成功!", "data", prescriptionInfoService.distributionHealthDoctor(codes, healthDoctor,getUID()));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.patient.prescription;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExpressage;
@ -13,7 +14,6 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.axis.encoding.Base64;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
@ -227,7 +227,7 @@ public class PatientPrescriptionController extends WeixinBaseController {
    public String prescriptionFollow(
            @RequestParam(required = true) @ApiParam(value = "处方code", name = "prescriptionCode") String prescriptionCode) {
        try {
            net.sf.json.JSONObject jo = new net.sf.json.JSONObject();
            JSONObject jo = new JSONObject();
            //获取处方信息
            Prescription prescription = prescriptionService.findByCode(prescriptionCode);
            //获取处方药品信息