Browse Source

留言次数限制

wangjun 4 years ago
parent
commit
7e732cd4b5

+ 0 - 24
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -883,30 +883,6 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        //3.创建候诊室
        createRoom(outpatient, chargeType);
        //发送企业模板消息给医生
        String msg = "";
        String name=outpatient.getPatientName();
        String sex = "";
        String age="";
        String date = "";
        String title = "";
        String url="https://hlwyy.xmzsh.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatient.getDescription()+"&type=3&id="+outpatient.getId();
        if (patientDO!=null){
            sex=IdCardUtil.getSexForIdcard(patientDO.getIdcard());
            age = IdCardUtil.getAgeForIdcard(patientDO.getIdcard())+"";
        }
        if (outpatient!=null){
            if (outpatient.getType().equalsIgnoreCase("1")){
                title = "图文复诊";
                msg = name+"("+sex+" "+age+"岁)向您发起了图文复诊,点击查看";
            }else if (outpatient.getType().equalsIgnoreCase("2")){
                title = "视频复诊";
                date = DateUtil.dateToStrLong(outpatient.getRegisterDate());
                msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,点击查看";
            }
        }
        enterpriseService.sendTWMesByDoctor("zsyy",outpatientDO.getDoctor(),title,msg,url);
        System.out.println("发送企业模板消息成功");
        String content = "向您发起了图文复诊,点击查看";
        return outpatient;

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetCommonService.java

@ -92,7 +92,7 @@ public class InternetCommonService extends BaseJpaService<InternetUpErrorLogDO,
    public String orgSub ;
    public String imgUrl;
    static String imgPath =File.separator+"usr"+File.separator+"local"+File.separator+"hospital"+File.separator+"svr-internet-hospital-job"+File.separator+"img"+File.separator;
    static String imgPath =File.separator+"usr"+File.separator+"local"+File.separator+"ehr"+File.separator+"svr-internet-hospital-job"+File.separator+"img"+File.separator;
    public ObjectMapper objectMapper;

+ 56 - 2
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -33,6 +33,7 @@ import com.yihu.jw.order.dao.ConsultOrderDao;
import com.yihu.jw.order.pay.wx.WeChatConfig;
import com.yihu.jw.order.pay.ylz.YlzPayService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.QrcodeUtil;
import com.yihu.jw.util.common.XMLUtil;
import com.yihu.jw.util.date.DateUtil;
@ -42,6 +43,7 @@ import com.yihu.jw.utils.ByteToInputStream;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.jw.wechat.dao.WxPayLogDao;
import com.yihu.jw.wechat.enterprise.EnterpriseService;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
@ -111,6 +113,8 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
    @Value("${wechat.id}")
    private String wechatId;
    @Autowired
    private EnterpriseService enterpriseService;
@ -1029,7 +1033,32 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        }else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("2")||businessOrderDO.getOrderCategory().equalsIgnoreCase("3")){
           WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode());
           wlyyOutpatientDO.setPayStatus(1);
           outpatientDao.save(wlyyOutpatientDO);
           WlyyOutpatientDO outpatientDO = outpatientDao.save(wlyyOutpatientDO);
            //发送企业模板消息给医生
            BasePatientDO patientDO = new BasePatientDO();
            String msg = "";
            String name=outpatientDO.getPatientName();
            String sex = "";
            String age="";
            String date = "";
            String title = "";
            String url="https://hlwyy.xmzsh.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
            if (patientDO!=null){
                sex= IdCardUtil.getSexForIdcard(patientDO.getIdcard());
                age = IdCardUtil.getAgeForIdcard(patientDO.getIdcard())+"";
            }
            if (outpatientDO!=null){
                if (outpatientDO.getType().equalsIgnoreCase("1")){
                    title = "图文复诊";
                    msg = name+"("+sex+" "+age+"岁)向您发起了图文复诊,点击查看";
                }else if (outpatientDO.getType().equalsIgnoreCase("2")){
                    title = "视频复诊";
                    date = DateUtil.dateToStrLong(outpatientDO.getRegisterDate());
                    msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,点击查看";
                }
            }
            enterpriseService.sendTWMesByDoctor("zsyy",outpatientDO.getDoctor(),title,msg,url);
            System.out.println("发送企业模板消息成功");
        } else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("4")) {
           List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(businessOrderDO.getRelationCode());
           if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){
@ -1064,7 +1093,32 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
        }else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("2")){
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode());
            wlyyOutpatientDO.setPayStatus(1);
            outpatientDao.save(wlyyOutpatientDO);
            WlyyOutpatientDO outpatientDO = outpatientDao.save(wlyyOutpatientDO);
            //发送企业模板消息给医生
            BasePatientDO patientDO = new BasePatientDO();
            String msg = "";
            String name=outpatientDO.getPatientName();
            String sex = "";
            String age="";
            String date = "";
            String title = "";
            String url="https://hlwyy.xmzsh.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId();
            if (patientDO!=null){
                sex= IdCardUtil.getSexForIdcard(patientDO.getIdcard());
                age = IdCardUtil.getAgeForIdcard(patientDO.getIdcard())+"";
            }
            if (outpatientDO!=null){
                if (outpatientDO.getType().equalsIgnoreCase("1")){
                    title = "图文复诊";
                    msg = name+"("+sex+" "+age+"岁)向您发起了图文复诊,点击查看";
                }else if (outpatientDO.getType().equalsIgnoreCase("2")){
                    title = "视频复诊";
                    date = DateUtil.dateToStrLong(outpatientDO.getRegisterDate());
                    msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,点击查看";
                }
            }
            enterpriseService.sendTWMesByDoctor("zsyy",outpatientDO.getDoctor(),title,msg,url);
            System.out.println("发送企业模板消息成功");
        } else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("4")) {
            List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(businessOrderDO.getRelationCode());
            if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){

+ 88 - 3
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -2276,7 +2276,7 @@ public class ImService {
	 */
	public Long countConsultRecordByDoctor(String doctor, String id,String type, Integer status,String title,String start_time,String end_time) {
		
		String  sql = "SELECT " +
		/*String  sql = "SELECT " +
				" COUNT(1) AS \"total\" " +
				"FROM wlyy_consult_team b," +
				"base_patient d," +
@ -2302,7 +2302,7 @@ public class ImService {
			}else {
				sql +=" and a.czrq >= '"+start_time+"'";
			}
			/*sql +=" and a.czrq >= '"+start_time+"'";*/
			*//*sql +=" and a.czrq >= '"+start_time+"'";*//*
		}
		
		if(!StringUtils.isEmpty(end_time)){
@ -2343,8 +2343,93 @@ public class ImService {
		Long count = 0L;
		if (rstotal != null && rstotal.size() > 0) {
			count = Long.parseLong(rstotal.get(0).get("total").toString());
		}*/
		String  sql = "";
		//专家咨询
		if("1".equals(type) || "15".equals(type) || type.contains(",")){
			sql = "SELECT " +
					" COUNT(1) AS \"total\" "+
					"FROM wlyy_consult a," +
					"wlyy_consult_team b," +
					"base_patient d " +
					"WHERE a.id=b.consult " +
					"AND b.patient=d.id ";
		}else{
			sql = "SELECT " +
					" COUNT(1) AS \"total\" "+
					"FROM wlyy_consult_team b," +
					"base_patient d," +
					"wlyy_consult a   " +
					"left join wlyy_outpatient op on  a.relation_code = op.id " +
					"WHERE a.id=b.consult " +
					"AND b.patient=d.id ";
		}
		if (org.apache.commons.lang.StringUtils.isNotBlank(doctor)){
			sql+=" AND b.doctor='"+doctor+"' ";
		}
		if(!StringUtils.isEmpty(title)){
			title="%"+title+"%";
			sql +=" and a.symptoms like '"+title+"'";
		}
		if(!StringUtils.isEmpty(start_time)){
			if("xm_ykyy_wx".equals(wxId)){
				if (flag){
					sql +=" and a.czrq >= str_to_date('"+start_time+"','YYYY-MM-DD HH24:MI:SS')";
				}else {
					sql +=" and a.czrq >= to_date('"+start_time+"','YYYY-MM-DD HH24:MI:SS')";
				}
			}else {
				sql +=" and a.czrq >= '"+start_time+"'";
			}
		}
		if(!StringUtils.isEmpty(end_time)){
			if("xm_ykyy_wx".equals(wxId)){
				if (flag){
					sql +=" and a.czrq <= str_to_date('"+end_time+"','YYYY-MM-DD HH24:MI:SS')";
				}else {
					sql +=" and a.czrq <= to_date('"+end_time+"','YYYY-MM-DD HH24:MI:SS')";
				}
			}else {
				sql +=" and a.czrq <= '"+end_time+"'";
			}
		}
		//咨询状态
		if(status != 0){
			if(status ==2 ){//就诊中
				sql +=" and b.status = 0 ";
			}else if(status ==3 ){
				sql +=" and b.status = 1 ";
			}else{}
		}
		//咨询类型
		if(!StringUtils.isEmpty(type)&&!type.equalsIgnoreCase("0")){
			sql +=" AND a.type in ("+type+")" ;
		}
		if (!StringUtils.isEmpty(id)) {
			sql += " and a.id = '" + id + "'";
		}
		sql += " ORDER BY a.czrq desc ";
		List<Map<String,Object>> mapList = hibenateUtils.createSQLQuery(sql);
		Long count = 0L;
		if (mapList != null && mapList.size() > 0) {
			count = Long.parseLong(mapList.get(0).get("total").toString());
		}
		
		return count;
	}
	

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/base/version/AppVersionDO.java

@ -102,7 +102,7 @@ public class AppVersionDO extends IntegerIdentityEntity {
        this.info = info;
    }
	@Column(name = "size")
	@Column(name = "app_size")
    public double getSize() {
        return size;
    }

+ 1 - 1
svr/svr-base/src/main/resources/application.yml

@ -196,7 +196,7 @@ spring:
    host: 172.26.0.253 # Redis server host.
    port: 6379 # Redis server port.
fastDFS:
  fastdfs_file_url: http://172.19.103.54:80/
  fastdfs_file_url: http://172.26.0.110:8888/
demo:
  flag: true
hospital:

+ 1 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/rehabilitation/RehabilitationPlanService.java

@ -164,6 +164,7 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
        for (String code : map.keySet()){
            TemplateDetailVo detailVo = new TemplateDetailVo();
            detailVo.setCode(code);
            detailVo.setId(code);
            detailVo.setList(map.get(code));
            for (RehabilitationServiceItemDO item:itemDOList){
                if(code.equals(item.getCode())){

+ 9 - 0
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/vo/TemplateDetailVo.java

@ -8,6 +8,7 @@ import java.util.List;
 * Created by yeshijie on 2020/8/7.
 */
public class TemplateDetailVo {
    private String id;//兼容之前的版本
    private String code;
    private String name;
    private List<RehabilitationTemplateDetailDO> list;
@ -35,4 +36,12 @@ public class TemplateDetailVo {
    public void setList(List<RehabilitationTemplateDetailDO> list) {
        this.list = list;
    }
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
}