Kaynağa Gözat

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

wangzhinan 5 yıl önce
ebeveyn
işleme
da3272c1ae

+ 53 - 21
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -162,6 +162,9 @@ public class ImService {
	@Autowired
	private HibenateUtils hibenateUtils;
	
	@Value("${wechat.id}")
	private String wxId;
	
	
	
	/**
@ -181,9 +184,13 @@ public class ImService {
				"a.id AS \"id\"," +
				"a.type AS \"type\"," +
				"a.title AS \"title\"," +
				"a.symptoms AS \"symptoms\"," +
				"to_char(a.czrq,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\"," +
				"b.status AS \"status\"," +
				"a.symptoms AS \"symptoms\",";
		if("xm_ykyy_wx".equals(wxId)){
			sql = sql + "to_char(a.czrq,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\",";
		}else{
			sql = sql + "date_format(a.czrq,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
		}
			sql = sql +"b.status AS \"status\"," +
				"b.evaluate AS \"evaluate\"," +
				"d.name AS \"doctorName\"," +
				"d.photo AS \"doctorphoto\"," +
@ -1591,9 +1598,14 @@ public class ImService {
		String sqlScoreList = "SELECT " +
				"a.score as \"score\"," +
				"a.score_type as \"score_type\"," +
				"a.content as \"content\"," +
				"to_char(b.create_time,'YYYY-MM-DD hh24:mi:ss')  AS \"create_time\"," +
				"c.type as \"type\"," +
				"a.content as \"content\",";
		if("xm_ykyy_wx".equals(wxId)){
			sqlScoreList +=  "to_char(b.create_time,'YYYY-MM-DD hh24:mi:ss')  AS \"create_time\",";
		}else{
			sqlScoreList +=  "date_format(b.create_time,'%Y-%m-%d %H:%i:%S' )  AS \"create_time\",";
		}
		
		sqlScoreList +=	"c.type as \"type\"," +
				"c.name as \"patientname\"," +
				"b.id as \"id\"," +
				"c.photo as \"patientphoto\"," +
@ -1702,9 +1714,13 @@ public class ImService {
					"a.id AS \"id\"," +
					"a.type AS \"type\"," +
					"a.title AS \"title\"," +
					"a.symptoms AS \"symptoms\"," +
					"to_char(a.czrq,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\"," +
					"b.status AS \"status\"," +
					"a.symptoms AS \"symptoms\",";
			if("xm_ykyy_wx".equals(wxId)){
				sql = sql + "to_char(a.czrq,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\",";
			}else{
				sql = sql + "date_format(a.czrq,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
			}
			sql = sql +	"b.status AS \"status\"," +
					"b.evaluate AS \"evaluate\"," +
					"d.name AS \"patientName\"," +
					"d.id as \"patientId\"," +
@ -1722,9 +1738,13 @@ public class ImService {
					"a.id AS \"id\"," +
					"a.type AS \"type\"," +
					"a.title AS \"title\"," +
					"a.symptoms AS \"symptoms\"," +
					"to_char(a.czrq,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\"," +
					"b.status AS \"status\"," +
					"a.symptoms AS \"symptoms\"," ;
			if("xm_ykyy_wx".equals(wxId)){
				sql = sql + "to_char(a.czrq,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\",";
			}else{
				sql = sql + "date_format(a.czrq,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
			}
			sql = sql +	"b.status AS \"status\"," +
					"b.evaluate AS \"evaluate\"," +
					"d.name AS \"patientName\"," +
					"d.id as \"patientId\"," +
@ -2080,9 +2100,13 @@ public class ImService {
				"a.id AS \"id\"," +
				"a.type AS \"type\"," +
				"a.title AS \"title\"," +
				"a.symptoms AS \"symptoms\"," +
				"to_char(a.czrq,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\"," +
				"b.status AS \"status\"," +
				"a.symptoms AS \"symptoms\"," ;
		if("xm_ykyy_wx".equals(wxId)){
			sql = sql + "to_char(a.czrq,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\",";
		}else{
			sql = sql + "date_format(a.czrq,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
		}
			sql = sql + "b.status AS \"status\"," +
				"b.evaluate AS \"evaluate\"," +
				"d.name AS \"patientName\"," +
				"d.id as \"patientId\"," +
@ -2383,9 +2407,13 @@ public class ImService {
					"a.id AS \"id\"," +
					"a.type AS \"type\"," +
					"a.title AS \"title\"," +
					"a.symptoms AS \"symptoms\"," +
					"to_char(a.czrq,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\"," +
					"b.status AS \"status\"," +
					"a.symptoms AS \"symptoms\",";
			if("xm_ykyy_wx".equals(wxId)){
				sql = sql + "to_char(a.czrq,'YYYY-MM-DD hh24:mi:ss')  AS \"czrq\",";
			}else{
				sql = sql + "date_format(a.czrq,'%Y-%m-%d %H:%i:%S' )  AS \"czrq\",";
			}
			sql = sql +"b.status AS \"status\"," +
					"b.evaluate AS \"evaluate\"," +
					"b.doctor AS \"doctorCode\"," +
					"b.actual_sender AS \"generalDoctor\"," +
@ -2415,9 +2443,13 @@ public class ImService {
					"patient.idcard AS \"patientIdcard\"," +
					"patient.sex AS \"patientsex\"," +
					"patient.photo AS \"patientphoto\"," +
					"op.id AS \"outpatientid\"," +
					"to_char(op.register_date,'YYYY-MM-DD hh24:mi:ss')  AS \"registerDate\"," +
					"op.status AS outpatientstatus " +
					"op.id AS \"outpatientid\"," ;
			if("xm_ykyy_wx".equals(wxId)){
				sql = sql + "to_char(op.register_date,'YYYY-MM-DD hh24:mi:ss')  AS \"registerDate\",";
			}else{
				sql = sql + "date_format(op.register_date,'%Y-%m-%d %H:%i:%S' )  AS \"registerDate\",";
			}
							sql = sql +		"op.status AS outpatientstatus " +
					"FROM wlyy_outpatient op," +
					"base_patient patient " +
					"WHERE op.patient=patient.id " +

+ 18 - 11
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -34,6 +34,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.*;
@ -84,6 +85,9 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	public BasePatientDao basePatientDao;
	@Autowired
	private WxTemplateService wxTemplateService;
	
	@Value("${wechat.id}")
	private String wxId;
	
	
@ -174,18 +178,21 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
			JSONObject result = new JSONObject();
			synchronized (outpatientCode.intern()){
				
				//1.调用挂号接口
				logger.info("调用挂号接口====START");
				net.sf.json.JSONObject res = prescriptionService.registerOutPatient(outpatientCode,doctorCode);
				String rsCode = (String)res.get("@RESULT");
				if("0".equals(rsCode)||"-2".equals(rsCode)){
					//挂号成功,已经挂号
				}else{
					String mes = (String)res.get("@MSG");
					failed(mes);
				if(!"xm_ykyy_wx".equals(wxId)){//中山医院-心脏中心需要挂号
					//1.调用挂号接口
					logger.info("调用挂号接口====START");
					net.sf.json.JSONObject res = prescriptionService.registerOutPatient(outpatientCode,doctorCode);
					
					String rsCode = (String)res.get("@RESULT");
					if("0".equals(rsCode)||"-2".equals(rsCode)){
						//挂号成功,已经挂号
					}else{
						String mes = (String)res.get("@MSG");
						failed(mes);
					}
					logger.info("调用挂号接口====END");
				}
				logger.info("调用挂号接口====END");
				
				
				//2.
				result = imService.addPrescriptionConsult(outpatientCode, patientCode,doctorCode,consult,reason,type);