소스 검색

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

wangzhinan 6 년 전
부모
커밋
088cd9fc49

+ 20 - 8
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();
		// 协同服务工单的服务对象表
@ -638,10 +643,11 @@ public class CustomerService extends BaseService{
		manageSynergyWorkorderServicerDO.setCode(UUID.randomUUID().toString());
		manageSynergyWorkorderServicerDO.setServicePatientCode(callService.getPatient());
		manageSynergyWorkorderServicerDO.setServicePatientName(callService.getPatientName());
		manageSynergyWorkorderServicerDO.setExecutorType(1);
		manageSynergyWorkorderServicerDao.save(manageSynergyWorkorderServicerDO);
		
		manageSynergyWorkorderExecutorDO.setWorkorderCode(manageSynergyWorkorderDO.getCode());
		manageSynergyWorkorderExecutorDO.setDel(0);
		manageSynergyWorkorderExecutorDO.setDel(1);
		manageSynergyWorkorderExecutorDO.setExecutorType(3);
		manageSynergyWorkorderExecutorDO.setExecutorCode(callService.getUser());
		manageSynergyWorkorderExecutorDO.setExecutorName(callService.getUserName());
@ -666,8 +672,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());
@ -720,10 +731,11 @@ public class CustomerService extends BaseService{
		manageSynergyWorkorderServicerDO.setServicePatientCode(callService.getPatient());
		manageSynergyWorkorderServicerDO.setServicePatientName(callService.getPatientName());
		manageSynergyWorkorderServicerDO.setCreateTime(new Date());
		manageSynergyWorkorderServicerDO.setExecutorType(1);
		manageSynergyWorkorderServicerDao.save(manageSynergyWorkorderServicerDO);
		
		manageSynergyWorkorderExecutorDO.setWorkorderCode(manageSynergyWorkorderDO.getCode());
		manageSynergyWorkorderExecutorDO.setDel(0);
		manageSynergyWorkorderExecutorDO.setDel(1);
		manageSynergyWorkorderExecutorDO.setExecutorType(3);
		manageSynergyWorkorderExecutorDO.setExecutorCode(callService.getUser());
		manageSynergyWorkorderExecutorDO.setExecutorName(callService.getUserName());

+ 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];
    }
    // 该工具类从网上抄来的,最后添加个获取方法就完成了,这样就能在代码级别通过环境条件来控制方法行为了。
}

+ 1 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/repository/imm/ChildImmuneVaccinDao.java

@ -15,6 +15,7 @@ import java.util.List;
public interface ChildImmuneVaccinDao extends PagingAndSortingRepository<ChildImmuneVaccin, Long>,
		JpaSpecificationExecutor<ChildImmuneVaccin> {
	@Query("select v from ChildImmuneVaccin v where v.barcode=?1 and v.del=0")
	List<ChildImmuneVaccin> findByBarcode(String barcode);
	@Modifying

+ 2 - 2
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/imm/ChildVaccinImmuneService.java

@ -79,7 +79,7 @@ public class ChildVaccinImmuneService extends BaseService {
					" WHERE" +
					" fi.del = 0";*/
            String sql ="SELECT `code`,`name`,idcard,ssc FROM wlyy_child_info WHERE del=0";
            String sql ="SELECT `code`,`name`,idcard,ssc,barcode FROM wlyy_child_info WHERE del=0";
			List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
			for (Map<String,Object> map : list){
				String barcode = String.valueOf(map.get("barcode"));
@ -127,7 +127,7 @@ public class ChildVaccinImmuneService extends BaseService {
										result+= childImmuneVaccinDao.updateDelByCode(childImmuneVaccin.getCode());
									}
								}
								//如果本地没有就是新增的
								//如果本地没有就是新增的.
								List<ChildImmuneVaccin> vaccins = new ArrayList<>();
								for (int j=0;j<vaccinJsonJSONArray.length();j++){
									String ymbm = vaccinJsonJSONArray.getJSONObject(j).getString("ymBm");

+ 12 - 4
patient-co/patient-co-wlyy-job/src/main/resources/application-dev.yml

@ -34,12 +34,20 @@ im:
  im_list_get: http://172.19.103.88:3000/
  data_base_name: ichat
#wechat:
#  appId: wxd03f859efdf0873d
#  appSecret: 2935b54b53a957d9516c920a544f2537
#  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
#  wechat_base_url: http%3a%2f%2fweixin.xmtyw.cn%2fwlyy-dev
#  accId: gh_ffd64560fb21
wechat:
  appId: wxd03f859efdf0873d
  appSecret: 2935b54b53a957d9516c920a544f2537
  appId: wxddece6347fe7fe87
  #appSecret: 988f005d8309ed1795939e0f042431fb
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fweixin.xmtyw.cn%2fwlyy-dev
  accId: gh_ffd64560fb21
  wechat_base_url: http%3a%2f%2fehr.yihu.com%2fwlyy
  #accId: gh_ffd64560fb21
  appSecret: 41ade403de3d0e2e450f54a324ec013a
  accId: gh_710bf0b315a1
  message:
   ##医生追加建议提醒 --签约邀请
   doctor_invitel_template: TLWrBtNE2kBJaFCdVzDOOnQC8N2TtRY9ZxEzwZXQcR0

+ 11 - 3
patient-co/patient-co-wlyy-job/src/main/resources/application-devtest.yml

@ -34,12 +34,20 @@ im:
  im_list_get: http://172.19.103.88:3000/
  data_base_name: im_new
#wechat:
#  appId: wx1f129f7b51701428
#  appSecret: 988f005d8309ed1795939e0f042431fb
#  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
#  wechat_base_url: http%3a%2f%2fehr.yihu.com%2fwlyy
#  accId: gh_ffd64560fb21
wechat:
  appId: wx1f129f7b51701428
  appSecret: 988f005d8309ed1795939e0f042431fb
  appId: wxddece6347fe7fe87
  #appSecret: 988f005d8309ed1795939e0f042431fb
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fehr.yihu.com%2fwlyy
  accId: gh_ffd64560fb21
  #accId: gh_ffd64560fb21
  appSecret: 41ade403de3d0e2e450f54a324ec013a
  accId: gh_710bf0b315a1
  message:
    ##医生追加建议提醒 --签约邀请
    doctor_invitel_template:  uXdBJVbrhKG-WLaCG4s8C4SXSr2kknQ94vKFt-3rIiA

+ 12 - 3
patient-co/patient-co-wlyy-job/src/main/resources/application-test.yml

@ -35,12 +35,21 @@ im:
  im_list_get: http://172.19.103.88:3000/
  data_base_name: im_new
#wechat:
#  appId: wx1f129f7b51701428
#  appSecret: 988f005d8309ed1795939e0f042431fb
#  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
#  wechat_base_url: http%3a%2f%2fehr.yihu.com%2fwlyy
#  accId: gh_ffd64560fb21
wechat:
  appId: wx1f129f7b51701428
  appSecret: 988f005d8309ed1795939e0f042431fb
  appId: wxddece6347fe7fe87
  #appSecret: 988f005d8309ed1795939e0f042431fb
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fehr.yihu.com%2fwlyy
  accId: gh_ffd64560fb21
  #accId: gh_ffd64560fb21
  appSecret: 41ade403de3d0e2e450f54a324ec013a
  accId: gh_710bf0b315a1
  message:
   ##医生追加建议提醒 --签约邀请
   doctor_invitel_template: YA8VtN_JYORLHrbEhQkNoRjlpJXIGVGnb4_OhVq4OBs

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/survey/SurveyScreenResultService.java

@ -1130,6 +1130,7 @@ public class SurveyScreenResultService extends BaseService {
    public JSONObject createWorkOrder(String jsonData, List<Map<String, Object>> patientInfo, String doctor) throws Exception {
        JSONObject object = new JSONObject(jsonData);
        JSONArray patientInfos = new JSONArray(patientInfo);
        Doctor d = doctorService.findDoctorByCode(doctor);
        //获取关联业务名称
        if(object.getInt("type") == 4){
            Survey survey = surveyDao.findById(object.getString("relationCode"));
@ -1139,10 +1140,9 @@ public class SurveyScreenResultService extends BaseService {
            SurveyTemplates templates = surveyTemplatesDao.findById(object.getString("relationCode"));
            object.put("relationCodeName", templates.getTitle());
            object.put("createUserRole", 1);
            object.put("hospital", d.getHospital());
            object.put("hospitalName", d.getHospitalName());
        }
        Doctor d = doctorService.findDoctorByCode(doctor);
        object.put("hospital", d.getHospital());
        object.put("hospitalName", d.getHospitalName());
        object.put("createUser", d.getCode());
        object.put("createUserName", d.getName());
        object.put("createUserType", 1);

+ 7 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/imm/ChildFamilyImmuneService.java

@ -398,11 +398,13 @@ public class ChildFamilyImmuneService extends BaseService {
		if (immVaccinList != null) {
			for (Map<String, Object> map : immVaccinList) {
				JSONObject jsonObject = new JSONObject();
				jsonObject.put("vaccinCode",map.get("code"));//待接种疫苗记录code
				jsonObject.put("childName", map.get("child_name"));//儿童姓名
				jsonObject.put("childCode", map.get("childCode"));//儿童code
				jsonObject.put("vaccinName", map.get("ymmc"));//疫苗名称
				jsonArray.put(jsonObject);
				if ("0".equals(String.valueOf(map.get("alert_tag")))){
                    jsonObject.put("vaccinCode",map.get("code"));//待接种疫苗记录code
                    jsonObject.put("childName", map.get("child_name"));//儿童姓名
                    jsonObject.put("childCode", map.get("childCode"));//儿童code
                    jsonObject.put("vaccinName", map.get("ymmc"));//疫苗名称
                    jsonArray.put(jsonObject);
                }
			}
		}
		alertJsonStr = jsonArray.toString();

+ 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(() -> {

+ 6 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/message/GcOtherMessageController.java

@ -94,13 +94,14 @@ public class GcOtherMessageController {
            }
            System.out.println("接收者id----"+patient.getOpenid());
            System.out.println("消息模板id----"+templateId);
            /*if ("oULM4xNdf4lqcjuq0-MGFRuhOcz8".equals(patient.getOpenid())){
                weiXinTempMsgSendUtils.sendTemplateMessage(templateId, patient.getOpenid(), url, new JSONObject(templateJson));
            }*/
            if ("3502110100".equals(signFamily.getHospital())){
            //郑松
            if ("oULM4xNdf4lqcjuq0-MGFRuhOcz8".equals(patient.getOpenid())){
                weiXinTempMsgSendUtils.sendTemplateMessage(templateId, patient.getOpenid(), url, new JSONObject(templateJson));
            }
            /*if ("3502110100".equals(signFamily.getHospital())){
                weiXinTempMsgSendUtils.sendTemplateMessage(templateId, patient.getOpenid(), url, new JSONObject(templateJson));
            }*/
            //秀萍
            if ("oULM4xPHQO1MYOPJdI9AtVKx3fIo".equals(patient.getOpenid())){
                weiXinTempMsgSendUtils.sendTemplateMessage(templateId, patient.getOpenid(), url, new JSONObject(templateJson));
            }

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/application-prod.yml

@ -180,12 +180,14 @@ es:
    FollowUp: wlyy_followup
    QuestionnaireWinning: wlyy_questionnaire_winning
    patientDevice: wlyy_patient_device
    patientRemindRecord: wlyy_patient_remind_record_prod
  type:
    HealthEduArticlePatient: health_edu_article_patient
    Statistics: wlyy_quota_prod
    FollowUpContent: wlyy_followup_content
    QuestionnaireWinning: wlyy_questionnaire_winning
    patientDevice: wlyy_patient_device
    patientRemindRecord: wlyy_patient_remind_record_prod
  host:  http://59.61.92.90:9065,http://59.61.92.90:9067
  tHost: 59.61.92.90:9066,59.61.92.90:9068
  clusterName: jkzl