Преглед изворни кода

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

trick9191 пре 7 година
родитељ
комит
9f8829df2b

+ 11 - 2
common/common-entity/src/main/java/com/yihu/wlyy/entity/call/CallRecord.java

@ -18,7 +18,7 @@ public class CallRecord extends IdEntity {
    private Integer type; //1.呼入,2.呼出
    private String  callerNumber; //主叫号码
    private String  recipientNumber;//被叫号码
    private Integer  answerStatus;//接听状态: 1.接通,2. 队列中放弃,3.接通
    private Integer  answerStatus;//接听状态: 1.接通,2. 队列中放弃,3.未接通
    private Integer  serviceType; //服务类型:1.医生转接 2.代理咨询
    private String  serviceContent; //服务内容
    private Date createTime; //创建时间
@ -34,7 +34,8 @@ public class CallRecord extends IdEntity {
    private String  ssc; //社保卡号
    private String  doctor; //签约医生code
    private String  doctorName; //签约医生姓名
    private Long  adminTeamCode;
    private Long  adminTeamCode; //团队id
    private Integer transferState;//转接状态1.成功 2.失败
    public String getCode() {
        return code;
@ -205,4 +206,12 @@ public class CallRecord extends IdEntity {
    public void setAdminTeamCode(Long adminTeamCode) {
        this.adminTeamCode = adminTeamCode;
    }
    public Integer getTransferState() {
        return transferState;
    }
    public void setTransferState(Integer transferState) {
        this.transferState = transferState;
    }
}

+ 1 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/call/CallService.java

@ -14,7 +14,7 @@ import java.util.Date;
@Table(name = "manage_call_service")
public class CallService extends IdEntity {
    private String code; //服务编号
    private String code; //服务编号.
    private String callCode; //关联通话记录
    private String patient; //服务对象(患者code)
    private String patientName; // 服务对象名称(患者名称)

+ 3 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/common/account/CustomerController.java

@ -231,9 +231,10 @@ public class CustomerController extends BaseController {
    public String  updateCallRecordService(@ApiParam(name="code",value="通话记录code")@RequestParam(required = true)String code,
                                           @ApiParam(name="phone",value="服务对象电话号码")@RequestParam(required = true)String phone,
                                           @ApiParam(name="serviceType",value="服务类型:1.医生转接 2.代理咨询")@RequestParam(required = true)Integer serviceType,
                                           @ApiParam(name="serviceContent",value="服务内容")@RequestParam(required = false) String serviceContent){
                                           @ApiParam(name="serviceContent",value="服务内容")@RequestParam(required = false) String serviceContent,
                                           @ApiParam(name="transferState",value="1.成功,2.失败")@RequestParam(required = true) Integer transferState){
        try {
            return write(200,"保存成功","data",customerService.updateCallRecordService(code,phone,serviceType,serviceContent));
            return write(200,"保存成功","data",customerService.updateCallRecordService(code,phone,serviceType,serviceContent,transferState));
        }catch (Exception e){
            error(e);
            return error(-1,"保存失败");

+ 10 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/call/CallRecord.java

@ -34,7 +34,8 @@ public class CallRecord extends IdEntity {
    private String  ssc; //社保卡号
    private String  doctor; //签约医生code
    private String  doctorName; //签约医生姓名
    private Long  adminTeamCode;
    private Long  adminTeamCode; //团队id
    private Integer transferState;//转接状态1.成功 2.失败
    public String getCode() {
        return code;
@ -205,4 +206,12 @@ public class CallRecord extends IdEntity {
    public void setAdminTeamCode(Long adminTeamCode) {
        this.adminTeamCode = adminTeamCode;
    }
    public Integer getTransferState() {
        return transferState;
    }
    public void setTransferState(Integer transferState) {
        this.transferState = transferState;
    }
}

+ 4 - 4
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/account/CustomerService.java

@ -220,7 +220,7 @@ public class CustomerService extends BaseService{
		return "1";
	}
	public Map<String,Object> updateCallRecordService(String code,String phone,Integer serviceType,String serviceContent){
	public Map<String,Object> updateCallRecordService(String code,String phone,Integer serviceType,String serviceContent,Integer transferState){
		CallRecord callRecord = callRecordDao.findByCode(code);
		List<Patient> list =  patientDao.findByMobile(phone);
@ -253,7 +253,7 @@ public class CustomerService extends BaseService{
		callRecord.setServiceType(serviceType);
		callRecord.setServiceContent(serviceContent);
		callRecord.setAdminTeamCode(sf.getAdminTeamId());
		callRecord.setTransferState(transferState);
		CallRecord call = callRecordDao.save(callRecord);
		rs.put("state",1);
@ -307,7 +307,7 @@ public class CustomerService extends BaseService{
				" manage_call_record r " +
				" WHERE " +
				" 1 = 1 ";
		sql = setCallRecordSql( sqltotal, callerNumber,recipientNumber, answerStatus, serviceType ,userName,jobNo, startDate, endDate);
		sql = setCallRecordSql( sql, callerNumber,recipientNumber, answerStatus, serviceType ,userName,jobNo, startDate, endDate);
		sql += " ORDER BY r.call_time DESC LIMIT "+(page-1)*size+","+size;
		List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
@ -496,7 +496,7 @@ public class CustomerService extends BaseService{
				" s.patient_name AS patientName, " +
				" s.doctor, " +
				" s.doctor_name AS doctorName, " +
				" s.server_type As serverType, " +
				" s.type As type, " +
				" s.state, " +
				" s.server_content AS serverContent, " +
				" s.create_time AS createTime, " +

+ 15 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java

@ -166,6 +166,20 @@ public class MessageService extends BaseService {
            prescriptionJson.put("amount", 0);
        }
        //协同服务
        List<Message> callServiceMes =  messageDao.findByReceiverCallService(doctor);
        JSONObject callServiceMesJson = new JSONObject();
        if (callServiceMes != null && callServiceMes.size() > 0) {
            callServiceMesJson.put("amount", callServiceMes.size());
            JSONObject callJson = new JSONObject();
            callJson.put("title", callServiceMes.get(0).getTitle());
            callJson.put("type", callServiceMes.get(0).getType());
            callJson.put("msg", callServiceMes.get(0).getContent());
            callJson.put("msgTime", DateUtil.dateToStrLong(callServiceMes.get(0).getCreateTime()));
            callServiceMesJson.put("lastMessage", callJson);
        } else {
            callServiceMesJson.put("amount", 0);
        }
        JSONObject json = new JSONObject();
        json.put("imMsgCount", getImMsgAmount(doctor));//IM消息数量
@ -173,6 +187,7 @@ public class MessageService extends BaseService {
        json.put("healthIndex", indexJson);//健康指标
        json.put("system", systemJson);//系统消息
        json.put("prescription", prescriptionJson);//续方消息
        json.put("callService", callServiceMesJson);//协同服务消息
        return json;
    }

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

@ -25,6 +25,7 @@ import java.util.*;
 * 订单物流相关。
 */
@Service
@Transactional
public class PrescriptionExpressageService extends BaseService {
    @Autowired
    private PrescriptionExpressageDao prescriptionExpressageDao;
@ -560,17 +561,21 @@ public class PrescriptionExpressageService extends BaseService {
            //更新二维码(isUse)
            PrescriptionDispensaryCode prescriptionDispensaryCode = prescriptionDispensaryCodeDao.finByCode(prescriptionCode);
            //修改取药码code为已经使用
            prescriptionDispensaryCode.setIsUse(1);
            prescriptionDispensaryCodeDao.save(prescriptionDispensaryCode);
            if(prescriptionDispensaryCode!=null){
                //修改取药码code为已经使用
                prescriptionDispensaryCode.setIsUse(1);
                prescriptionDispensaryCodeDao.save(prescriptionDispensaryCode);
            }
            //更新配送信息
            PrescriptionExpressage prescriptionExpressage = prescriptionExpressageDao.findByPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
            prescriptionExpressage.setHospitalDoctor(doctor);
            prescriptionExpressage.setHospitalDoctorCode(d.getCode());
            prescriptionExpressage.setFetchingMedicineTime(new Date());
            prescriptionExpressageDao.save(prescriptionExpressage);
            if(prescriptionExpressage!=null){
                prescriptionExpressage.setHospitalDoctor(doctor);
                prescriptionExpressage.setHospitalDoctorCode(d.getCode());
                prescriptionExpressage.setFetchingMedicineTime(new Date());
                prescriptionExpressageDao.save(prescriptionExpressage);
            }
            return "1";
        }
        return "0";

+ 2 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/call/CustomerService.java

@ -147,11 +147,12 @@ public class CustomerService extends BaseService{
		//预约失败
		}else{
			cs.setState(2);
			cs.setDealState(3);
			cs.setDealTime(new Date());
			cs.setDealReason(dealReason);
			cs.setDealContent(dealContent);
		}
		callServiceDao.save(cs);
		return "1";
	}
}

+ 24 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/call/CallRecordController.java

@ -1,6 +1,7 @@
package com.yihu.wlyy.web.doctor.call;
import com.yihu.wlyy.service.call.CustomerService;
import com.yihu.wlyy.service.third.jw.JwSmjkService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -8,10 +9,7 @@ import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
 * Created by Trick on 2017/11/14.
@ -23,6 +21,8 @@ public class CallRecordController extends BaseController {
    @Autowired
    private CustomerService customerService;
    @Autowired
    private JwSmjkService jwSmjkService;
    @RequestMapping(value = "/getCallServices", method = {RequestMethod.GET, RequestMethod.POST})
    @ApiOperation(value = "协同服务查询")
@ -103,4 +103,24 @@ public class CallRecordController extends BaseController {
            return error(-1,"保存失败");
        }
    }
    /*************************************** 患者端查询 ******************************************************************/
    @RequestMapping(value = "GetRegList", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("获取患者预约信息列表接口--患者端")
    public String GetRegList(@ApiParam(name = "patient", value = "患者编号", defaultValue = "0cc6e4562de2437ab2dbbf51a9fc3b49")
                             @RequestParam(value = "patient", required = false) String patient) {
        try {
//            SimpleDateFormat sm = new SimpleDateFormat("yyyy-MM-dd");
//            Date nowDate = new Date();
//            Date oneMonthAfter = getMonthBefore(nowDate, -1);
//            Date threeMonthBefore = getMonthBefore(nowDate, 3);        //三个月历史记录
//            List<PatientReservation> list = guahaoXM.GetRegList(patient, sm.format(threeMonthBefore), sm.format(oneMonthAfter), threeMonthBefore, oneMonthAfter);
            String list = jwSmjkService.GetRegList(patient);
            return list;
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
}

+ 3 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcEduArticleController.java

@ -32,7 +32,9 @@ import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;
import javax.jms.TextMessage;
import java.util.*;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
 * Created by chenweida on 2017/8/30...

+ 0 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/service/GcEduArticleService.java

@ -7,7 +7,6 @@ import com.yihu.es.entity.HealthEduArticlePatient;
import com.yihu.wlyy.config.es.ElastricSearchSave;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.education.HealthEduArticlePatientDao;
import com.yihu.wlyy.repository.patient.PatientDao;
@ -27,7 +26,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import java.text.SimpleDateFormat;
import java.util.*;