Browse Source

长处方新增参数

trick9191 7 năm trước cách đây
mục cha
commit
5bc1ebe22a

+ 9 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/patient/prescription/Prescription.java

@ -54,6 +54,7 @@ public class Prescription extends IdEntity {
//    private Double myCost;                      //自己付费
//    private Double myCost;                      //自己付费
    private Integer prescriptionType;          //处方类型:1、门诊处方,2、住院处方
    private Integer prescriptionType;          //处方类型:1、门诊处方,2、住院处方
    private String cancelReason;
    private String statusName; //
    private String statusName; //
@ -423,4 +424,12 @@ public class Prescription extends IdEntity {
        }
        }
        return "未知";
        return "未知";
    }
    }
    public String getCancelReason() {
        return cancelReason;
    }
    public void setCancelReason(String cancelReason) {
        this.cancelReason = cancelReason;
    }
}
}

+ 7 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/event/ApplicationEvent.java

@ -1,5 +1,7 @@
package com.yihu.wlyy.event;
package com.yihu.wlyy.event;
import com.yihu.wlyy.redis.RedisMsgPubSubListener;
import com.yihu.wlyy.redis.RedisThread;
import com.yihu.wlyy.util.SystemConf;
import com.yihu.wlyy.util.SystemConf;
import org.slf4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.LoggerFactory;
@ -7,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import redis.clients.jedis.Jedis;
import java.util.HashMap;
import java.util.HashMap;
@ -17,11 +20,14 @@ import java.util.HashMap;
public class ApplicationEvent implements ApplicationListener<ContextRefreshedEvent> {
public class ApplicationEvent implements ApplicationListener<ContextRefreshedEvent> {
    private Logger logger= LoggerFactory.getLogger(ApplicationEvent.class);
    private Logger logger= LoggerFactory.getLogger(ApplicationEvent.class);
    @Autowired
    private RedisThread redisThread;
    @Override
    @Override
    public void onApplicationEvent(ContextRefreshedEvent ContextRefreshedEvent) {
    public void onApplicationEvent(ContextRefreshedEvent ContextRefreshedEvent) {
        try {
        try {
            new Thread(redisThread).start();
            //启动发送产检提醒模板消息
            //启动发送产检提醒模板消息
//            if (!quartzHelper.isExistJob("prenatal_inspector_job")) {
//            if (!quartzHelper.isExistJob("prenatal_inspector_job")) {
//                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("prenatal_inspector_job_trigger");
//                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("prenatal_inspector_job_trigger");

+ 79 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/redis/RedisMsgPubSubListener.java

@ -0,0 +1,79 @@
package com.yihu.wlyy.redis;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionInfo;
import com.yihu.wlyy.repository.prescription.PrescriptionInfoDao;
import com.yihu.wlyy.service.app.prescription.PrescriptionInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import redis.clients.jedis.JedisPubSub;
/**
 * Created by Trick on 2017/8/7.
 */
@Component
public class RedisMsgPubSubListener extends JedisPubSub {
    @Autowired
    private PrescriptionInfoService prescriptionInfoService;
    @Override
    public void unsubscribe() {
        super.unsubscribe();
    }
    @Override
    public void unsubscribe(String... channels) {
        super.unsubscribe(channels);
    }
    @Override
    public void subscribe(String... channels) {
        super.subscribe(channels);
    }
    @Override
    public void psubscribe(String... patterns) {
        super.psubscribe(patterns);
    }
    @Override
    public void punsubscribe() {
        super.punsubscribe();
    }
    @Override
    public void punsubscribe(String... patterns) {
        super.punsubscribe(patterns);
    }
    @Override
    public void onMessage(String channel, String message) {
        System.out.println("channel:" + channel + "receives message :" + message);
        //this.unsubscribe();
    }
    @Override
    public void onPMessage(String pattern, String channel, String message) {
    }
    @Override
    public void onSubscribe(String channel, int subscribedChannels) {
        System.out.println("channel:" + channel + "is been subscribed:" + subscribedChannels);
    }
    @Override
    public void onPUnsubscribe(String pattern, int subscribedChannels) {
    }
    @Override
    public void onPSubscribe(String pattern, int subscribedChannels) {
    }
    @Override
    public void onUnsubscribe(String channel, int subscribedChannels) {
        System.out.println("channel:" + channel + "is been unsubscribed:" + subscribedChannels);
    }
}

+ 24 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/redis/RedisThread.java

@ -0,0 +1,24 @@
package com.yihu.wlyy.redis;
import com.yihu.wlyy.util.SystemConf;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import redis.clients.jedis.Jedis;
/**
 * Created by Trick on 2017/8/7.
 */
@Component
public class RedisThread implements Runnable {
    @Value("${spring.redis.host}")
    private String url;
    @Autowired
    private RedisMsgPubSubListener redisMsgPubSubListener;
    @Override
    public void run() {
        Jedis jedis = new Jedis(url);
        jedis.subscribe(redisMsgPubSubListener, SystemConf.getInstance().getSystemProperties().getProperty("redis_prescription_title"));
    }
}

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/dict/SystemDictDao.java

@ -23,4 +23,7 @@ public interface SystemDictDao extends PagingAndSortingRepository<SystemDict, Lo
    @Query("select s from SystemDict s where s.value like ?1 ")
    @Query("select s from SystemDict s where s.value like ?1 ")
    List<SystemDict> findByLikeName(String name);
    List<SystemDict> findByLikeName(String name);
    @Query("select s from SystemDict s where s.dictName like ?1 ")
    List<SystemDict> findByLikeDictName(String name);
}
}

+ 7 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/BaseService.java

@ -4,11 +4,16 @@ import java.security.KeyPair;
import java.util.Iterator;
import java.util.Iterator;
import java.util.UUID;
import java.util.UUID;
import com.yihu.wlyy.entity.security.AccessToken;
import com.yihu.wlyy.service.common.account.AccessTokenService;
import com.yihu.wlyy.util.HttpUtil;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import com.yihu.wlyy.entity.security.RSA;
import com.yihu.wlyy.entity.security.RSA;
import com.yihu.wlyy.repository.security.RSADao;
import com.yihu.wlyy.repository.security.RSADao;
import com.yihu.wlyy.util.CommonUtil;
import com.yihu.wlyy.util.CommonUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
@Service
@Service
@ -17,6 +22,8 @@ public class BaseService {
	// RSA加密信息持久化DAO
	// RSA加密信息持久化DAO
	@Autowired
	@Autowired
	private RSADao rsaDao;
	private RSADao rsaDao;
	@Autowired
	private AccessTokenService accessTokenService;
	public String getCode() {
	public String getCode() {
		return UUID.randomUUID().toString().replaceAll("-", "");
		return UUID.randomUUID().toString().replaceAll("-", "");
@ -81,5 +88,4 @@ public class BaseService {
		}
		}
		return null;
		return null;
	}
	}
}
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/family/FamilyMemberService.java

@ -885,7 +885,7 @@ public class FamilyMemberService extends BaseService {
     *
     *
     * @return
     * @return
     */
     */
    public String getAccessToken() throws Exception {
    public String getAccessToken(){
        Iterable<AccessToken> accessTokens = accessTokenService.findAccessToken();
        Iterable<AccessToken> accessTokens = accessTokenService.findAccessToken();
        if (accessTokens != null) {
        if (accessTokens != null) {
            for (AccessToken accessToken : accessTokens) {
            for (AccessToken accessToken : accessTokens) {

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

@ -1,7 +1,8 @@
package com.yihu.wlyy.service.app.prescription;
package com.yihu.wlyy.service.app.prescription;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
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.dict.SystemDict;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.Patient;
@ -50,6 +51,12 @@ public class PrescriptionInfoService extends BaseService {
    @Autowired
    @Autowired
    private PrescriptionReviewedDao prescriptionReviewedDao;
    private PrescriptionReviewedDao prescriptionReviewedDao;
    @Autowired
    @Autowired
    private PrescriptionDiagnosisDao prescriptionDiagnosisDao;
    @Autowired
    private PrescriptionNoticesService prescriptionNoticesService;
    @Autowired
    private WeiXinAccessTokenUtils weiXinAccessTokenUtils;
    @Autowired
    private ImUtill imUtill;
    private ImUtill imUtill;
    /**
    /**
@ -91,6 +98,47 @@ public class PrescriptionInfoService extends BaseService {
        if(StringUtils.isNotBlank(type)){
        if(StringUtils.isNotBlank(type)){
            if("1".equals(type)){
            if("1".equals(type)){
                //基卫接口
                //基卫接口
                List<Map<String,Object>> prescriptions = new ArrayList<>();
                Map<String,Object> p1 = new HashMap<>();
                p1.put("code","2");
                p1.put("hospital","3502050100");
                p1.put("hospitalName","海沧区嵩屿街道社区卫生服务中心");
                p1.put("doctor","hxmD201703150222");
                p1.put("doctorName","黄小陌(全科)");
                p1.put("adminTeamId","643");
                p1.put("prescriptionType","门诊");
                p1.put("date","2017-08-08 10:10:10");
                if(StringUtils.isNotBlank((String)p1.get("code"))){
                    String sql = "SELECT p.status FROM wlyy_prescription p WHERE p.parent_code='2'";
                    List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
                    if(list!=null&&list.size()>0){
                        int state = (Integer) (list.get(0).get("status"));
                        p1.put("status",state);
                    }
                }
                List<PrescriptionInfo> prescriptionInfos = new ArrayList<>();
                PrescriptionInfo info1 = new PrescriptionInfo();
                info1.setCode("2017080700001");
                info1.setPrescriptionCode("201708070001");
                info1.setDel(1);
                info1.setDrugCode("A1");
                info1.setDrugName("A药品");
                prescriptionInfos.add(info1);
                List<PrescriptionDiagnosis> diagnosises = new ArrayList<>();
                PrescriptionDiagnosis diagnosis = new PrescriptionDiagnosis();
                diagnosis.setCode("1");
                diagnosis.setName("糖尿病");
                diagnosises.add(diagnosis);
                p1.put("prescriptionDt",diagnosises);
                p1.put("prescriptionInfo",prescriptionInfos);
                prescriptions.add(p1);
                return new JSONArray(prescriptions);
            }else{
            }else{
                StringBuffer sqlBuffer = new StringBuffer("SELECT p.code,p.create_time AS date,p.status,p.hospital_name As hospitalName FROM wlyy_prescription p " +
                StringBuffer sqlBuffer = new StringBuffer("SELECT p.code,p.create_time AS date,p.status,p.hospital_name As hospitalName FROM wlyy_prescription p " +
                        "WHERE p.patient=?");
                        "WHERE p.patient=?");
@ -203,9 +251,10 @@ public class PrescriptionInfoService extends BaseService {
     * @param code
     * @param code
     * @return
     * @return
     */
     */
    public int cancelPrescriotion(String code){
    public int cancelPrescriotion(String code,String reason){
        Prescription p = prescriptionDao.findByCode(code);
        Prescription p = prescriptionDao.findByCode(code);
        p.setStatus(PrescriptionLog.PrescriptionLogStatus.patient_canel.getValue());
        p.setStatus(PrescriptionLog.PrescriptionLogStatus.patient_canel.getValue());
        p.setCancelReason(reason);
        prescriptionDao.save(p);
        prescriptionDao.save(p);
        //患者操作日志
        //患者操作日志
        PrescriptionLog log = new PrescriptionLog();
        PrescriptionLog log = new PrescriptionLog();
@ -312,16 +361,17 @@ public class PrescriptionInfoService extends BaseService {
        rs.put("prescription",prescription);
        rs.put("prescription",prescription);
        rs.put("prescriptionInfos",prescriptionInfos);
        rs.put("prescriptionInfos",prescriptionInfos);
        rs.put("reviewed",reviewed);
        rs.put("reviewed",reviewed);
        if(prescription!=null&&StringUtils.isNotBlank(prescription.getDoctor())){
            rs.put("doctor",doctorDao.findByCode(prescription.getDoctor()));
        }else{
            rs.put("doctor","");
        }
//        if(prescription!=null&&StringUtils.isNotBlank(prescription.getDoctor())){
//            rs.put("doctor",doctorDao.findByCode(prescription.getDoctor()));
//        }else{
//            rs.put("doctor","");
//        }
        if(prescription!=null&&StringUtils.isNotBlank(prescription.getPatient())){
        if(prescription!=null&&StringUtils.isNotBlank(prescription.getPatient())){
            rs.put("patient",patientDao.findByCode(prescription.getPatient()));
            rs.put("patient",patientDao.findByCode(prescription.getPatient()));
        }else{
        }else{
            rs.put("patient","");
            rs.put("patient","");
        }
        }
        rs.put("diagnosis",prescriptionDiagnosisDao.findByPrescriptionCode(code));
        return rs;
        return rs;
    }
    }
@ -391,7 +441,7 @@ public class PrescriptionInfoService extends BaseService {
        return 0;
        return 0;
    }
    }
    public int updatePresInfo(String code,String infos,String reason){
    public int updatePresInfo(String code,String infos,String diagnosis,String reason){
        if(StringUtils.isNotBlank(code)&&StringUtils.isNotBlank(infos)){
        if(StringUtils.isNotBlank(code)&&StringUtils.isNotBlank(infos)){
            //同步智业接口
            //同步智业接口
            upload();
            upload();
@ -406,18 +456,42 @@ public class PrescriptionInfoService extends BaseService {
                p.setCode(getCode());
                p.setCode(getCode());
                p.setDel(1);
                p.setDel(1);
                p.setPrescriptionCode(code);
                p.setPrescriptionCode(code);
                p.setPrice(info.getInteger("price"));
                p.setPrice(info.getInt("price"));
                p.setDrugCode(info.getString("drugCode"));
                p.setDrugCode(info.getString("drugCode"));
                p.setDrugName(info.getString("drugName"));
                p.setDrugName(info.getString("drugName"));
                p.setDrugRate(info.getString("drugRate"));
                p.setDrugRate(info.getString("drugRate"));
                p.setDrugFormat(info.getString("drugFormat"));
                p.setDrugFormat(info.getString("drugFormat"));
                p.setNum(info.getInteger("num"));
                p.setIsRefrigerate(info.getInteger("isRefrigerate"));
                p.setNum(info.getInt("num"));
                p.setIsRefrigerate(info.getInt("isRefrigerate"));
                p.setDirection(info.getString("direction"));
                p.setDirection(info.getString("direction"));
                prescriptionInfoDao.save(p);
                prescriptionInfoDao.save(p);
            }
            }
            prescriptionDiagnosisService.setPrescriptionInfo(code);
            //设置处方疾病类型
            //设置处方疾病类型
            prescriptionDiagnosisService.setPrescriptionDiagnosis(code);
            if(StringUtils.isNotBlank(diagnosis)){
                StringBuffer sql2 = new StringBuffer("UPDATE wlyy_prescription_diagnosis SET del = 0 WHERE prescription_code = '"+code+"'");
                jdbcTemplate.execute(sql2.toString());
                JSONArray array = new  JSONArray(diagnosis);
                Iterator<Object> itds = jsonArray.iterator();
                while (itds.hasNext()){
                    JSONObject info = (JSONObject) itds.next();
                    PrescriptionDiagnosis p = new PrescriptionDiagnosis();
                    p.setCode(getCode());
                    p.setCreateTime(new Date());
                    p.setName(info.getString("name"));
                    p.setCode(info.getString("code"));
                    p.setPrescriptionCode(code);
                    prescriptionDiagnosisDao.save(p);
                }
                prescriptionDiagnosisService.setPrescriptionDiagnosis(code);
            }
            Prescription p = prescriptionDao.findByCode(code);
            Prescription p = prescriptionDao.findByCode(code);
            //记录Log
            //记录Log
@ -458,7 +532,7 @@ public class PrescriptionInfoService extends BaseService {
    public JSONArray getDrugTimes(){
    public JSONArray getDrugTimes(){
        List<SystemDict> list = systemDictDao.findByLikeName("%PRES_DRUG_TIME_%");
        List<SystemDict> list = systemDictDao.findByLikeDictName("%PRES_DRUG_TIME_%");
        return new JSONArray(list);
        return new JSONArray(list);
    }
    }
@ -489,7 +563,7 @@ public class PrescriptionInfoService extends BaseService {
                " pr.doctor " +
                " pr.doctor " +
                " FROM " +
                " FROM " +
                " wlyy_prescription pr " +
                " wlyy_prescription pr " +
                " LEFT JOIN wlyy_patient p ON pr.patient = p.`code` ," +
                " LEFT JOIN wlyy_patient p ON pr.patient = p.`code` " +
                " JOIN wlyy_prescription_expressage e ON pr.code = e.prescription_code " +
                " JOIN wlyy_prescription_expressage e ON pr.code = e.prescription_code " +
                " WHERE 1=1 " );
                " WHERE 1=1 " );
        List<Object> params = new ArrayList<>();
        List<Object> params = new ArrayList<>();
@ -506,10 +580,10 @@ public class PrescriptionInfoService extends BaseService {
    public void setExpressageSql(StringBuffer pre_sql,List<Object> param,String type,String doctor, String nameKey,String startDate,String endDate,String hospital,String state,Integer page,Integer size){
    public void setExpressageSql(StringBuffer pre_sql,List<Object> param,String type,String doctor, String nameKey,String startDate,String endDate,String hospital,String state,Integer page,Integer size){
        if(StringUtils.isNotBlank(type)){
        if(StringUtils.isNotBlank(type)){
            if("1".equals(type)){
            if("1".equals(type)){
                pre_sql.append(" AND e.expressageCode = ?");
                pre_sql.append(" AND e.expressage_Code = ?");
                param.add(doctor);
                param.add(doctor);
            }else{
            }else{
                pre_sql.append(" AND e.acceptCode = ?");
                pre_sql.append(" AND e.accept_Code = ?");
                param.add(doctor);
                param.add(doctor);
            }
            }
        }
        }
@ -539,38 +613,60 @@ public class PrescriptionInfoService extends BaseService {
        }
        }
    }
    }
    public JSONObject getPrescriptionExpressageFilter(){
    public JSONObject getPrescriptionExpressageFilter(String doctor){
        JSONObject rs = new JSONObject();
        JSONObject rs = new JSONObject();
//        List<Map<String,Object>> states = new ArrayList<>();
//        Map<String,Object> map1 = new HashMap<>();
//        map1.put("name","订单已支付");
//        map1.put("code",PrescriptionLog.PrescriptionLogStatus.pay_success.getValue());
//        states.add(map1);
//
//        Map<String,Object> map2 = new HashMap<>();
//        map2.put("name","配药完成");
//        map2.put("code",PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue());
//        states.add(map2);
//
//        Map<String,Object> map2 = new HashMap<>();
//        map2.put("name","药品到达服务站");
//        map2.put("code",PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue());
//        states.add(map2);
//
//        Map<String,Object> map3 = new HashMap<>();
//        map3.put("name","配送中");
//        map3.put("code",PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());
//        states.add(map3);
//
//        Map<String,Object> map4 = new HashMap<>();
//        map4.put("name","配药完成");
//        map4.put("code",PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue());
//        states.add(map4);
//
//        Map<String,Object> map5 = new HashMap<>();
//        map2.put("name","配药完成");
//        map2.put("code",PrescriptionLog.PrescriptionLogStatus.expressage2hospital.getValue());
//        states.add(map2);
        List<Map<String,Object>> states = new ArrayList<>();
        Map<String,Object> map1 = new HashMap<>();
        map1.put("name","订单已支付");
        map1.put("code",PrescriptionLog.PrescriptionLogStatus.pay_success.getValue());
        states.add(map1);
        Map<String,Object> map2 = new HashMap<>();
        map2.put("name","配药完成");
        map2.put("code",PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue());
        states.add(map2);
        Map<String,Object> map3 = new HashMap<>();
        map3.put("name","配送中");
        map3.put("code",PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());
        states.add(map3);
        Map<String,Object> map4 = new HashMap<>();
        map4.put("name","药品到达服务站");
        map4.put("code",PrescriptionLog.PrescriptionLogStatus.expressage2hospital.getValue());
        states.add(map4);
        Map<String,Object> map5 = new HashMap<>();
        map2.put("name","配药完成");
        map2.put("code",PrescriptionLog.PrescriptionLogStatus.finish.getValue());
        states.add(map2);
        //设置配送状态下拉框
        rs.put("states",states);
        //
        Doctor d = doctorDao.findByCode(doctor);
        if(d!=null&& StringUtils.isNotBlank(d.getHospital())){
            String h = d.getHospital().substring(0,8);
            String sql = "SELECT h.`code`,h.`name` FROM dm_hospital h WHERE h.`code` LIKE '%"+h+"%'";
            List<Map<String,Object>> hs = jdbcTemplate.queryForList(sql);
            rs.put("hospitals",hs);
        }else{
            rs.put("hospitals","");
        }
        return rs;
        return rs;
    }
    }
    //
    public int onMesSquareState(String mes){
        JSONObject json = new JSONObject(mes);
        Integer state = json.getInt("state");
        String code = json.getString("prescription");
        Prescription prescription = prescriptionDao.findByCode(code);
        Patient p = patientDao.findByCode(prescription.getPatient());
        if(state!=null&&state==1){
            //prescriptionNoticesService.sendMessages(weiXinAccessTokenUtils.getAccessToken(),prescription.getDoctor(),p.getCode());
        }
        return 0;
    }
}
}

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

@ -102,9 +102,10 @@ public class PrescriptionInfoController extends BaseController{
    @ObserverRequired
    @ObserverRequired
    public String updatePresInfo(@RequestParam(required = true)@ApiParam(value = "续方CODE", name = "code") String code,
    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 = true)@ApiParam(value = "续方药品JSON", name = "infos") String infos,
                                 @RequestParam(required = true)@ApiParam(value = "调整原因", name = "reason") String reason ){
                                 @RequestParam(required = false)@ApiParam(value = "疾病JSON", name = "infos") String diagnosis,
                                 @RequestParam(required = false)@ApiParam(value = "调整原因", name = "reason") String reason ){
        try {
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.updatePresInfo(code,infos,reason));
            return write(200, "操作成功!", "data",prescriptionInfoService.updatePresInfo(code,infos,diagnosis,reason));
        } catch (Exception e) {
        } catch (Exception e) {
            error(e);
            error(e);
            return error(-1, "查询失败!");
            return error(-1, "查询失败!");
@ -187,16 +188,28 @@ public class PrescriptionInfoController extends BaseController{
    @RequestMapping(value = "/getDoctorPrescriptionExpressage", method = RequestMethod.GET)
    @RequestMapping(value = "/getDoctorPrescriptionExpressage", method = RequestMethod.GET)
    @ResponseBody
    @ResponseBody
    @ApiOperation(value = "获取续方订单列表")
    @ApiOperation(value = "获取续方订单列表")
    public String getDoctorPrescriptionExpressage(@RequestParam(required = true) @ApiParam(value = "1:需跟踪;2:已接收", name = "type")  String type,
                                                  @RequestParam(required = true) @ApiParam(value = "患者姓名关键字", name = "nameKey")String nameKey,
                                                  @RequestParam(required = true) @ApiParam(value = "开始时间", name = "startDate")String startDate,
                                                  @RequestParam(required = true) @ApiParam(value = "结束时间", name = "endDate")String endDate,
                                                  @RequestParam(required = true) @ApiParam(value = "服务站", name = "hospital")String hospital,
                                                  @RequestParam(required = true) @ApiParam(value = "配送状态", name = "state")String state,
                                                  @RequestParam(required = true) @ApiParam(value = "页数", name = "page")Integer page,
                                                  @RequestParam(required = true) @ApiParam(value = "每页大小", name = "size")Integer size){
    public String getDoctorPrescriptionExpressage(@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 {
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.getDoctorPrescriptionExpressage(type,getUID(),nameKey,startDate,endDate,hospital,state,page,size));
            return write(200, "操作成功!", "data",prescriptionInfoService.getDoctorPrescriptionExpressage(type,"hxmD201703150222",nameKey,startDate,endDate,hospital,state,page,size));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/getPrescriptionExpressageFilter", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "获取续方订单列表过滤条件")
    public String getPrescriptionExpressageFilter(){
        try {
            return write(200, "操作成功!", "data",prescriptionInfoService.getPrescriptionExpressageFilter("hxmD201703150222"));
        } catch (Exception e) {
        } catch (Exception e) {
            error(e);
            error(e);
            return error(-1, "查询失败!");
            return error(-1, "查询失败!");

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

@ -1,6 +1,7 @@
package com.yihu.wlyy.web.patient.prescription;
package com.yihu.wlyy.web.patient.prescription;
import com.yihu.wlyy.service.app.prescription.PrescriptionInfoService;
import com.yihu.wlyy.service.app.prescription.PrescriptionInfoService;
import com.yihu.wlyy.util.SystemConf;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperation;
@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseBody;
import redis.clients.jedis.Jedis;
/**
/**
 * Created by Trick on 2017/7/25.
 * Created by Trick on 2017/7/25.
@ -87,9 +89,29 @@ public class PatientPrescriptionInfoController extends BaseController {
    @RequestMapping(value = "/cancelPrescriotion" , method = RequestMethod.POST)
    @RequestMapping(value = "/cancelPrescriotion" , method = RequestMethod.POST)
    @ResponseBody
    @ResponseBody
    @ApiOperation(value = "取消续方")
    @ApiOperation(value = "取消续方")
    public String cancelPrescriotion(@RequestParam(required = true)@ApiParam(name="code",value="续方CODE")String code){
    public String cancelPrescriotion(@RequestParam(required = true)@ApiParam(name="code",value="续方CODE")String code,
                                     @RequestParam(required = true)@ApiParam(name="reason",value="原因")String reason){
        try {
        try {
            return write(200, "查询成功!", "data", prescriptionInfoService.cancelPrescriotion(code));
            return write(200, "查询成功!", "data", prescriptionInfoService.cancelPrescriotion(code,reason));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "/testRedis" , method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation(value = "测试redis")
    public String testRedis(){
        try {
            //测试环境
            Jedis jedis = new Jedis("172.19.103.88");
            jedis.publish( SystemConf.getInstance().getSystemProperties().getProperty("redis_prescription_title"), "test1");
            Thread.sleep(5000);
            jedis.publish(SystemConf.getInstance().getSystemProperties().getProperty("redis_prescription_title"), "test2");
            Thread.sleep(5000);
            jedis.publish(SystemConf.getInstance().getSystemProperties().getProperty("redis_prescription_title"), "test3");
            return write(200, "查询成功!", "data", "发送成功");
        } catch (Exception e) {
        } catch (Exception e) {
            error(e);
            error(e);
            return error(-1, "查询失败!");
            return error(-1, "查询失败!");

+ 6 - 0
patient-co/patient-co-wlyy/src/main/resources/system.properties

@ -91,3 +91,9 @@ createSicardType=onepay.sicard.createurl
receiveNotify=wlyy.onepay.receiveNotify
receiveNotify=wlyy.onepay.receiveNotify
returnUrl=wlyy.onepay.returnUrl
returnUrl=wlyy.onepay.returnUrl
#长处方
#redist订阅消息主题
redis_prescription_title=redisPrescription
#是否需要药师审方
pharmacistExaminationType=false