chenweida %!s(int64=8) %!d(string=hai) anos
pai
achega
0902cd0046

+ 51 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/PrescriptionExpressageLog.java

@ -22,7 +22,15 @@ public class PrescriptionExpressageLog extends IdEntity{
    private Date createTime;                //创建的时间
    private String remark;//备注
    private String acceptAddress;//路由节点发生的城市
    //健管师配送时候填写字段
    private String acceptHospital;// /健管师配送 接收机构
    private String acceptHospitalName;///健管师配送 接收机构名称
    private String acceptUser;///健管师配送 接收人
    private String acceptUserName;///健管师配送 接收名称
    private String acceptUserMobile;///健管师配送 接收人电话
    //快递配送填写字段
    private String acceptAddress;//快递配 路由节点发生的城市    健管师配送机构地址
    private Date acceptTime;// 路由节点产生的时间,格式:YYYY-MM-DD HH24:MM:SS,示例:2012-7-30 09:30:00。
    private String opCode;//路由节点操作码
    private String acceptRemark;//路由节点具体描述
@ -103,4 +111,46 @@ public class PrescriptionExpressageLog extends IdEntity{
    public void setAcceptRemark(String acceptRemark) {
        this.acceptRemark = acceptRemark;
    }
    public String getAcceptHospital() {
        return acceptHospital;
    }
    public void setAcceptHospital(String acceptHospital) {
        this.acceptHospital = acceptHospital;
    }
    public String getAcceptHospitalName() {
        return acceptHospitalName;
    }
    public void setAcceptHospitalName(String acceptHospitalName) {
        this.acceptHospitalName = acceptHospitalName;
    }
    public String getAcceptUser() {
        return acceptUser;
    }
    public void setAcceptUser(String acceptUser) {
        this.acceptUser = acceptUser;
    }
    public String getAcceptUserName() {
        return acceptUserName;
    }
    public void setAcceptUserName(String acceptUserName) {
        this.acceptUserName = acceptUserName;
    }
    public String getAcceptUserMobile() {
        return acceptUserMobile;
    }
    public void setAcceptUserMobile(String acceptUserMobile) {
        this.acceptUserMobile = acceptUserMobile;
    }
}

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

@ -5,10 +5,7 @@ import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.prescription.*;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
import com.yihu.wlyy.repository.prescription.PrescriptionDispensaryCodeDao;
import com.yihu.wlyy.repository.prescription.PrescriptionExpressageDao;
import com.yihu.wlyy.repository.prescription.PrescriptionLogDao;
import com.yihu.wlyy.repository.prescription.*;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.SystemConf;
import org.springframework.beans.factory.annotation.Autowired;
@ -37,6 +34,9 @@ public class PrescriptionExpressageService {
    private PrescriptionDao prescriptionDao;
    @Autowired
    private PrescriptionNoticesService prescriptionNoticesService;
    @Autowired
    private PrescriptionExpressageLogDao prescriptionExpressageLogDao;
    @Autowired
    private DoctorDao doctorDao;
    @Autowired
@ -173,18 +173,18 @@ public class PrescriptionExpressageService {
     * @param prescriptionDispensaryCode
     * @return
     */
    private Integer dispensaryCode_2(String userCode, PrescriptionDispensaryCode prescriptionDispensaryCode)throws Exception {
    private Integer dispensaryCode_2(String userCode, PrescriptionDispensaryCode prescriptionDispensaryCode) throws Exception {
        //获取配送的医生信息
        Doctor doctor=doctorDao.findByCode(userCode);
        Doctor doctor = doctorDao.findByCode(userCode);
        //修改处方状态为配送中
        Prescription prescription = prescriptionDao.findByCode(prescriptionDispensaryCode.getPrescriptionCode());
        Date expressageing=new Date();
        Date expressageing = new Date();
        prescription.setExpressageTime(expressageing);
        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());
        //得到patient
        Patient patient=patientDao.findByCode(prescription.getPatient());
        Patient patient = patientDao.findByCode(prescription.getPatient());
        //保存配送成功的日志
        PrescriptionLog prescriptionLog = new PrescriptionLog();
@ -203,11 +203,11 @@ public class PrescriptionExpressageService {
        prescriptionDispensaryCode.setIsUse(1);
        //发送模板消息通知患者药品开始配送
        String url=wechat_base_url+ "/wx/html/prescription/html/order_tracking.html?openid=" + patient.getOpenid() + "" +
                "&code=" + prescriptionDispensaryCode.getPrescriptionCode() + "&toUser=" + patient.getCode() + "&toName=" + patient.getName() ;
        String url = wechat_base_url + "/wx/html/prescription/html/order_tracking.html?openid=" + patient.getOpenid() + "" +
                "&code=" + prescriptionDispensaryCode.getPrescriptionCode() + "&toUser=" + patient.getCode() + "&toName=" + patient.getName();
        prescriptionNoticesService.sendMessages(patient.getOpenid(),patient.getName(),doctor.getName(), DateUtil.dateToStrLong(expressageing),3, 0,url );
        prescriptionNoticesService.sendMessages(patient.getOpenid(), patient.getName(), doctor.getName(), DateUtil.dateToStrLong(expressageing), 3, 0, url);
        return prescriptionDispensaryCode.getType();
    }
@ -219,18 +219,18 @@ public class PrescriptionExpressageService {
     * @param prescriptionDispensaryCode
     * @return
     */
    private Integer dispensaryCode_3(String userCode, PrescriptionDispensaryCode prescriptionDispensaryCode) throws Exception{
    private Integer dispensaryCode_3(String userCode, PrescriptionDispensaryCode prescriptionDispensaryCode) throws Exception {
        //获取配送的医生信息
        Doctor doctor=doctorDao.findByCode(userCode);
        Doctor doctor = doctorDao.findByCode(userCode);
        //修改处方状态为配送到服务站
        Prescription prescription = prescriptionDao.findByCode(prescriptionDispensaryCode.getPrescriptionCode());
        Date expressage2hospitalDate=new Date();
        Date expressage2hospitalDate = new Date();
        prescription.setExpressageTime(expressage2hospitalDate);
        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.expressage2hospital.getValue());
        //得到patient
        Patient patient=patientDao.findByCode(prescription.getPatient());
        Patient patient = patientDao.findByCode(prescription.getPatient());
        //保存配送成功的日志
        PrescriptionLog prescriptionLog = new PrescriptionLog();
@ -251,11 +251,11 @@ public class PrescriptionExpressageService {
        //发送模板消息通知患者取药
        //发送模板消息通知患者药品开始配送
        String url=wechat_base_url+ "/wx/html/prescription/html/order_tracking.html?openid=" + patient.getOpenid() + "" +
                "&code=" + prescriptionDispensaryCode.getPrescriptionCode() + "&toUser=" + patient.getCode() + "&toName=" + patient.getName() ;
        String url = wechat_base_url + "/wx/html/prescription/html/order_tracking.html?openid=" + patient.getOpenid() + "" +
                "&code=" + prescriptionDispensaryCode.getPrescriptionCode() + "&toUser=" + patient.getCode() + "&toName=" + patient.getName();
        prescriptionNoticesService.sendMessages(patient.getOpenid(),patient.getName(),doctor.getName(), DateUtil.dateToStrLong(expressage2hospitalDate),4, 0, url);
        prescriptionNoticesService.sendMessages(patient.getOpenid(), patient.getName(), doctor.getName(), DateUtil.dateToStrLong(expressage2hospitalDate), 4, 0, url);
        return prescriptionDispensaryCode.getType();
@ -313,8 +313,33 @@ public class PrescriptionExpressageService {
        prescriptionLog.setRemark("团队长分配健管师配送");
        prescriptionLogDao.save(prescriptionLog);
    }
    @Transactional
    public void expressage2Hospital(String hospital, String hospitalName, String hospitalAddress, String userCode, String userName, String mobile, String prescriptionCode) {
        PrescriptionExpressage prescriptionExpressage = prescriptionExpressageDao.findByPrescriptionCode(prescriptionCode);
        PrescriptionExpressageLog prescriptionExpressageLog = new PrescriptionExpressageLog();
        prescriptionExpressageLog.setAcceptAddress(hospitalAddress);
        prescriptionExpressageLog.setAcceptHospital(hospital);
        prescriptionExpressageLog.setAcceptHospitalName(hospitalName);
        prescriptionExpressageLog.setAcceptTime(new Date());
        prescriptionExpressageLog.setAcceptUser(userCode);
        prescriptionExpressageLog.setAcceptUserName(userName);
        prescriptionExpressageLog.setAcceptUserMobile(mobile);
        prescriptionExpressageLog.setCreateTime(new Date());
        prescriptionExpressageLog.setCode(UUID.randomUUID().toString());
        prescriptionExpressageLog.setPrescriptionCode(prescriptionCode);
        prescriptionExpressageLog.setExpressageCode(prescriptionExpressage.getCode());
        prescriptionExpressageLogDao.save(prescriptionExpressageLog);
        /**
         * 判断如果服务站和患者填写的服务站一致  那么就修改处方状态为送达服务站
         */
        if(prescriptionExpressage.getPatientHospitalCode().equals(hospital)){
            Prescription prescription=prescriptionDao.findByCode(prescriptionCode);
            prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.expressage2hospital.getValue());
            prescription.setExpressageTime(new Date());
        }
    }
}

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

@ -92,7 +92,7 @@ public class PrescriptionCodeController extends BaseController{
     * @return
     */
    @RequestMapping(value = "/expressage", method = RequestMethod.POST)
    @ApiOperation(value = "确认配送")
    @ApiOperation(value = "扫描编码")
    public String expressage(
            @ApiParam(required = true, name = "code", value = " 二维码code") @RequestParam(value = "code", required = true) String code) {
        try {

+ 5 - 4
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, name, mobile, prescriptionCode, getUID());
            return success("修改成功");
        } catch (Exception e) {
            return error(-1, "获取失败");
@ -51,11 +51,12 @@ public class PrescriptionExpressageController extends WeixinBaseController {
    /**
     * 确认接收 药品
     *
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/expressage2Hospital", method = RequestMethod.POST)
    @ApiOperation(value = "健管师配送的时候分配健管师")
    @ApiOperation(value = "确认药品被服务站接收")
    public String expressage2Hospital(
            @ApiParam(required = true, name = "hospital", value = "机构code") @RequestParam(value = "hospital", required = true) String hospital,
            @ApiParam(required = true, name = "hospitalName", value = "机构名称") @RequestParam(value = "hospitalName", required = true) String hospitalName,
@ -65,8 +66,8 @@ public class PrescriptionExpressageController extends WeixinBaseController {
            @ApiParam(required = true, name = "mobile", value = "电话号码") @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.expressage2Hospital(hospital,hospitalName,hospitalAddress,userCode,userName,mobile,prescriptionCode);
            return success("修改成功");
            expressageService.expressage2Hospital(hospital, hospitalName, hospitalAddress, userCode, userName, mobile, prescriptionCode);
            return success("接受成功");
        } catch (Exception e) {
            return error(-1, "获取失败");
        }

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

@ -1,14 +1,8 @@
package com.yihu.wlyy.web.doctor.prescription;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionExpressage;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionInfo;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionPay;
import com.yihu.wlyy.service.app.prescription.PrescriptionExpressageService;
import com.yihu.wlyy.service.app.prescription.PrescriptionInfoService;
import com.yihu.wlyy.service.app.prescription.PrescriptionPayService;
import com.yihu.wlyy.service.app.prescription.PrescriptionService;
import com.yihu.wlyy.entity.patient.prescription.*;
import com.yihu.wlyy.service.app.prescription.*;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
import com.yihu.wlyy.service.third.jw.JwSignService;
import com.yihu.wlyy.web.BaseController;
@ -27,7 +21,7 @@ import java.util.List;
@RestController
@RequestMapping(value = "/doctor/prescriptionInfo")
@Api(description = "医生端-长处方接口")
public class PrescriptionInfoController extends BaseController{
public class PrescriptionInfoController extends BaseController {
    @Autowired
    private PrescriptionInfoService prescriptionInfoService;
@ -39,13 +33,15 @@ public class PrescriptionInfoController extends BaseController{
    private PrescriptionPayService prescriptionPayService;
    @Autowired
    private JwPrescriptionService jwPrescriptionService;
    @Autowired
    private PrescriptionExpressageLogService prescriptionExpressageLogService;
    @RequestMapping(value = "/getPrescriptionFilter", method = RequestMethod.GET)
    @ApiOperation(value = "获取过滤规则信息列表")
    public String getPrescriptionFilter(){
    public String getPrescriptionFilter() {
        try {
            return write(200, "查询成功!", "data",prescriptionInfoService.getPrescriptionFilter());
            return write(200, "查询成功!", "data", prescriptionInfoService.getPrescriptionFilter());
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -54,17 +50,17 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getDoctorPrescription", method = RequestMethod.GET)
    @ApiOperation(value = "获取全科医生/建管师续方列表/搜索")
    public String getDoctorPrescription(@RequestParam(required = true)@ApiParam(value = "团队code", name = "teamCode") Integer teamCode,
                                        @RequestParam(required = false)@ApiParam(value = "续方状态", name = "state") String state,
                                        @RequestParam(required = false)@ApiParam(value = "所有诊断:1 糖尿病 2高血压", name = "dispensary") String diseases,
                                        @RequestParam(required = false)@ApiParam(name="startDate",value="开始时间")String startDate,
                                        @RequestParam(required = false)@ApiParam(name="endDate",value="结束时间")String endDate,
                                        @RequestParam(required = false)@ApiParam(name="nameKeyword",value="患者姓名模糊匹配")String nameKeyword,
                                        @RequestParam(required = false)@ApiParam(name="patient",value="患者Code")String patient,
                                        @RequestParam(required = false)@ApiParam(name="page",value="起始页")Integer page,
                                        @RequestParam(required = false)@ApiParam(name="size",value="每页条数")Integer size){
    public String getDoctorPrescription(@RequestParam(required = true) @ApiParam(value = "团队code", name = "teamCode") Integer teamCode,
                                        @RequestParam(required = false) @ApiParam(value = "续方状态", name = "state") String state,
                                        @RequestParam(required = false) @ApiParam(value = "所有诊断:1 糖尿病 2高血压", name = "dispensary") String diseases,
                                        @RequestParam(required = false) @ApiParam(name = "startDate", value = "开始时间") String startDate,
                                        @RequestParam(required = false) @ApiParam(name = "endDate", value = "结束时间") String endDate,
                                        @RequestParam(required = false) @ApiParam(name = "nameKeyword", value = "患者姓名模糊匹配") String nameKeyword,
                                        @RequestParam(required = false) @ApiParam(name = "patient", value = "患者Code") String patient,
                                        @RequestParam(required = false) @ApiParam(name = "page", value = "起始页") Integer page,
                                        @RequestParam(required = false) @ApiParam(name = "size", value = "每页条数") Integer size) {
        try {
            return write(200, "查询成功!", "data",prescriptionInfoService.getDoctorPrescription(teamCode,state,diseases,startDate,endDate,nameKeyword,patient,page,size));
            return write(200, "查询成功!", "data", prescriptionInfoService.getDoctorPrescription(teamCode, state, diseases, startDate, endDate, nameKeyword, patient, page, size));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -73,10 +69,10 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getContinuedPrescriptionAsDoctor", method = RequestMethod.GET)
    @ApiOperation(value = "续方详情")
    public String getContinuedPrescriptionAsDoctor(@RequestParam(required = true)@ApiParam(value = "续方CODE", name = "code") String code,
                                                   @RequestParam(required = true)@ApiParam(value = "团队长标识:1:是;2否", name = "type") String type){
    public String getContinuedPrescriptionAsDoctor(@RequestParam(required = true) @ApiParam(value = "续方CODE", name = "code") String code,
                                                   @RequestParam(required = true) @ApiParam(value = "团队长标识:1:是;2否", name = "type") String type) {
        try {
            return write(200, "查询成功!", "data",prescriptionInfoService.getContinuedPrescriptionAsDoctor(code));
            return write(200, "查询成功!", "data", prescriptionInfoService.getContinuedPrescriptionAsDoctor(code));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -85,11 +81,11 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/reviewPrescription", method = RequestMethod.POST)
    @ApiOperation(value = "续方审核")
    public String reviewPrescription(@RequestParam(required = true)@ApiParam(value = "续方CODE", name = "code") String code,
                                     @RequestParam(required = false)@ApiParam(value = "不同意原因", name = "reason") String reason,
                                     @RequestParam(required = false)@ApiParam(value = "1同意,2不同意", name = "state") String state){
    public String reviewPrescription(@RequestParam(required = true) @ApiParam(value = "续方CODE", name = "code") String code,
                                     @RequestParam(required = false) @ApiParam(value = "不同意原因", name = "reason") String reason,
                                     @RequestParam(required = false) @ApiParam(value = "1同意,2不同意", name = "state") String state) {
        try {
            return write(200, "查询成功!", "data",prescriptionInfoService.reviewPrescription(code,reason,state));
            return write(200, "查询成功!", "data", prescriptionInfoService.reviewPrescription(code, reason, state));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -99,12 +95,12 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/updatePresInfo", method = RequestMethod.POST)
    @ApiOperation(value = "调整处方")
    @ObserverRequired
    public String updatePresInfo(@RequestParam(required = true)@ApiParam(value = "续方CODE", name = "code") String code,
                                 @RequestParam(required = true)@ApiParam(value = "续方药品JSON", name = "infos") String infos,
                                 @RequestParam(required = false)@ApiParam(value = "疾病JSON", name = "diagnosis") String diagnosis,
                                 @RequestParam(required = false)@ApiParam(value = "调整原因", name = "reason") String reason ){
    public String updatePresInfo(@RequestParam(required = true) @ApiParam(value = "续方CODE", name = "code") String code,
                                 @RequestParam(required = true) @ApiParam(value = "续方药品JSON", name = "infos") String infos,
                                 @RequestParam(required = false) @ApiParam(value = "疾病JSON", name = "diagnosis") String diagnosis,
                                 @RequestParam(required = false) @ApiParam(value = "调整原因", name = "reason") String reason) {
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.updatePresInfo(code,infos,diagnosis,reason));
            return write(200, "操作成功!", "data", prescriptionInfoService.updatePresInfo(code, infos, diagnosis, reason));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -113,9 +109,9 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getInfoTitle", method = RequestMethod.POST)
    @ApiOperation(value = "调整处方-药品分类及种类数目")
    public String getInfoTitle(){
    public String getInfoTitle() {
        try {
            return write(200, "操作成功!", "data","");
            return write(200, "操作成功!", "data", "");
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -124,9 +120,9 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getInfoListByParentCode", method = RequestMethod.POST)
    @ApiOperation(value = "药品类别获取药品")
    private String getInfoListByParentCode(@RequestParam(required = true)@ApiParam(value = "药品类别Code", name = "code") String code){
    private String getInfoListByParentCode(@RequestParam(required = true) @ApiParam(value = "药品类别Code", name = "code") String code) {
        try {
            return write(200, "操作成功!", "data","");
            return write(200, "操作成功!", "data", "");
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -154,14 +150,24 @@ public class PrescriptionInfoController extends BaseController{
            PrescriptionPay prescriptionPay = prescriptionPayService.findByPrescriptionCode(prescriptionCode);
            //获取配送信息
            PrescriptionExpressage prescriptionExpressage = prescriptionExpressageService.findByPrescriptionCode(prescriptionCode);
            //获取配送流程
            List<PrescriptionExpressageLog> prescriptionExpressageLogs = prescriptionExpressageLogService.findByPrescriptionCode(prescriptionCode);
            jo.put("prescriptionExpressage", prescriptionExpressage);
            jo.put("prescriptionInfos", prescriptionInfos);
            jo.put("prescriptionPay", prescriptionPay);
            if (prescriptionInfos != null && prescriptionInfos.size() > 0) {
                jo.put("prescriptionInfos", prescriptionInfos);
            }
            if (prescriptionPay != null) {
                jo.put("prescriptionPay", prescriptionPay);
            }
            if (prescriptionExpressageLogs != null && prescriptionExpressageLogs.size() > 0) {
                jo.put("prescriptionExpressageLogs", prescriptionExpressageLogs);
            }
            jo.put("prescriptionHospital", prescription.getHospitalName());//出药机构
            jo.put("dispensaryDispensaryType", prescription.getType());//处方配送方式
            jo.put("dispensaryDispensaryTypeName", prescription.getTypeName());//处方配送方式
            jo.put("prescriptionStatus", prescription.getStatus());//处方状态
            jo.put("prescriptionStatusName", prescription.getStatusName(prescription.getStatus(),""));//处方状态名称
            jo.put("prescriptionStatusName", prescription.getStatusName(prescription.getStatus(), ""));//处方状态名称
            return write(200, "查询成功", "data", jo);
        } catch (Exception e) {
@ -172,9 +178,9 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getDrugTimes", method = RequestMethod.GET)
    @ApiOperation(value = "药品品使用频次字典")
    public String getDrugTimes(){
    public String getDrugTimes() {
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.getDrugTimes());
            return write(200, "操作成功!", "data", prescriptionInfoService.getDrugTimes());
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -183,17 +189,17 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getHDoctorPrescriptionExpressage", method = RequestMethod.GET)
    @ApiOperation(value = "获取健康管理师续方订单列表")
    public String getHDoctorPrescriptionExpressage(@RequestParam(required = false) @ApiParam(value = "团队Code", name = "teamCode")String teamCode,
                                                  @RequestParam(required = false) @ApiParam(value = "1:需跟踪;2:已接收", name = "type")  String type,
                                                  @RequestParam(required = false) @ApiParam(value = "患者姓名关键字", name = "nameKey")String nameKey,
                                                  @RequestParam(required = false) @ApiParam(value = "开始时间", name = "startDate")String startDate,
                                                  @RequestParam(required = false) @ApiParam(value = "结束时间", name = "endDate")String endDate,
                                                  @RequestParam(required = false) @ApiParam(value = "服务站", name = "hospital")String hospital,
                                                  @RequestParam(required = false) @ApiParam(value = "配送状态", name = "state")String state,
                                                  @RequestParam(required = false) @ApiParam(value = "页数", name = "page")Integer page,
                                                  @RequestParam(required = false) @ApiParam(value = "每页大小", name = "size")Integer size){
    public String getHDoctorPrescriptionExpressage(@RequestParam(required = false) @ApiParam(value = "团队Code", name = "teamCode") String teamCode,
                                                   @RequestParam(required = false) @ApiParam(value = "1:需跟踪;2:已接收", name = "type") String type,
                                                   @RequestParam(required = false) @ApiParam(value = "患者姓名关键字", name = "nameKey") String nameKey,
                                                   @RequestParam(required = false) @ApiParam(value = "开始时间", name = "startDate") String startDate,
                                                   @RequestParam(required = false) @ApiParam(value = "结束时间", name = "endDate") String endDate,
                                                   @RequestParam(required = false) @ApiParam(value = "服务站", name = "hospital") String hospital,
                                                   @RequestParam(required = false) @ApiParam(value = "配送状态", name = "state") String state,
                                                   @RequestParam(required = false) @ApiParam(value = "页数", name = "page") Integer page,
                                                   @RequestParam(required = false) @ApiParam(value = "每页大小", name = "size") Integer size) {
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.getHDoctorPrescriptionExpressage(teamCode,type,getUID(),nameKey,startDate,endDate,hospital,state,page,size));
            return write(200, "操作成功!", "data", prescriptionInfoService.getHDoctorPrescriptionExpressage(teamCode, type, getUID(), nameKey, startDate, endDate, hospital, state, page, size));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -202,19 +208,20 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getPrescriptionExpressageFilter", method = RequestMethod.GET)
    @ApiOperation(value = "获取健康管理师续方订单列表过滤条件")
    public String getPrescriptionExpressageFilter(){
    public String getPrescriptionExpressageFilter() {
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.getPrescriptionExpressageFilter(getUID()));
            return write(200, "操作成功!", "data", prescriptionInfoService.getPrescriptionExpressageFilter(getUID()));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getPrescriptionExpressageAsdoctorFilter", method = RequestMethod.GET)
    @ApiOperation(value = "获取全科医生续方订单列表过滤条件")
    public String getPrescriptionExpressageAsdoctorFilter(){
    public String getPrescriptionExpressageAsdoctorFilter() {
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.getPrescriptionExpressageAsdoctorFilter());
            return write(200, "操作成功!", "data", prescriptionInfoService.getPrescriptionExpressageAsdoctorFilter());
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -223,20 +230,20 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getDoctorPrescriptionExpressage", method = RequestMethod.GET)
    @ApiOperation(value = "获取全科医生续方订单列表")
    public String getDoctorPrescriptionExpressage(@RequestParam(required = false) @ApiParam(value = "团队Code", name = "teamCode")String teamCode,
                                                  @RequestParam(required = false) @ApiParam(value = "居民搜素关键字", name = "nameKey")String nameKey,
                                                  @RequestParam(required = false) @ApiParam(value = "开始时间", name = "startDate")String startDate,
                                                  @RequestParam(required = false) @ApiParam(value = "结束时间", name = "endDate")String endDate,
                                                  @RequestParam(required = false) @ApiParam(value = "机构", name = "hospital")String hospital,
                                                  @RequestParam(required = false) @ApiParam(value = "配送状态", name = "state")String state,
                                                  @RequestParam(required = false) @ApiParam(value = "配送方式:1 自取 2快递配送 3健管师配送", name = "dispensaryType")String dispensaryType,
                                                  @RequestParam(required = false) @ApiParam(value = "传1为未分配健管师", name = "AllocationType")String AllocationType,
                                                  @RequestParam(required = false) @ApiParam(value = "起始页", name = "page")Integer page,
                                                  @RequestParam(required = false) @ApiParam(value = "每页大小", name = "size")Integer size){
    public String getDoctorPrescriptionExpressage(@RequestParam(required = false) @ApiParam(value = "团队Code", name = "teamCode") String teamCode,
                                                  @RequestParam(required = false) @ApiParam(value = "居民搜素关键字", name = "nameKey") String nameKey,
                                                  @RequestParam(required = false) @ApiParam(value = "开始时间", name = "startDate") String startDate,
                                                  @RequestParam(required = false) @ApiParam(value = "结束时间", name = "endDate") String endDate,
                                                  @RequestParam(required = false) @ApiParam(value = "机构", name = "hospital") String hospital,
                                                  @RequestParam(required = false) @ApiParam(value = "配送状态", name = "state") String state,
                                                  @RequestParam(required = false) @ApiParam(value = "配送方式:1 自取 2快递配送 3健管师配送", name = "dispensaryType") String dispensaryType,
                                                  @RequestParam(required = false) @ApiParam(value = "传1为未分配健管师", name = "AllocationType") String AllocationType,
                                                  @RequestParam(required = false) @ApiParam(value = "起始页", name = "page") Integer page,
                                                  @RequestParam(required = false) @ApiParam(value = "每页大小", name = "size") Integer size) {
        try {
            return write(200, "操作成功!", "data",
                    prescriptionInfoService.
                            getDoctorPrescriptionExpressage(teamCode, nameKey, startDate, endDate, hospital, state, dispensaryType,AllocationType, page, size));
                            getDoctorPrescriptionExpressage(teamCode, nameKey, startDate, endDate, hospital, state, dispensaryType, AllocationType, page, size));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
@ -245,7 +252,7 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getCountExpressage", method = RequestMethod.GET)
    @ApiOperation(value = "获取指定团队未分配建管师订单数目")
    public String getCountExpressage(@RequestParam(required = true) @ApiParam(value = "团队Code", name = "teamCode")String teamCode){
    public String getCountExpressage(@RequestParam(required = true) @ApiParam(value = "团队Code", name = "teamCode") String teamCode) {
        try {
            return write(200, "操作成功!", "data", prescriptionInfoService.getCountExpressage(teamCode));
        } catch (Exception e) {
@ -256,7 +263,7 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getHospitalListTitle", method = RequestMethod.GET)
    @ApiOperation(value = "获取服务站列表")
    public String getHospitalListTitle(@RequestParam(required = true) @ApiParam(value = "团队Code", name = "teamCode")String teamCode){
    public String getHospitalListTitle(@RequestParam(required = true) @ApiParam(value = "团队Code", name = "teamCode") String teamCode) {
        try {
            return write(200, "操作成功!", "data", prescriptionInfoService.getHospitalListTitle(teamCode));
        } catch (Exception e) {
@ -267,7 +274,7 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getTeamHealthDoctorCount", method = RequestMethod.GET)
    @ApiOperation(value = "获取医生同社区底下所有团队建管师数目")
    public String getTeamHealthDoctorCount(){
    public String getTeamHealthDoctorCount() {
        try {
            return write(200, "操作成功!", "data", prescriptionInfoService.getTeamHealthDoctorCount(getUID()));
        } catch (Exception e) {
@ -275,27 +282,27 @@ public class PrescriptionInfoController extends BaseController{
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getPrescriptionDurgDict", method = RequestMethod.GET)
    @ApiOperation(value = "获取基卫的药品字典")
    public String getPrescriptionDurgDict(
            @RequestParam(required = true,name = "dictName") @ApiParam(value = "字典名称", name = "dictName",required = true)  String dictName,
            @RequestParam(required = true,name = "hospital") @ApiParam(value = "医院code", name = "hospital",required = true)  String hospital
    ){
        try {
            return write(200, "操作成功!", "data",jwPrescriptionService.getDictForI(dictName,hospital));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
//
//    @RequestMapping(value = "/getPrescriptionDurgDict", method = RequestMethod.GET)
//    @ApiOperation(value = "获取基卫的药品字典")
//    public String getPrescriptionDurgDict(
//            @RequestParam(required = true,name = "dictName") @ApiParam(value = "字典名称", name = "dictName",required = true)  String dictName,
//            @RequestParam(required = true,name = "hospital") @ApiParam(value = "医院code", name = "hospital",required = true)  String hospital
//    ){
//        try {
//            return write(200, "操作成功!", "data",jwPrescriptionService.getDictForI(dictName,hospital));
//        } catch (Exception e) {
//            error(e);
//            return error(-1, "查询失败!");
//        }
//    }
    @RequestMapping(value = "/distributionHealthDoctor", method = RequestMethod.POST)
    @ApiOperation(value = "配置建管师")
    public String distributionHealthDoctor(@RequestParam(required = true) @ApiParam(value = "续方Code字符串用','分割", name = "codes") String codes,
                                           @RequestParam(required = true) @ApiParam(value = "健康管理师Code", name = "healthDoctor")String healthDoctor){
                                           @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));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");