Browse Source

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

# Conflicts:
#	business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java
wangzhinan 5 years ago
parent
commit
cea4fb0db8

+ 12 - 0
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -3,6 +3,7 @@ package com.yihu.jw.order;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxPayLogDO;
@ -16,6 +17,7 @@ import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.order.dao.BusinessOrderRefundDao;
import com.yihu.jw.order.dao.ConsultDao;
import com.yihu.jw.order.pay.wx.WeChatConfig;
import com.yihu.jw.patient.dao.BasePatientDao;
@ -64,6 +66,9 @@ public class BusinessOrderService {
    private DoctorMappingDao doctorMappingDao;
    @Autowired
    private WlyyHospitalSysDictDao hospitalSysDictDao;
    @Autowired
    private ConsultDao consultDao;
    /**
@ -453,6 +458,13 @@ public class BusinessOrderService {
            BusinessOrderDO businessOrderDO = businessOrderDao.selectByOrderNo(seqNo);
            businessOrderDO.setPayTime(DateUtil.strToDate(timeEnd,DateUtil.YYYY_MM_DD_HH_MM_SS));
            businessOrderDO.setStatus(1);
            if (businessOrderDO!=null){
                if (businessOrderDO.getOrderCategory().equalsIgnoreCase("1")){
                    ConsultDo consultDo = consultDao.findOne(businessOrderDO.getRelationCode());
                    consultDo.setPayStatus(1);
                    consultDao.save(consultDo);
                }
            }
            ykyyService.updateYktOrderStatus(businessOrderDO.getOrderNo(),businessOrderDO.getStatus().toString());
            //操作微信日志表记录
            List<WxPayLogDO> wxPayLogDOs = wxPayLogDao.findBySeqNo(seqNo);

+ 30 - 0
business/base-service/src/main/java/com/yihu/jw/order/dao/ConsultDao.java

@ -0,0 +1,30 @@
package com.yihu.jw.order.dao;
import com.yihu.jw.entity.base.im.ConsultDo;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * 咨询表DAO类
 * @author huangwenjie
 */
public interface ConsultDao extends PagingAndSortingRepository<ConsultDo, String>, JpaSpecificationExecutor<ConsultDo> {
	
//	@Query("from ConsultDo a where a.relationCode = ?1")
//	ConsultDo findByRelationCode(String outpatientid);
//	// 查询患者咨询记录
//	Page<Object> findByPatient(String patient, String title, String id, PageRequest pageRequest);
//
//	// 查询患者咨询记录
//	Page<Object> findByPatient(String patient, String title, PageRequest pageRequest);
//
//	// 查询患者咨询记录
//	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate,a.signCode  from ConsultDo a,ConsultTeamDo b where a.code = b.consult and a.patient = ?1 and a.id < ?2 and a.del = '1' and a.type<>8 order by a.czrq desc")
//	Page<Object> findByPatient(String patient, String id, Pageable pageRequest);
//
//	// 查询患者咨询记录
//	@Query("select a.id,a.type,a.code,a.title,a.symptoms,a.czrq,b.status,b.doctor,b.team,b.evaluate,a.signCode  from ConsultDo a,ConsultTeamDo b where a.code = b.consult and a.patient = ?1 and a.del = '1' and a.type<>8 order by a.czrq desc")
//	Page<Object> findByPatient(String patient, Pageable pageRequest);
}

+ 27 - 18
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -45,6 +45,7 @@ import com.yihu.jw.util.common.FileUtil;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
@ -157,6 +158,9 @@ public class ImService {
	
	@Autowired
	private StringRedisTemplate redisTemplate;
	@Autowired
	private HibenateUtils hibenateUtils;
	
	
	
@ -170,35 +174,36 @@ public class ImService {
	 * @param status 状态
	 * @return
	 */
	public List<ConsultVO>  findConsultRecordByPatient(String patient, String id,String type, int page,int pagesize, String title,Integer status) {
	public List<Map<String,Object>>  findConsultRecordByPatient(String patient, String id,String type, int page,int pagesize, String title,Integer status,Integer payStatus) {
		if(page >=1){
	/*	if(page >=1){
			page --;
		}
		
		if (pagesize <= 0) {
			pagesize = 10;
		}
		}*/
		
		String  sql = "SELECT " +
				"a.id AS id," +
				"a.type AS type," +
				"a.title AS title," +
				"a.symptoms AS symptoms," +
				"a.czrq AS czrq," +
				"b.status AS status," +
				"b.evaluate AS evaluate," +
				"d.name AS doctorName," +
				"d.photo AS doctorphoto," +
				"d.job_title_name AS jobTitleName, " +
				"h.dept_name AS deptName " +
				"a.id AS \"id\"," +
				"a.type AS \"type\"," +
				"a.title AS \"title\"," +
				"a.symptoms AS \"symptoms\"," +
				"a.czrq AS \"czrq\"," +
				"b.status AS \"status\"," +
				"b.evaluate AS \"evaluate\"," +
				"d.name AS \"doctorName\"," +
				"d.photo AS \"doctorphoto\"," +
				"d.job_title_name AS \"jobTitleName\", " +
				"h.dept_name AS \"deptName\" " +
				"a.pay_status AS \"payStatus\","+
				"FROM wlyy_consult a," +
				"wlyy_consult_team b," +
				"base_doctor d, " +
				"base_doctor_hospital h " +
				"WHERE a.id=b.consult and d.id = h.doctor_code " +
				"AND b.doctor=d.id AND a.patient='"+patient+"' AND a.type in ("+type+")";
		List<ConsultVO> result = new ArrayList<>();
		/*List<ConsultVO> result = new ArrayList<>();*/
		
		if(!StringUtils.isEmpty(title)){
			title="%"+title+"%";
@ -219,10 +224,13 @@ public class ImService {
		if (!StringUtils.isEmpty(id)) {
			sql += " and a.id = '" + id + "'";
		}
		if (!StringUtils.isEmpty(payStatus)) {
			sql += " and a.pay_status = " + payStatus + "";
		}
		sql += " ORDER BY a.czrq desc limit "+page * pagesize+","+pagesize+"";
		
		result = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ConsultVO.class));
		
		List<Map<String,Object>> result = hibenateUtils.createSQLQuery(sql,page,pagesize);
		/*result = jdbcTemplate.query(sql, new BeanPropertyRowMapper(ConsultVO.class));*/
		return result;
	}
	
@ -960,6 +968,7 @@ public class ImService {
		consult.setSymptoms(symptoms);
		consult.setImages(images);
		consult.setType(type);
		consult.setPayStatus(0);
		return consultDao.save(consult);
	}
	

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/im/ConsultDo.java

@ -36,6 +36,8 @@ public class ConsultDo extends UuidIdentityEntity {
	private Date endTime;
	//关联业务表的code
	private String relationCode;
	//支付状态
	private Integer payStatus;
	
	public String getPatient() {
		return patient;
@ -117,4 +119,12 @@ public class ConsultDo extends UuidIdentityEntity {
	public void setRelationCode(String relationCode) {
		this.relationCode = relationCode;
	}
	public Integer getPayStatus() {
		return payStatus;
	}
	public void setPayStatus(Integer payStatus) {
		this.payStatus = payStatus;
	}
}

+ 7 - 7
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -122,15 +122,17 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
								@RequestParam(value = "type",required = true) String type,
								@ApiParam(name = "status", value = "咨询状态:0全部,1候诊中,2就诊中,3结束")
								@RequestParam(value = "status",required = false) Integer status,
								@ApiParam(name = "payStatus", value = "支付状态0支付1已支付")
								@RequestParam(value = "payStatus",required = false) Integer payStatus,
								@ApiParam(name = "page", value = "第几页")
								@RequestParam(value = "page",required = false) int page,
								@ApiParam(name = "pagesize", value = "分页大小")
								@RequestParam(value = "pagesize",required = false) int pagesize
								)throws Exception{
		JSONArray array = new JSONArray();
		List<ConsultVO>  data = imService.findConsultRecordByPatient(patient, id,type, page,pagesize, title,status);
		List<Map<String,Object>>  data = imService.findConsultRecordByPatient(patient, id,type, page,pagesize, title,status,payStatus);
		
		if (data != null) {
		/*if (data != null) {
			for (ConsultVO consult : data) {
				if (consult == null) {
					continue;
@ -160,7 +162,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
				
				array.add(json);
			}
		}
		}*/
		
		Long total = imService.countConsultRecordByPatient(patient, id,type,title);
		
@ -422,7 +424,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			hospitalSystemMessageService.saveMessage(systemMessageDO);
			BaseDoctorDO d = baseDoctorDao.findById(re.getString("doctor"));
			BasePatientDO p = basePatientDao.findById(re.getString("patient"));
			/*//眼科支付订单
			//眼科支付订单
			if (wxId.equalsIgnoreCase("xm_ykyy_wx")){
				if (type==1||type==2){
					BusinessOrderDO businessOrderDO = new BusinessOrderDO();
@ -440,9 +442,7 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
					}
					businessOrderService.saveOrder(businessOrderDO);
				}
			}*/
			}