Quellcode durchsuchen

Merge branch 'dev' of liuwenbin/patient-co-management into dev

liuwenbin vor 6 Jahren
Ursprung
Commit
3ac5987746

+ 16 - 6
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/account/CustomerService.java

@ -16,6 +16,7 @@ import com.yihu.wlyy.service.manager.sign.SignFamilyService;
import com.yihu.wlyy.service.synergy.SynergyManageService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.SpringContextUtil;
import io.swagger.models.auth.In;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
@ -73,7 +74,9 @@ public class CustomerService extends BaseService{
	private ManageSynergyWorkorderReserveConsultDao manageSynergyWorkorderReserveConsultDao;
	@Autowired
	private SynergyManageService synergyManageService;
	
	enum profile{
		dev,devtest,test,prod
	}
	@Value(("${doctorAssistant.api}")+"/wlyygc/doctor/message")
	private String messageApi;
@ -206,7 +209,6 @@ public class CustomerService extends BaseService{
			par.add(new BasicNameValuePair("mobiles", mobile));
			par.add(new BasicNameValuePair("content", msg));
			try {
				logger.info("====================================================================");
				String result = HttpClientUtil.post(messageApi+"/sendMessage",par,"UTF-8");
				logger.info("发送短信消息返回结果:"+result);
@ -582,9 +584,12 @@ public class CustomerService extends BaseService{
		callService = callServiceDao.save(callService);
		//待处理发送消息给医生
		sendCallServiceMes(callService);
		//发送消息
		sendWxMes(callService);
		
		String activeProfile = SpringContextUtil.getActiveProfile();
		if(profile.prod.name().equals(activeProfile)){//正式环境才推送
			//发送消息
			sendWxMes(callService);
		}
		//将旧数据存储到新表---------START
		ManageSynergyWorkorderDO manageSynergyWorkorderDO = new ManageSynergyWorkorderDO();
		// 协同服务工单的服务对象表
@ -666,8 +671,13 @@ public class CustomerService extends BaseService{
		callServiceDao.save(callService);
		//待处理发送消息给医生
		sendCallServiceMes(callService);
		//发送消息
		sendWxMes(callService);
		String activeProfile = SpringContextUtil.getActiveProfile();
		if(profile.prod.name().equals(activeProfile)){//正式环境才推送
			//发送消息
			sendWxMes(callService);
		}
		
		//将旧数据存储到新表---------START
		ManageSynergyWorkorderDO manageSynergyWorkorderDO = manageSynergyWorkOrderDao.findByRelationCode(callService.getCode());

+ 3 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/SynergyManageService.java

@ -250,7 +250,8 @@ public class SynergyManageService extends BaseJpaService {
                map.put("patientCode",ls.size()>0?ls.get(0):null);//1对1服务工单,服务对象code
            }
            map.put("typeName",workorderTypeName);//服务类型名称
            map.put("serviceTime", DateUtil.dateToStr((Date)one.get("service_time"),"yyyy-MM-dd HH:mm"));//服务时间
            map.put("serviceTime", one.get("service_time")!=null?DateUtil.dateToStr((Date)one.get("service_time"),"yyyy-MM-dd HH:mm"):"");//服务时间
            map.put("createTime",one.get("create_time")!=null?DateUtil.dateToStr((Date)one.get("create_time"),"yyyy-MM-dd HH:mm"):"");
            map.put("priority",one.get("priority"));//工单优先级
            map.put("priorityName",((Integer)one.get("priority"))==1?"加急":"普通");
            if(one.get("service_time")!=null){//咨询、随访、预约的服务时间是null
@ -919,6 +920,7 @@ public class SynergyManageService extends BaseJpaService {
            resultMap.put("workorderTypeName",workorderTypeName);
            resultMap.put("workorderType",one.get("workorder_type"));
            resultMap.put("priority",one.get("priority"));
            resultMap.put("relationCode",one.get("relation_code"));
            resultMap.put("relationCodeName",one.get("relation_code_name"));
            resultMap.put("serviceTime",DateUtil.dateToStr((Date)one.get("service_time"),"yyyy-MM-dd HH:mm:ss"));
            resultMap.put("reminderTime",DateUtil.dateToStr((Date)one.get("create_time"),"yyyy-MM-dd HH:mm:ss"));

+ 45 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/util/SpringContextUtil.java

@ -0,0 +1,45 @@
package com.yihu.wlyy.util;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
import java.util.Locale;
/**
 * Created by 刘文彬 on 2018/10/17.
 */
@Component
public class SpringContextUtil implements ApplicationContextAware {
    private static ApplicationContext context = null;
    /* (non Javadoc)
     * @Title: setApplicationContext
     * @Description: spring获取bean工具类
     * @param applicationContext
     * @throws BeansException
     * @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
     */
    @Override
    public void setApplicationContext(ApplicationContext applicationContext)
            throws BeansException {
        this.context = applicationContext;
    }
    // 传入线程中
    public static <T> T getBean(String beanName) {
        return (T) context.getBean(beanName);
    }
    // 国际化使用
    public static String getMessage(String key) {
        return context.getMessage(key, null, Locale.getDefault());
    }
    /// 获取当前环境
    public static String getActiveProfile() {
        return context.getEnvironment().getActiveProfiles()[0];
    }
    // 该工具类从网上抄来的,最后添加个获取方法就完成了,这样就能在代码级别通过环境条件来控制方法行为了。
}

+ 4 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEdu/DoctorJMJkEduArticleController.java

@ -149,6 +149,7 @@ public class DoctorJMJkEduArticleController extends BaseController {
            if(StringUtils.isEmpty(currentRoleLevel)){
                currentRoleLevel = getCurrentRoleLevel();
            }
            leaveWords = StringUtils.isNotEmpty(leaveWords)?leaveWords:"";
            jmJkEduArticleService.initPatient(patientSet,labelUnitType,labelSexType,labelServeType,labelDiseaseType,labelHealthType,getUID(),currentRoleCode,currentRoleLevel);
//            patientSet.add(patientService.findByCode("wjw00000001000e6badcfa163e424525"));
            //获取保存发送记录
@ -405,11 +406,11 @@ public class DoctorJMJkEduArticleController extends BaseController {
                    // 如果queue为空,则当前线程会堵塞,直到有新数据加入
                    JSONObject json = queue.take();
                    Set<String> patientSet = (Set<String>)json.get("patientSet");
                    String sendCode = json.get("patientSet")+"";
                    String sendCode = json.get("sendCode")+"";
                    String sendType = json.get("sendType")+"";
                    Long teamCode = Long.valueOf(json.get("teamCode")+"");
                    String articleId = json.get("articleId")+"";
                    String leaveWords = json.get("leaveWords")+"";
                    String leaveWords = json.get("leaveWords")!=null?json.get("leaveWords")+"":"";
                    String currentUserRole = json.get("currentUserRole")+"";
                    String currentUserRoleLevel = json.get("currentUserRoleLevel")+"";
                    List<HealthEduArticleES> healthEduArticleESList = jmJkEduArticleService.savePCPushArticle(patientSet, sendCode, Integer.parseInt(sendType),"", teamCode, articleId,leaveWords,currentUserRole,currentUserRoleLevel);
@ -475,6 +476,7 @@ public class DoctorJMJkEduArticleController extends BaseController {
            List<Object> results = teamDao.findAdminTeamByPatientSignTeam(patientCode, new PageRequest(0, 1));
            Object[] result = (Object[]) results.get(0);
//            jmJkEduArticleService.initPatients(patientSet,labelType,condition,groupType,teamId,getUID());
            leaveWords = StringUtils.isNotEmpty(leaveWords)?leaveWords:"";
            List<HealthEduArticleES> healthEduArticleESList = jmJkEduArticleService.savePCPushArticle(patientSet, getUID(), 1,"", Long.parseLong(result[0].toString()), articleId,leaveWords,currentUserRole,currentUserRoleLevel);
            //推送微信模板消息和发送im消息
            new Thread(() -> {