Browse Source

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

trick9191 7 years ago
parent
commit
a45dfb4a33
40 changed files with 743 additions and 211 deletions
  1. 5 4
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/prescription/PrescriptionService.java
  2. 3 3
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/device/device_list_js.jsp
  3. 3 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_list_js.jsp
  4. 13 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/PrescriptionController.java
  5. 108 0
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java
  6. 7 6
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java
  7. 16 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/web/quota/JobController.java
  8. 38 7
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java
  9. 19 58
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java
  10. 8 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java
  11. 12 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java
  12. 25 8
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java
  13. 23 6
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/QrcodeService.java
  14. 41 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/RoleService.java
  15. 12 11
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java
  16. 12 6
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jkEduArticle/ThirdJkEduArticleService.java
  17. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/ylz/ThirdMessageService.java
  18. 28 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java
  19. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/DateUtil.java
  20. 53 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/BaseController.java
  21. 7 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java
  22. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthEduArticleController.java
  23. 34 21
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEduPC/DoctorJMJkEduArticlePCController.java
  24. 10 7
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java
  25. 16 30
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java
  26. 52 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/HealthEduArticleController.java
  27. 3 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcLableController.java
  28. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/service/GcEduArticleService.java
  29. 30 13
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkEduArticle/ThirdJkEduArticleController.java
  30. 3 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkedu/controller/doctor/EduLableController.java
  31. 127 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/ylzpay/ThirdOnepayController.java
  32. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/ylzpay/ThirdQrcodeController.java
  33. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/wx/OnePayController.java
  34. 17 14
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/process/WeiXinEventProcess.java
  35. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-dev.yml
  36. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml
  37. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-local.yml
  38. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml
  39. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-prod.yml
  40. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-test.yml

+ 5 - 4
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/prescription/PrescriptionService.java

@ -50,6 +50,9 @@ public class PrescriptionService extends BaseService {
				"p.health_problem_name," +
				"p.health_problem_name," +
				"p.pay," +
				"p.pay," +
				"CASE p.STATUS " +
				"CASE p.STATUS " +
					"WHEN 10 THEN '开方中' " +
					"WHEN 21 THEN '药师审核失败' " +
					"WHEN 69 THEN '药品已配送' " +
					"WHEN 31 THEN '开方失败' " +
					"WHEN 31 THEN '开方失败' " +
					"WHEN 40 THEN '开方完成/待支付' " +
					"WHEN 40 THEN '开方完成/待支付' " +
					"WHEN 50 THEN '支付成功/待配药' " +
					"WHEN 50 THEN '支付成功/待配药' " +
@ -122,10 +125,8 @@ public class PrescriptionService extends BaseService {
		prescriptionsql = prescriptionsql+ ") p ORDER BY p.create_time DESC";
		prescriptionsql = prescriptionsql+ ") p ORDER BY p.create_time DESC";
		
		
		if(ispage){
		if(ispage){
			if(1 == page){
				page = page-1;
			}
			prescriptionsql = prescriptionsql +" limit " + page*pageSize+", "+pageSize;
			page = page-1;
			prescriptionsql = prescriptionsql +" limit " + page*pageSize+", "+(page+1)*pageSize;
		}
		}
		
		
		list =  jdbcTemplate.query(prescriptionsql,new BeanPropertyRowMapper(PrescriptionVO.class));
		list =  jdbcTemplate.query(prescriptionsql,new BeanPropertyRowMapper(PrescriptionVO.class));

+ 3 - 3
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/device/device_list_js.jsp

@ -68,15 +68,15 @@
                        //设备编号
                        //设备编号
                        var deviceCode = $("<input type='hidden' name='deviceCode' />")
                        var deviceCode = $("<input type='hidden' name='deviceCode' />")
                        deviceName.attr('value',$("#deviceCode").val());
                        deviceName.attr('value',$("#inp_device_code").val());
                        //社区名称
                        //社区名称
                        var orgName = $("<input type='hidden' name='orgName' />")
                        var orgName = $("<input type='hidden' name='orgName' />")
                        deviceName.attr('value',$("#orgName").val());
                        deviceName.attr('value',$("#inp_org_name").val());
                        //联系人
                        //联系人
                        var orgName = $("<input type='hidden' name='linkman' />")
                        var orgName = $("<input type='hidden' name='linkman' />")
                        deviceName.attr('value',$("#linkman").val());
                        deviceName.attr('value',$("#inp_linkman").val());
                        myform.append(deviceName);
                        myform.append(deviceName);
                        myform.append(deviceCode);
                        myform.append(deviceCode);

+ 3 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/prescription/prescription_list_js.jsp

@ -121,11 +121,14 @@
                    retrieve.statusBox = $("#inp_status").ligerComboBox({
                    retrieve.statusBox = $("#inp_status").ligerComboBox({
                        width: 150,
                        width: 150,
                        data: [
                        data: [
                            {text: '开方中', statusId: '10'},
                            {text: '药师审核失败', statusId: '21'},
                            {text: '开方失败', statusId: '31'},
                            {text: '开方失败', statusId: '31'},
                            {text: '开方完成/待支付', statusId: '40'},
                            {text: '开方完成/待支付', statusId: '40'},
                            {text: '支付成功/待配药', statusId: '50'},
                            {text: '支付成功/待配药', statusId: '50'},
                            {text: '配药成功/待配送', statusId: '60'},
                            {text: '配药成功/待配送', statusId: '60'},
                            {text: '配送中', statusId: '65'},
                            {text: '配送中', statusId: '65'},
                            {text: '药品已配送', statusId: '69'},
                            {text: '配送到患者手中/已完成', statusId: '100'},
                            {text: '配送到患者手中/已完成', statusId: '100'},
                            {text: '线下退费', statusId: '-4'},
                            {text: '线下退费', statusId: '-4'},
                            {text: '支付超时', statusId: '-3'},
                            {text: '支付超时', statusId: '-3'},

+ 13 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/PrescriptionController.java

@ -113,6 +113,19 @@ public class PrescriptionController extends BaseController{
			return Result.error(e.getMessage());
			return Result.error(e.getMessage());
		}
		}
	}
	}
	
	@RequestMapping(value = "offlinepay",method = RequestMethod.POST)
	@ApiOperation("接收线下支付消息")
	public Result offlinepay(@ApiParam(name="data",value="json串",defaultValue = "{}")
	                                 @RequestParam(value = "data",required = true) String data){
		try {
			
			return prescriptionService.offlinepay(data);
		}catch (Exception e){
			e.printStackTrace();
			return Result.error(e.getMessage());
		}
	}
	/***************************************获取im消息*****************************************************/
	/***************************************获取im消息*****************************************************/
	@RequestMapping(value = "getLoglist",method = RequestMethod.GET)
	@RequestMapping(value = "getLoglist",method = RequestMethod.GET)

+ 108 - 0
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionService.java

@ -1229,4 +1229,112 @@ public class PrescriptionService extends ZysoftBaseService{
    
    
        return response;
        return response;
    }
    }
    
    /**
     * 接收线下支付消息
     * 收到该消息,直接修改出访卫已支付,已结算、等待发药状态
     * @param data
     * @return
     * @throws Exception
     */
    public Result offlinepay(String data)  throws Exception{
        String error = null;
        String status = "1";
        String errMsg = null;
        try{
            JSONObject json = JSONObject.parseObject(data);
            Integer code = json.getInteger("CODE");
            if(code==1){
                String orderNo = json.getString("ORDER_NO");//挂号编号
                String recipeNo = json.getString("RECIPE_NO");//处方编号
            
                Prescription prescription = prescriptionDao.findByVisitNoAndRecipeNo(orderNo,recipeNo);
                if(prescription.getStatus().equals(PrescriptionLog.PrescriptionLogStatus.pay_success.getValue())){
                
                    if(2 == prescription.getDispensaryType()){//如果是快递配送,则直接修改成配送中
                        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());
                    } else{
                        prescription.setStatus(PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue());
                    }
                
                    prescription.setDrugDeliveryTime(new Date());
                    prescriptionDao.save(prescription);
                
                    //新增log表
                    PrescriptionLog log = new PrescriptionLog();
                    log.setPrescriptionCode(prescription.getCode());
                    log.setCode(getCode());
                    log.setCreateTime(new Date());
                    log.setType(PrescriptionLog.PrescriptionLogType.zy.getValue());
                    log.setUserType(2);
                    log.setHospital(prescription.getHospital());
                    log.setHospitalName(prescription.getHospitalName());
                    log.setUserName(prescription.getDoctorName());
                    log.setFlag(1);
                    log.setUserCode(prescription.getDoctor());
                    if(2 == prescription.getDispensaryType()){//如果是快递配送,则直接修改成配送中
                        log.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing.getValue());
                        log.setRemark("快递配送:配药成功,配送中");
                        prescriptionLogDao.save(log);
                    } else{
                        log.setStatus(PrescriptionLog.PrescriptionLogStatus.wait_expressage.getValue());
                        log.setRemark("配药成功");
                        prescriptionLogDao.save(log);
                    
                        //健管师配送
                        PrescriptionExpressage expressage = prescriptionExpressageDao.findByPrescriptionCode(prescription.getCode());
                        if(StringUtils.isNotBlank(expressage.getExpressageCode())){
                            Message message = new Message();
                            message.setCzrq(new Date());
                            message.setCreateTime(new Date());
                            message.setRead(1);//设置未读
                            message.setOver("1");
                            message.setReceiver(expressage.getExpressageCode());
                            message.setSender("system");
                            message.setCode(getCode());
                            message.setSenderName("系统");
                            message.setTitle("居民"+prescription.getPatientName()+"的续方订单待取药");
                            message.setContent("您有一条新的续方订单待取药!");
                            message.setType(7);//续方订单待取药
                            message.setReadonly(1);//是否只读消息
                            message.setDel("1");
                            message.setRelationCode(prescription.getCode());
                            message.setPrescriptionStatus("0");//待取药
                            message.setData(prescription.getAdminTeamId()+"");
                            messageDao.save(message);
                        }
                    
                        //判断提示健管师有续方代配送,居民待取药
                        JSONObject message = new JSONObject();
                        message.put("title","dispensingComplete");
                        message.put("state",1);
                        message.put("prescription",prescription.getCode());
                        message.put("mes","success");
//                redisTemplate.convertAndSend(channelTopic,message.toString());
//                redisTemplate.watch(channelTopic);
                        redisTemplate.opsForList().leftPush(channelTopic,message.toString());
//                redisTemplate.unwatch();
                    }
                
                }else {
                    error = "code:"+prescription.getCode()+",status:"+prescription.getStatus();
                }
            }else{
                error = "code:"+code;
            }
        
        }catch (JSONException ex){
            ex.printStackTrace();
            error = ex.getMessage();
            errMsg = ex.getMessage();
            status = "0";
        }catch (Exception e){
            e.printStackTrace();
            error = e.getMessage();
            status = "0";
        }
        //添加日志
        return addZyPushLog(data,"offlinepay","接收线下支付消息",error,"POST",status,"1",errMsg);
        
    }
}
}

+ 7 - 6
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/app/prenatalInspector/PrenatalInspectorPreCardService.java

@ -135,10 +135,10 @@ public class PrenatalInspectorPreCardService extends BaseService {
                    String doctor = signFamily.getDoctor();
                    String doctor = signFamily.getDoctor();
                    String doctorHealth = signFamily.getDoctorHealth();
                    String doctorHealth = signFamily.getDoctorHealth();
                    if (StringUtils.isNotEmpty(doctor)) {
                    if (StringUtils.isNotEmpty(doctor)) {
                        saveMessageRecord(plan.getId().toString(), doctor, content);
                        saveMessageRecord(plan.getId().toString(), doctor,code, content);
                    }
                    }
                    if (StringUtils.isNotEmpty(doctorHealth)) {
                    if (StringUtils.isNotEmpty(doctorHealth)) {
                        saveMessageRecord(plan.getId().toString(), doctorHealth, content);
                        saveMessageRecord(plan.getId().toString(), doctorHealth,code, content);
                    }
                    }
                }
                }
            }
            }
@ -153,10 +153,11 @@ public class PrenatalInspectorPreCardService extends BaseService {
     *
     *
     * @param prenatalId
     * @param prenatalId
     * @param doctor
     * @param doctor
     * @param patient
     * @param content
     * @param content
     * @throws Exception
     * @throws Exception
     */
     */
    public void saveMessageRecord(String prenatalId, String doctor, String content) throws Exception {
    public void saveMessageRecord(String prenatalId, String doctor,String patient, String content) throws Exception {
        try {
        try {
            Doctor doc = doctorDao.findByCode(doctor);
            Doctor doc = doctorDao.findByCode(doctor);
            String doctorName = doc.getName();
            String doctorName = doc.getName();
@ -180,7 +181,7 @@ public class PrenatalInspectorPreCardService extends BaseService {
            }
            }
            record.setRelation(prenatalId);
            record.setRelation(prenatalId);
            record.setSender("SYSTEM");
            record.setSender(patient);
            record.setReceiver(doctor);
            record.setReceiver(doctor);
            record.setType(2);
            record.setType(2);
            record.setName(doctorName);
            record.setName(doctorName);
@ -195,11 +196,11 @@ public class PrenatalInspectorPreCardService extends BaseService {
            message.setRead(1);
            message.setRead(1);
            message.setOver("1");
            message.setOver("1");
            message.setReceiver(doctor);
            message.setReceiver(doctor);
            message.setSender("SYSTEM");
            message.setSender(patient);
            message.setCode(getCode());
            message.setCode(getCode());
            message.setTitle("孕检提醒");
            message.setTitle("孕检提醒");
            message.setContent(content);
            message.setContent(content);
            message.setType(2);
            message.setType(13);
            messageDao.save(message);
            messageDao.save(message);
            // 推送消息给医生
            // 推送消息给医生
            pushMsgTask.put(doctor, "13", "孕检提醒", content, "");
            pushMsgTask.put(doctor, "13", "孕检提醒", content, "");

+ 16 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/web/quota/JobController.java

@ -713,4 +713,20 @@ public class JobController extends BaseController {
            return invalidUserException(e, -1, "启动失败:" + e.getMessage());
            return invalidUserException(e, -1, "启动失败:" + e.getMessage());
        }
        }
    }
    }
    /**
     * 医生端产检系统提醒
     * @return
     */
    @RequestMapping(value = "startDoctorPrenatalInspectorJob", method = RequestMethod.GET)
    @ApiOperation("医生端产检系统提醒")
    public String startDoctorPrenatalInspectorJob() {
        try {
            quartzHelper.startNow(DoctorPrenatalInspectorJob.class, "DOCTOR_PRENATAL_INSPECTOR_JOB", null);
            return success("启动成功!");
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "启动失败:" + e.getMessage());
        }
    }
}
}

+ 38 - 7
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -259,9 +259,12 @@ public class SignPatientLabelInfoService extends BaseService {
     * @param pagesize  页大小
     * @param pagesize  页大小
     * @param isSlowDisease 是否是慢病管理
     * @param isSlowDisease 是否是慢病管理
     * @param diseaseCondition
     * @param diseaseCondition
     * @param  isFollowWeChat
     * @return
     * @return
     */
     */
    public JSONArray getPatientByLabel(String doctor, String labelCode, String labelType, Long teamCode, int page, int pagesize, boolean isSlowDisease, String diseaseCondition) throws Exception {
    public JSONArray getPatientByLabel(String doctor, String labelCode, String labelType,
                                       Long teamCode, int page, int pagesize, boolean isSlowDisease,
                                       String diseaseCondition,boolean isFollowWeChat) throws Exception {
        Doctor doc = doctorDao.findByCode(doctor);
        Doctor doc = doctorDao.findByCode(doctor);
        if (doc == null) {
        if (doc == null) {
@ -307,6 +310,9 @@ public class SignPatientLabelInfoService extends BaseService {
            } else {
            } else {
                throw new Exception("label is not exist");
                throw new Exception("label is not exist");
            }
            }
            if(isFollowWeChat){
                sql += "  AND p.openid IS NOT NULL AND p.openid <>'' ";
            }
            sql += " order by p.standard_status DESC ,p.disease_condition DESC,t2.label DESC,t1.openid DESC ,convert(t1.name using gbk) ";
            sql += " order by p.standard_status DESC ,p.disease_condition DESC,t2.label DESC,t1.openid DESC ,convert(t1.name using gbk) ";
            args = new Object[]{doctor, doctor, teamCode};
            args = new Object[]{doctor, doctor, teamCode};
        }else if("1".equals(labelType)){
        }else if("1".equals(labelType)){
@ -325,6 +331,11 @@ public class SignPatientLabelInfoService extends BaseService {
            if(StringUtils.isNotBlank(diseaseCondition)){
            if(StringUtils.isNotBlank(diseaseCondition)){
                sql = sql + " AND p.disease_condition ="+diseaseCondition;
                sql = sql + " AND p.disease_condition ="+diseaseCondition;
            }
            }
    
            if(isFollowWeChat){
                sql += "  AND p.openid IS NOT NULL AND p.openid <>'' ";
            }
            
            sql = sql +" order by p.standard_status DESC ,p.disease_condition DESC,t2.label DESC,t1.openid DESC ,convert(t1.name using gbk) ";
            sql = sql +" order by p.standard_status DESC ,p.disease_condition DESC,t2.label DESC,t1.openid DESC ,convert(t1.name using gbk) ";
            args = new Object[]{doctor, doctor, teamCode};
            args = new Object[]{doctor, doctor, teamCode};
        }else if("3".equals(labelType) && isSlowDisease){
        }else if("3".equals(labelType) && isSlowDisease){
@ -345,7 +356,13 @@ public class SignPatientLabelInfoService extends BaseService {
                    "    AND t1.patient = t2.patient " +
                    "    AND t1.patient = t2.patient " +
                    "    AND (t1.doctor = ? or t1.doctor_health = ?)" +
                    "    AND (t1.doctor = ? or t1.doctor_health = ?)" +
                    "    AND t1.status > 0 " +
                    "    AND t1.status > 0 " +
                    "    AND t1.admin_team_code = ? order by p.standard_status DESC ,p.disease_condition DESC,t2.label DESC,t1.openid DESC ,convert(t1.name using gbk) ";
                    "    AND t1.admin_team_code = ? ";
    
            if(isFollowWeChat){
                sql += "  AND p.openid IS NOT NULL AND p.openid <>'' ";
            }
    
            sql = sql + " order by p.standard_status DESC ,p.disease_condition DESC,t2.label DESC,t1.openid DESC ,convert(t1.name using gbk) ";
            if(StringUtils.isNotBlank(diseaseCondition)) {
            if(StringUtils.isNotBlank(diseaseCondition)) {
                args = new Object[]{labelCode, diseaseCondition, labelType, doctor, doctor, teamCode};
                args = new Object[]{labelCode, diseaseCondition, labelType, doctor, doctor, teamCode};
            }else{
            }else{
@ -365,7 +382,11 @@ public class SignPatientLabelInfoService extends BaseService {
                        "    t2.patient is null " +
                        "    t2.patient is null " +
                        "    AND (t1.doctor = ? or t1.doctor_health = ?) " +
                        "    AND (t1.doctor = ? or t1.doctor_health = ?) " +
                        "    AND t1.status > 0 " +
                        "    AND t1.status > 0 " +
                        "    AND t1.admin_team_code = ? order by p.standard_status DESC ,p.disease_condition DESC,t2.label DESC,t1.openid DESC ,convert(t1.name using gbk)";
                        "    AND t1.admin_team_code = ? ";
                if(isFollowWeChat){
                    sql += "  AND p.openid IS NOT NULL AND p.openid <>'' ";
                }
                sql  +=  "order by p.standard_status DESC ,p.disease_condition DESC,t2.label DESC,t1.openid DESC ,convert(t1.name using gbk)";
                args = new Object[]{labelType, doctor, doctor, teamCode};
                args = new Object[]{labelType, doctor, doctor, teamCode};
            }else {
            }else {
@ -382,7 +403,11 @@ public class SignPatientLabelInfoService extends BaseService {
                        "    AND t1.patient = t2.patient " +
                        "    AND t1.patient = t2.patient " +
                        "    AND (t1.doctor = ? or t1.doctor_health = ?)" +
                        "    AND (t1.doctor = ? or t1.doctor_health = ?)" +
                        "    AND t1.status > 0 " +
                        "    AND t1.status > 0 " +
                        "    AND t1.admin_team_code = ? order by p.standard_status DESC ,p.disease_condition DESC,t2.label DESC,p.openid DESC ,convert(t1.name using gbk)";
                        "    AND t1.admin_team_code = ? " ;
                if(isFollowWeChat){
                    sql += "  AND p.openid IS NOT NULL AND p.openid <>'' ";
                }
                sql +=  " order by p.standard_status DESC ,p.disease_condition DESC,t2.label DESC,p.openid DESC ,convert(t1.name using gbk)";
                args = new Object[]{labelCode, labelType, doctor, doctor, teamCode};
                args = new Object[]{labelCode, labelType, doctor, doctor, teamCode};
            }
            }
@ -2003,6 +2028,7 @@ public class SignPatientLabelInfoService extends BaseService {
     *
     *
     * @param doctor
     * @param doctor
     * @param filter
     * @param filter
     * @param isFollowWeChat
     * @return
     * @return
     * @throws Exception
     * @throws Exception
     */
     */
@ -2010,7 +2036,8 @@ public class SignPatientLabelInfoService extends BaseService {
                                        String labelCode, String labelType, long teamCode,
                                        String labelCode, String labelType, long teamCode,
                                        String exLabelCode,
                                        String exLabelCode,
                                        String exLabelType,
                                        String exLabelType,
                                        int page, int pagesize) throws Exception {
                                        int page, int pagesize,
                                        boolean isFollowWeChat) throws Exception {
        Doctor doc = doctorDao.findByCode(doctor);
        Doctor doc = doctorDao.findByCode(doctor);
        if (doc == null) {
        if (doc == null) {
            throw new Exception("doctor info can not find");
            throw new Exception("doctor info can not find");
@ -2037,8 +2064,12 @@ public class SignPatientLabelInfoService extends BaseService {
                (StringUtils.isNotEmpty(labelCode) ? " AND t2.label = ? " : "") +
                (StringUtils.isNotEmpty(labelCode) ? " AND t2.label = ? " : "") +
                (StringUtils.isNotEmpty(labelType) ? " AND t2.label_type = ? " : "") +
                (StringUtils.isNotEmpty(labelType) ? " AND t2.label_type = ? " : "") +
                (teamCode > 0 ? (" AND admin_team_code = " + teamCode) : "") +
                (teamCode > 0 ? (" AND admin_team_code = " + teamCode) : "") +
                "  AND (t1.name like ? or p.address like ? or p.idcard like ? ) " +
                " ORDER BY  p.name DESC,p.address DESC, p.idcard DESC ";
                "  AND (t1.name like ? or p.address like ? or p.idcard like ? ) ";
        
        if(isFollowWeChat){
            sql += "   AND p.openid IS NOT NULL AND p.openid <>'' ";
        }
        sql +=  " ORDER BY  p.name DESC,p.address DESC, p.idcard DESC ";
        if (StringUtils.isNotEmpty(labelCode)) {
        if (StringUtils.isNotEmpty(labelCode)) {
            args = new Object[]{doctor, doctor, labelCode, labelType, "%" + filter + "%", "%" + filter + "%", "%" + filter + "%"};
            args = new Object[]{doctor, doctor, labelCode, labelType, "%" + filter + "%", "%" + filter + "%", "%" + filter + "%"};
        } else if (StringUtils.isEmpty(labelCode) && StringUtils.isNotEmpty(labelType)) {
        } else if (StringUtils.isEmpty(labelCode) && StringUtils.isNotEmpty(labelType)) {

+ 19 - 58
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java

@ -397,55 +397,7 @@ public class PrescriptionService extends BaseService {
        return statusObj;
        return statusObj;
    }
    }
    /**
     * 长处方统计-点击柱状图获取详情
     * @param interval
     * @param date
     * @param disease
     * @param type
     * @return
     */
    public List<Map<String,Object>> getPrescriptionTotalDetailTime(int interval,String date,String disease,String type){
        //如果是日就是按一天,周就是从本周一到本周日,月就是本月第一天到本月最后一天
        String startTime = "";
        String endTime = "";
        if (interval==1){
            startTime = date+" 00:00:00";
            endTime = " 23:59:59";
        }else if (interval==2){
            startTime = DateUtil.getMondayOfThisDate(DateUtil.strToDate(date));
            endTime = DateUtil.getSundayOfThisDate(DateUtil.strToDate(date));
            startTime += " 00:00:00";
            endTime += "23:59:59";
        }else if (interval==3){
            startTime = DateUtil.getFristDayOfMonthThisDate(DateUtil.strToDate(date+"-01"));
            endTime = DateUtil.getLastDayOfMonthThisDate(DateUtil.strToDate(date+"-01"));
            startTime += " 00:00:00";
            endTime += " 23:59:59";
        }
        String sql = "SELECT * FROM wlyy_prescription p ";
        if(StringUtils.isNotBlank(disease)){
            sql += " JOIN wlyy_prescription_diagnosis d ON  d.prescription_code = p.code WHERE d.health_problem ='"+disease+"' ";
        }else{
            sql +=" WHERE 1=1 ";
        }
        if ("2".equals(type)){//已完成
            sql += " AND p.`status` = "+PrescriptionLog.PrescriptionLogStatus.finish.getValue() ;
        }else if ("3".equals(type)){//居民取消
            sql += " AND p.`status` = "+PrescriptionLog.PrescriptionLogStatus.patient_canel.getValue() ;
        }else if ("4".equals(type)){//审核不通过
            sql += " AND p.`status` = "+PrescriptionLog.PrescriptionLogStatus.no_reviewed.getValue() ;
        }else if ("5".equals(type)){//进行中
            sql += " AND  p.`status` < " + PrescriptionLog.PrescriptionLogStatus.finish.getValue() +
                    " AND p.`status`>= " + PrescriptionLog.PrescriptionLogStatus.revieweding.getValue() ;
        }else if ("6".equals(type)){//其他原因取消
            sql += " AND p.`status` <= "+PrescriptionLog.PrescriptionLogStatus.pay_outtime.getValue() ;
        }
        sql += " AND p.create_time <= ? " +
                " AND p.create_time >= ? ";
        List<Map<String,Object>> resultList = jdbcTemplate.queryForList(sql,new Object[]{endTime,startTime});
        return resultList;
    }
    /**
    /**
     * 长处方统计--长处方记录筛选
     * 长处方统计--长处方记录筛选
@ -458,9 +410,11 @@ public class PrescriptionService extends BaseService {
     * @param endTime
     * @param endTime
     * @return
     * @return
     */
     */
    public List<Map<String,Object>> getPrescriptionByCondition(String level, String area, String disease, String status, String type, String startTime,String endTime){
    public List<Map<String,Object>> getPrescriptionByCondition(String level, String area, String disease, String status, String type, String startTime,String endTime,int pageNo, int pageSize){
        String sql = "SELECT * FROM wlyy_prescription p ";
        String sql = "SELECT p.code,p.patient_name,p.doctor_name,p.hospital_name,p.dispensary_type,p.status," +
                "p.create_time,GROUP_CONCAT(d.health_problem) AS health_problem, GROUP_CONCAT(d.health_problem_name) AS health_problem_name " +
                "FROM wlyy_prescription p LEFT JOIN wlyy_prescription_diagnosis d ON p.code = d.prescription_code";
        //判断疾病
        //判断疾病
        if(StringUtils.isNotBlank(disease)){
        if(StringUtils.isNotBlank(disease)){
            if ("1".equals(disease)){
            if ("1".equals(disease)){
@ -468,9 +422,9 @@ public class PrescriptionService extends BaseService {
            }else if ("2".equals(disease)){
            }else if ("2".equals(disease)){
                disease = tnb;
                disease = tnb;
            }
            }
            sql += " JOIN wlyy_prescription_diagnosis d ON  d.prescription_code = p.code WHERE d.health_problem ='"+disease+"' ";
            sql += " WHERE d.health_problem ='"+disease+"' ";
        }else{
        }else{
            sql +=" WHERE 1=1 ";
            sql +="  WHERE 1=1 ";
        }
        }
        //判断状态
        //判断状态
        if ("2".equals(status)){//已完成
        if ("2".equals(status)){//已完成
@ -508,14 +462,17 @@ public class PrescriptionService extends BaseService {
            sql += "AND p.hospital = '"+area+"' ";
            sql += "AND p.hospital = '"+area+"' ";
        }
        }
        List<Map<String,Object>> resultList = new ArrayList<>();
        List<Map<String,Object>> resultList = new ArrayList<>();
        int start = (pageNo-1)*pageSize;
        if (StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime)){
        if (StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime)){
            startTime += " 00:00:00";
            startTime += " 00:00:00";
            endTime += " 23:59:59";
            endTime += " 23:59:59";
            sql += " AND p.create_time <= ? " +
            sql += " AND p.create_time <= ? " +
                    " AND p.create_time >= ? ";
                    " AND p.create_time >= ? ";
            resultList = jdbcTemplate.queryForList(sql,new Object[]{endTime,startTime});
            sql +=" GROUP BY p.code ORDER  BY p.create_time DESC limit ?,?";
            resultList = jdbcTemplate.queryForList(sql,new Object[]{endTime,startTime,start,pageSize});
        }else{
        }else{
            resultList = jdbcTemplate.queryForList(sql);
            sql +=" GROUP BY p.code ORDER  BY p.create_time DESC limit ?,?";
            resultList = jdbcTemplate.queryForList(sql,new Object[]{start,pageSize});
        }
        }
        return resultList;
        return resultList;
    }
    }
@ -525,13 +482,17 @@ public class PrescriptionService extends BaseService {
     * @param keyWord
     * @param keyWord
     * @return
     * @return
     */
     */
    public List<Map<String,Object>> getPrescriptionByKeyWord(String keyWord){
        String sql = "SELECT * FROM wlyy_prescription p where 1=1";
    public List<Map<String,Object>> getPrescriptionByKeyWord(String keyWord,int pageNo,int pageSize){
        String sql = "SELECT p.code,p.patient_name,p.doctor_name,p.hospital_name,p.dispensary_type,p.status," +
                "p.create_time,GROUP_CONCAT(d.health_problem) AS health_problem, GROUP_CONCAT(d.health_problem_name) AS health_problem_name " +
                "FROM wlyy_prescription p LEFT JOIN wlyy_prescription_diagnosis d ON p.code = d.prescription_code WHERE 1=1 " ;
        //判断关键字
        //判断关键字
        if (StringUtils.isNotBlank(keyWord)){
        if (StringUtils.isNotBlank(keyWord)){
            sql += " AND (p.patient_name like '%"+keyWord+"%' or p.doctor_name like '%"+keyWord+"%')";
            sql += " AND (p.patient_name like '%"+keyWord+"%' or p.doctor_name like '%"+keyWord+"%')";
        }
        }
        List<Map<String,Object>> resultList = jdbcTemplate.queryForList(sql);
        sql += " GROUP BY p.code ORDER  BY p.create_time DESC limit ?,?";
        int start = (pageNo-1)*pageSize;
        List<Map<String,Object>> resultList = jdbcTemplate.queryForList(sql,new Object[]{start,pageSize});
        return resultList;
        return resultList;
    }
    }

+ 8 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java

@ -1883,14 +1883,20 @@ public class SignWebService extends BaseService {
     *
     *
     * @return
     * @return
     */
     */
    public JSONObject getOverDuePatients(String year, Long teamCode, String doctor, Integer page, Integer pageSize) {
    public JSONObject getOverDuePatients(String year, Long teamCode, String doctor, boolean isFollowWeChat,Integer page, Integer pageSize) {
        StringBuffer sql = new StringBuffer("SELECT IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age," +
        StringBuffer sql = new StringBuffer("SELECT IFNULL(year( from_days( datediff( now(), p.birthday))),'未知') age," +
                "t.patient code,t.idcard,t.name,t.mobile,t.openid,p.photo," +
                "t.patient code,t.idcard,t.name,t.mobile,t.openid,p.photo," +
                "t.ssc,t.type signType,p.sex ,t.expenses_status expensesStatus,c.disease " +
                "t.ssc,t.type signType,p.sex ,t.expenses_status expensesStatus,c.disease " +
                " FROM wlyy_sign_family t " +
                " FROM wlyy_sign_family t " +
                " LEFT JOIN wlyy_patient p ON t.patient = p.code " +
                " LEFT JOIN wlyy_patient p ON t.patient = p.code " +
                " LEFT JOIN (select patient,group_concat(label) disease,sum(label) lablesum from wlyy_sign_patient_label_info where label_type = 3 and status=1 GROUP BY patient) c on t.patient = c.patient " +
                " LEFT JOIN (select patient,group_concat(label) disease,sum(label) lablesum from wlyy_sign_patient_label_info where label_type = 3 and status=1 GROUP BY patient) c on t.patient = c.patient " +
                " WHERE t.doctor ='" + doctor + "' AND t.admin_team_code =" + teamCode + " AND t.sign_year ='" + year + "' AND t.status =-4 order by p.standard_status DESC ,p.disease_condition DESC,c.lablesum DESC,p.openid DESC LIMIT " + page * pageSize + "," + pageSize);
                " WHERE t.doctor ='" + doctor + "' AND t.admin_team_code =" + teamCode + " AND t.sign_year ='" + year + "' AND t.status =-4 ");
        if(isFollowWeChat){
            sql.append(" AND p.openid IS NOT NULL AND p.openid <>'' order by p.standard_status DESC ,p.disease_condition DESC,c.lablesum DESC DESC LIMIT " + page * pageSize + "," + pageSize);
        }else{
            sql.append(" order by p.standard_status DESC ,p.disease_condition DESC,c.lablesum DESC,p.openid DESC LIMIT " + page * pageSize + "," + pageSize);
        }
        
        List<Map<String, Object>> rs = jdbcTemplate.queryForList(sql.toString());
        List<Map<String, Object>> rs = jdbcTemplate.queryForList(sql.toString());
        JSONObject json = new JSONObject();
        JSONObject json = new JSONObject();
        json.put("result", rs);
        json.put("result", rs);

+ 12 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsService.java

@ -5106,7 +5106,8 @@ public class StatisticsService extends BaseService {
        List<Map<String,Object>> rs =new ArrayList<>();
        List<Map<String,Object>> rs =new ArrayList<>();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String sql ="";
        String sql ="";
        Calendar dd = Calendar.getInstance();//定义日期实例
        //定义日期实例
        Calendar dd = Calendar.getInstance();
        Date endDate = new Date();
        Date endDate = new Date();
        dd.setTime(endDate);
        dd.setTime(endDate);
@ -5143,7 +5144,7 @@ public class StatisticsService extends BaseService {
            endTime = DateUtil.dateToStr(endDate, "YYYY-MM-dd HH:mm:ss");
            endTime = DateUtil.dateToStr(endDate, "YYYY-MM-dd HH:mm:ss");
        }else if (interval==3){
        }else if (interval==3){
            sql = "SELECT count(1) AS count,LEFT(p.create_time,7) AS date  FROM wlyy_prescription p ";
            sql = "SELECT count(1) AS count,LEFT(p.create_time,7) AS date  FROM wlyy_prescription p ";
            //String monthNumber = dd.get(Calendar.MONTH);
            //dd.setTime(startDate);
            for (int i = 1; i < 7; i++) {
            for (int i = 1; i < 7; i++) {
                Map<String, Object> mc = new HashedMap();
                Map<String, Object> mc = new HashedMap();
                SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM");
                SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM");
@ -5153,6 +5154,15 @@ public class StatisticsService extends BaseService {
                dd.add(Calendar.MONTH, -1);
                dd.add(Calendar.MONTH, -1);
                rs.add(mc);
                rs.add(mc);
            }
            }
            Collections.sort(rs, new Comparator<Map<String, Object>>() {
                public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                    String date1 = String.valueOf(o1.get("date"));
                    String date2 = String.valueOf(o2.get("date"));
                    int flag = date1.compareTo(date2);
                    return flag;
                }
            });
            startTime = DateUtil.dateToStr(dd.getTime(), "YYYY-MM-dd HH:mm:ss");
            startTime = DateUtil.dateToStr(dd.getTime(), "YYYY-MM-dd HH:mm:ss");
            endTime = DateUtil.dateToStr(new Date(), "YYYY-MM-dd HH:mm:ss");
            endTime = DateUtil.dateToStr(new Date(), "YYYY-MM-dd HH:mm:ss");
        }
        }

+ 25 - 8
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -2940,16 +2940,19 @@ public class StatisticsESService {
            throw new RuntimeException("未找到团队信息");
            throw new RuntimeException("未找到团队信息");
        }
        }
        Long id = admin.getId();
        Long id = admin.getId();
        List<SaveModel> list = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, id + "", Integer.valueOf(SaveModel.teamLevel), "1", SaveModel.timeLevel_ZL, String.valueOf(Integer.valueOf(type) + 1));
        List<SaveModel> list = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, id + "", Integer.valueOf(SaveModel.teamLevel), SaveModel.timeLevel_ZL, SaveModel.timeLevel_ZL, String.valueOf(Integer.valueOf(type) + 1));
        List<Map<String, Object>> rs = new ArrayList<>();
        List<Map<String, Object>> rs = new ArrayList<>();
        for (SaveModel saveModel : list) {
        for (SaveModel saveModel : list) {
            if(saveModel.getResult2().intValue()!=0){
                Map<String, Object> map = new HashMap<>();
            Map<String, Object> map = new HashMap<>();
            //map.put("applyDate", dateFormat.format(saveModel.getQuotaDate()));
            if ("0".equals(type)) {
                map.put("applyDate", dateFormat.format(saveModel.getQuotaDate()));
                map.put("applyDate", dateFormat.format(saveModel.getQuotaDate()));
                map.put("signCount", saveModel.getResult2().longValue());
                rs.add(map);
            } else {
                map.put("weekOfMonth", DateUtil.getWeekOfMonth(saveModel.getQuotaDate()));
            }
            }
            map.put("signCount", saveModel.getResult2().longValue());
            rs.add(map);
        }
        }
        JSONArray rsJs = new JSONArray(rs);
        JSONArray rsJs = new JSONArray(rs);
        return rsJs;
        return rsJs;
@ -2970,12 +2973,17 @@ public class StatisticsESService {
            throw new RuntimeException("未找到团队信息");
            throw new RuntimeException("未找到团队信息");
        }
        }
        Long id = admin.getId();
        Long id = admin.getId();
        List<SaveModel> list = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, id + "", Integer.parseInt(SaveModel.teamLevel), "42", SaveModel.timeLevel_ZL, String.valueOf(Integer.parseInt(type) + 1));
        List<SaveModel> list = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, endDate, id + "", Integer.parseInt(SaveModel.teamLevel), "42", SaveModel.timeLevel_ZL, String.valueOf(Integer.parseInt(type) + 2));
        List<Map<String, Object>> rs = new ArrayList<>();
        List<Map<String, Object>> rs = new ArrayList<>();
        for (SaveModel saveModel : list) {
        for (SaveModel saveModel : list) {
            if (saveModel.getResult2().intValue()!=0){
            if (saveModel.getResult2().intValue()!=0){
                Map<String, Object> map = new HashMap<>();
                Map<String, Object> map = new HashMap<>();
                map.put("applyDate", dateFormat.format(saveModel.getQuotaDate()));
                //map.put("applyDate", dateFormat.format(saveModel.getQuotaDate()));
                if ("0".equals(type)) {
                    map.put("applyDate", dateFormat.format(saveModel.getQuotaDate()));
                } else {
                    map.put("applyDate", dateFormat.format(saveModel.getQuotaDate()));
                }
                map.put("signCount", saveModel.getResult2().longValue());
                map.put("signCount", saveModel.getResult2().longValue());
                rs.add(map);
                rs.add(map);
            }
            }
@ -3946,7 +3954,7 @@ public class StatisticsESService {
        if (interval==2){
        if (interval==2){
            rs = DateUtil.findDateASWeeks(startDate,endDate);
            rs = DateUtil.findDateASWeeks(startDate,endDate);
            String MondayWeekDateStr = DateUtil.getMondayOfThisDate(startDate);
            String MondayWeekDateStr = DateUtil.getMondayOfThisDate(startDate);
            Date MondayWeekDate = dateFormat3.parse(MondayWeekDateStr);
            Date MondayWeekDate = dateFormat.parse(MondayWeekDateStr);
            if (startDate.after(MondayWeekDate)){
            if (startDate.after(MondayWeekDate)){
                //开始时间不是当周的周一,则加入本周周一的时间
                //开始时间不是当周的周一,则加入本周周一的时间
                Map<String,Object> dateMap = new HashedMap();
                Map<String,Object> dateMap = new HashedMap();
@ -3967,6 +3975,15 @@ public class StatisticsESService {
                dd.add(Calendar.MONTH, -1);
                dd.add(Calendar.MONTH, -1);
                rs.add(mc);
                rs.add(mc);
            }
            }
            Collections.sort(rs, new Comparator<Map<String, Object>>() {
                public int compare(Map<String, Object> o1, Map<String, Object> o2) {
                    String date1 = String.valueOf(o1.get("date"));
                    String date2 = String.valueOf(o2.get("date"));
                    int flag = date1.compareTo(date2);
                    return flag;
                }
            });
            startTime = DateUtil.dateToStr(dd.getTime(), "YYYY-MM-dd HH:mm:ss");
            startTime = DateUtil.dateToStr(dd.getTime(), "YYYY-MM-dd HH:mm:ss");
            endTime = DateUtil.dateToStr(new Date(), "YYYY-MM-dd HH:mm:ss");
            endTime = DateUtil.dateToStr(new Date(), "YYYY-MM-dd HH:mm:ss");
        }
        }

+ 23 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/QrcodeService.java

@ -501,13 +501,13 @@ public class QrcodeService extends BaseService {
    }
    }
    /**
    /**
     * 从微信生成二维码(供第三方调用)
     *
     * 从微信生成永久二维码(供第三方调用)
     *  文件不存在才会新建
     * @param content
     * @param content
     * @param token
     * @param token
     * @throws IOException
     * @throws IOException
     */
     */
    public String getQrcodeFromWeiXin(String content,String token) throws Exception {
    public String getQrcodeFromWeiXin(String content, String fileName, String path, String token) throws Exception {
        try {
        try {
            String token_url = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=" + token;
            String token_url = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=" + token;
            String params = "{\"action_name\": \"QR_LIMIT_STR_SCENE\", \"action_info\": {\"scene\": {\"scene_str\": \"" + content + "\"}}}";
            String params = "{\"action_name\": \"QR_LIMIT_STR_SCENE\", \"action_info\": {\"scene\": {\"scene_str\": \"" + content + "\"}}}";
@ -517,10 +517,24 @@ public class QrcodeService extends BaseService {
                JSONObject json = new JSONObject(result);
                JSONObject json = new JSONObject(result);
                if (json.has("ticket")) {
                if (json.has("ticket")) {
                    String file = path + File.separator + fileName + ".png";
                    // 保存路径
                    File pathFile = new File(path);
                    // 保存文件
                    File outputFile = new File(file);
                    // 路径不存在则创建
                    if (!pathFile.exists()) {
                        pathFile.mkdir();
                    }
                    // 文件已存在则返回已存在的路径
                    if (outputFile.exists()) {
//                        outputFile.delete();
                        return file;
                    }
                    // 请求输入流
                    // 请求输入流
                    InputStream inputStream = null;
                    InputStream inputStream = null;
                    // 二维码图片输出流
                    // 二维码图片输出流
                    StringBuffer tStringBuffer = new StringBuffer();
                    FileOutputStream outputStream = new FileOutputStream(file);
                    // 下载二维码图片
                    // 下载二维码图片
                    URL urlGet = new URL("https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket="
                    URL urlGet = new URL("https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket="
                            + URLEncoder.encode(json.get("ticket").toString(), "UTF-8"));
                            + URLEncoder.encode(json.get("ticket").toString(), "UTF-8"));
@ -532,14 +546,17 @@ public class QrcodeService extends BaseService {
                    int len = 0;
                    int len = 0;
                    while ((len = inputStream.read(data)) != -1) {
                    while ((len = inputStream.read(data)) != -1) {
                        tStringBuffer.append(data);
                        outputStream.write(data, 0, len);
                    }
                    }
                    if (inputStream != null) {
                    if (inputStream != null) {
                        inputStream.close();
                        inputStream.close();
                    }
                    }
                    if (outputStream != null) {
                        outputStream.close();
                    }
                    return tStringBuffer.toString();
                    return file;
                } else {
                } else {
                    throw new Exception("请求微信生成二维码失败!");
                    throw new Exception("请求微信生成二维码失败!");
                }
                }

+ 41 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/RoleService.java

@ -68,7 +68,21 @@ public class RoleService extends TokenService {
    public List<Map<String, String>> getUserRoleAndArea(String user) {
    public List<Map<String, String>> getUserRoleAndArea(String user) {
        List<Map<String, String>> re = new ArrayList<>();
        List<Map<String, String>> re = new ArrayList<>();
        List<DoctorRole> roleList = doctorRoleDao.findUserRole(user);
        List<DoctorRole> roleList = doctorRoleDao.findUserRole(user);
//        for(DoctorRole one:roleList){
//            int level = roleConverse(one.getCode());
//            tempList = temp.get(level);
//            if(tempList==null){
//                tempList=new ArrayList<>();
//            }
//            tempList.add(one.get("roleCode")+"");
//            temp.put(level,tempList);
//        }
        int resultLevel = 5;
        for (DoctorRole one : roleList) {
            if(resultLevel>roleConverse(one.getCode())){
                resultLevel=roleConverse(one.getCode());
            }
        }
        if (roleList != null && roleList.size() > 0) {
        if (roleList != null && roleList.size() > 0) {
            //遍历角色
            //遍历角色
            for (DoctorRole role : roleList) {
            for (DoctorRole role : roleList) {
@ -128,10 +142,36 @@ public class RoleService extends TokenService {
                    areaString = areaString.substring(0, areaString.length() - 1);
                    areaString = areaString.substring(0, areaString.length() - 1);
                }
                }
                map.put("areas", areaString);
                map.put("areas", areaString);
                map.put("level",roleConverse(role.getCode())+"");
                if(resultLevel==roleConverse(role.getCode())){
                    map.put("isManage", "1");
                }else{
                    map.put("isManage", "0");
                }
                re.add(map);
                re.add(map);
            }
            }
        }
        }
        return re;
        return re;
    }
    }
    /**
     * 角色code转成角色级别
     * @param roleCode 角色code
     * @return 1、省级,2、市级,3、区级,4、机构
     */
    public Integer roleConverse(String roleCode){
        if(roleCode.length()==6){
            if("0".equals(roleCode.substring(3,4))){
                return 1;
            }else if("00".equals(roleCode.substring(4))){
                return 2;
            }else{
                return 3;
            }
        }else{
            return 3;
        }
    }
}
}

+ 12 - 11
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.service.jimeiJkEdu;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONPObject;
import com.yihu.edu.entity.RoleWithAuthorityCheck;
import com.yihu.edu.entity.RoleWithAuthorityCheck;
import com.yihu.es.entity.HealthEduArticlePatient;
import com.yihu.es.entity.HealthEduArticlePatient;
import com.yihu.es.entity.RoleVo;
import com.yihu.es.entity.RoleVo;
@ -101,7 +102,7 @@ public class JMJkEduArticleService extends BaseService {
        com.alibaba.fastjson.JSONObject article = null;
        com.alibaba.fastjson.JSONObject article = null;
        Doctor doctor = null;
        Doctor doctor = null;
        for (HealthEduArticlePatient one : esList) {
        for (HealthEduArticlePatient one : esList) {
            article = thirdJkEduArticleService.getArticalById(one.getArticleId());
            article = thirdJkEduArticleService.getArticalById(one.getArticleId(),"");
            if (result.get(one.getArticleId()) != null) {
            if (result.get(one.getArticleId()) != null) {
                heapm = result.get(one.getArticleId());
                heapm = result.get(one.getArticleId());
@ -289,7 +290,7 @@ public class JMJkEduArticleService extends BaseService {
        //通过文章id 获取文章详情
        //通过文章id 获取文章详情
        JSONObject article = thirdJkEduArticleService.getArticalById(articleId);
        JSONObject article = thirdJkEduArticleService.getArticalById(articleId,"");
        healthEduArticlePatient.setArticleId(article.get("articleId") + "");
        healthEduArticlePatient.setArticleId(article.get("articleId") + "");
        healthEduArticlePatient.setAttachedTitle(article.get("articleTitle") + "");
        healthEduArticlePatient.setAttachedTitle(article.get("articleTitle") + "");
@ -362,7 +363,7 @@ public class JMJkEduArticleService extends BaseService {
//    }
//    }
    public JSONObject pushArticleConfirm(String articleId, String labelUnit, String labelSex, String labelServe, String labelDisease, String labelHealth,String userCode) throws Exception {
    public JSONObject pushArticleConfirm(String articleId, String labelUnit, String labelSex, String labelServe, String labelDisease, String labelHealth,String userCode) throws Exception {
        JSONObject article = thirdJkEduArticleService.getArticalById(articleId);
        JSONObject article = thirdJkEduArticleService.getArticalById(articleId,"");
        Set<String> patientSet = new HashSet<>();
        Set<String> patientSet = new HashSet<>();
        initPatient(patientSet, labelUnit, labelSex, labelServe, labelDisease, labelHealth,userCode);
        initPatient(patientSet, labelUnit, labelSex, labelServe, labelDisease, labelHealth,userCode);
        long num = patientSet.size();
        long num = patientSet.size();
@ -597,7 +598,7 @@ public class JMJkEduArticleService extends BaseService {
    }
    }
    public JSONObject pushArticleConfirm(String articleId,String labelType, String condition, String groupType,Long teamId,String doctorCode) throws Exception{
    public JSONObject pushArticleConfirm(String articleId,String labelType, String condition, String groupType,Long teamId,String doctorCode) throws Exception{
        JSONObject article = thirdJkEduArticleService.getArticalById(articleId);
        JSONObject article = thirdJkEduArticleService.getArticalById(articleId,"");
        Set<String> patientSet = new HashSet<>();
        Set<String> patientSet = new HashSet<>();
        initPatients(patientSet,labelType,condition,groupType,teamId,doctorCode);
        initPatients(patientSet,labelType,condition,groupType,teamId,doctorCode);
        long num = patientSet.size();
        long num = patientSet.size();
@ -731,7 +732,7 @@ public class JMJkEduArticleService extends BaseService {
        List<HealthEduArticlePatientModel> result = new ArrayList<>();
        List<HealthEduArticlePatientModel> result = new ArrayList<>();
        Doctor doctor = null;
        Doctor doctor = null;
        for (HealthEduArticlePatient one : esList) {
        for (HealthEduArticlePatient one : esList) {
            article = thirdJkEduArticleService.getArticalById(one.getArticleId());
            article = thirdJkEduArticleService.getArticalById(one.getArticleId(),"");
            heapm = new HealthEduArticlePatientModel();
            heapm = new HealthEduArticlePatientModel();
            heapm.setSendName(one.getSendName());
            heapm.setSendName(one.getSendName());
            heapm.setSendCode(one.getDoctorCode());
            heapm.setSendCode(one.getDoctorCode());
@ -778,7 +779,7 @@ public class JMJkEduArticleService extends BaseService {
     */
     */
    public void saveArticle(String userCode,String articleTitle,String articleType,Integer	articlelevel,String	secondLevelCategoryId,String image,
    public void saveArticle(String userCode,String articleTitle,String articleType,Integer	articlelevel,String	secondLevelCategoryId,String image,
                            String	secondLevelCategoryName,String firstLevelCategoryId,String firstLevelCategoryName,String content,String operatorRoleCode,
                            String	secondLevelCategoryName,String firstLevelCategoryId,String firstLevelCategoryName,String content,String operatorRoleCode,
                            String opertorRoleLevel,Integer userScope) throws Exception {
                            String opertorRoleLevel,Integer userScope,String articleId) throws Exception {
        image = commonUtil.copyTempImage(image);
        image = commonUtil.copyTempImage(image);
        Integer isAuthentication = 0;
        Integer isAuthentication = 0;
@ -792,7 +793,7 @@ public class JMJkEduArticleService extends BaseService {
        }
        }
        thirdJkEduArticleService.saveArticle(userCode,articleTitle,articleType,articlelevel,secondLevelCategoryId,image,
        thirdJkEduArticleService.saveArticle(userCode,articleTitle,articleType,articlelevel,secondLevelCategoryId,image,
                secondLevelCategoryName,firstLevelCategoryId,firstLevelCategoryName,content,operatorRoleCode,opertorRoleLevel,
                secondLevelCategoryName,firstLevelCategoryId,firstLevelCategoryName,content,operatorRoleCode,opertorRoleLevel,
                userScope,isAuthentication);
                userScope,isAuthentication,articleId);
    }
    }
    /**
    /**
@ -808,18 +809,18 @@ public class JMJkEduArticleService extends BaseService {
     * @param currentUserRoleLevel
     * @param currentUserRoleLevel
     * @throws Exception
     * @throws Exception
     */
     */
    public JSONArray queryArticlePcList(String firstLevelCategoryId,String secondLevelCategoryId,String insertTimeStart,String insertTimeEnd,String articlelevel,String articleTitle,
                                   String userCode,String currentUserRole,String currentUserRoleLevel,String isAuthentication,boolean isMyArticle) throws Exception{
    public JSONObject queryArticlePcList(String firstLevelCategoryId, String secondLevelCategoryId, String insertTimeStart, String insertTimeEnd, String articlelevel, String articleTitle,
                                          String userCode, String currentUserRole, String currentUserRoleLevel, String isAuthentication, Boolean isMyArticle, Integer page, Integer pageSize) throws Exception{
//        Doctor doctor = doctorDao.findByCode(userCode);
//        Doctor doctor = doctorDao.findByCode(userCode);
//        boolean isManage = false;
//        boolean isManage = false;
//        if(doctor.getLevel()==10){
//        if(doctor.getLevel()==10){
//            isManage = true;
//            isManage = true;
//        }
//        }
        if(!isMyArticle){
        if(isMyArticle==null||(isMyArticle!=null&&!isMyArticle)){
            userCode = null;
            userCode = null;
        }
        }
        return thirdJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,
        return thirdJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,
                articleTitle,userCode,isAuthentication,currentUserRole,currentUserRoleLevel);
                articleTitle,userCode,isAuthentication,currentUserRole,currentUserRoleLevel,page,pageSize);
    }
    }
    /**
    /**

+ 12 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jkEduArticle/ThirdJkEduArticleService.java

@ -334,12 +334,13 @@ public class ThirdJkEduArticleService extends BaseService {
     * @param articleId 文章id
     * @param articleId 文章id
     * @return
     * @return
     */
     */
    public JSONObject getArticalById(String articleId) throws Exception {
    public JSONObject getArticalById(String articleId,String userId) throws Exception {
        JSONObject re = new JSONObject();
        JSONObject re = new JSONObject();
        JSONObject json = null;
        JSONObject json = null;
        try {
        try {
            JSONObject param = new JSONObject();
            JSONObject param = new JSONObject();
            param.put("articleId", articleId);
            param.put("articleId", articleId);
            param.put("userId", userId);
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getArticalById, param.toString(), "1"));
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getArticalById, param.toString(), "1"));
            json = JSON.parseObject(response);
            json = JSON.parseObject(response);
        } catch (Exception e) {
        } catch (Exception e) {
@ -375,7 +376,7 @@ public class ThirdJkEduArticleService extends BaseService {
     */
     */
    public void saveArticle(String userCode,String articleTitle,String articleType,Integer	articlelevel,String	secondLevelCategoryId,String newUrl,
    public void saveArticle(String userCode,String articleTitle,String articleType,Integer	articlelevel,String	secondLevelCategoryId,String newUrl,
                                 String	secondLevelCategoryName,String firstLevelCategoryId,String firstLevelCategoryName,String content,
                                 String	secondLevelCategoryName,String firstLevelCategoryId,String firstLevelCategoryName,String content,
                                 String operatorRoleCode,String opertorRoleLevel,Integer userScope,Integer isAuthentication) throws Exception {
                                 String operatorRoleCode,String opertorRoleLevel,Integer userScope,Integer isAuthentication,String articleId) throws Exception {
        String response = "";
        String response = "";
        JSONObject json = null;
        JSONObject json = null;
@ -388,6 +389,7 @@ public class ThirdJkEduArticleService extends BaseService {
            String	orgId = doctor.getHospital();//组织
            String	orgId = doctor.getHospital();//组织
            String	userName = doctor.getName();//登录名称
            String	userName = doctor.getName();//登录名称
            JSONObject param = new JSONObject();
            JSONObject param = new JSONObject();
            param.put("articleId", articleId);
            param.put("userCode", userCode);
            param.put("userCode", userCode);
            param.put("orgName", orgName);
            param.put("orgName", orgName);
            param.put("deptName", deptName);
            param.put("deptName", deptName);
@ -439,8 +441,8 @@ public class ThirdJkEduArticleService extends BaseService {
     * @return
     * @return
     * @throws Exception
     * @throws Exception
     */
     */
    public JSONArray queryArticlePcList(String firstLevelCategoryId,String secondLevelCategoryId,String insertTimeStart,String insertTimeEnd,String articlelevel,
                                        String articleTitle,String userCode,String isAuthentication,String currentUserRole,String currentUserRoleLevel) throws Exception {
    public JSONObject queryArticlePcList(String firstLevelCategoryId,String secondLevelCategoryId,String insertTimeStart,String insertTimeEnd,String articlelevel,
                                        String articleTitle,String userCode,String isAuthentication,String currentUserRole,String currentUserRoleLevel,Integer page,Integer pageSize) throws Exception {
        String response = "";
        String response = "";
        JSONObject json = null;
        JSONObject json = null;
@ -456,13 +458,15 @@ public class ThirdJkEduArticleService extends BaseService {
            param.put("isAuthentication", isAuthentication);
            param.put("isAuthentication", isAuthentication);
            param.put("currentUserRole", currentUserRole);
            param.put("currentUserRole", currentUserRole);
            param.put("currentUserRoleLevel", currentUserRoleLevel);
            param.put("currentUserRoleLevel", currentUserRoleLevel);
            param.put("page", page+"");
            param.put("pageSize", pageSize+"");
            response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(queryArticlePcList, param.toString(), "1"));
            response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(queryArticlePcList, param.toString(), "1"));
            json = JSON.parseObject(response);
            json = JSON.parseObject(response);
        } catch (Exception e) {
        } catch (Exception e) {
            e.printStackTrace();
            e.printStackTrace();
        }
        }
        if ("10000".equals(json.getString("Code"))) {
        if ("10000".equals(json.getString("Code"))) {
            return json.getJSONArray("Result");
            return json;
        } else {
        } else {
            throw new Exception(json.getString("Message"));
            throw new Exception(json.getString("Message"));
        }
        }
@ -503,12 +507,14 @@ public class ThirdJkEduArticleService extends BaseService {
     * @param categoryLevel 是    获取类别:1、一级类别 2、二级类别
     * @param categoryLevel 是    获取类别:1、一级类别 2、二级类别
     * @return
     * @return
     */
     */
    public JSONArray getCategoryList(String categoryLevel) throws Exception {
    public JSONArray getCategoryList(Integer categoryLevel,String firstlevelId,String secondLevelId) throws Exception {
        JSONArray re = new JSONArray();
        JSONArray re = new JSONArray();
        JSONObject json = null;
        JSONObject json = null;
        try {
        try {
            JSONObject param = new JSONObject();
            JSONObject param = new JSONObject();
            param.put("categoryLevel", categoryLevel);
            param.put("categoryLevel", categoryLevel);
            param.put("firstlevelId", firstlevelId);
            param.put("secondLevelId", secondLevelId);
//            param.put("userId", userId);
//            param.put("userId", userId);
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getCategoryList, param.toString(), "1"));
            String response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(getCategoryList, param.toString(), "1"));
            json = JSON.parseObject(response);
            json = JSON.parseObject(response);

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/ylz/ThirdMessageService.java

@ -97,7 +97,7 @@ public class ThirdMessageService extends BaseService {
            model.put("keyword5", medicalTime);
            model.put("keyword5", medicalTime);
            if (StringUtils.isNotEmpty(openId) && !"undefined".equals(openId)) {
            if (StringUtils.isNotEmpty(openId) && !"undefined".equals(openId)) {
                pushMsgTask.putAgentWxMsg(patient.getCode(), 18, model);
                pushMsgTask.putAgentWxMsg(patient.getCode(), 21, model);
            }
            }

+ 28 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java

@ -61,6 +61,8 @@ public class PushMsgTask {
    private String template_doctor_survey;
    private String template_doctor_survey;
    @Value("${wechat.message.template_doctor_audit}")
    @Value("${wechat.message.template_doctor_audit}")
    private String template_doctor_audit;//审核结果通知
    private String template_doctor_audit;//审核结果通知
    @Value("${wechat.message.template_physical_examination}")
    private String template_physical_examination;//体检提醒
    @Value("${wechat.message.template_doctor_service}")
    @Value("${wechat.message.template_doctor_service}")
    private String template_doctor_service;//服务结果通知
    private String template_doctor_service;//服务结果通知
    @Value("${pushMes.method}")
    @Value("${pushMes.method}")
@ -225,7 +227,7 @@ public class PushMsgTask {
     * 发送微信模板消息
     * 发送微信模板消息
     *
     *
     * @param type 1:签约成功  2:签约失败  3:咨询回复通知  4:健康指导提醒  5:解约申请通知  6:预约挂号成功通知  7:预约取消通知 8 缴费提醒 9 健康教育  10 签约医生变更(信息变更通知)
     * @param type 1:签约成功  2:签约失败  3:咨询回复通知  4:健康指导提醒  5:解约申请通知  6:预约挂号成功通知  7:预约取消通知 8 缴费提醒 9 健康教育  10 签约医生变更(信息变更通知)
     *             18 产检提醒和产检就诊提醒 19:续方审核结果通知(0.不通过 1.通过 2。调整处方并通过) 20:服务结果通知 11.代办事项通知
     *             18 产检提醒和产检就诊提醒 19:续方审核结果通知(0.不通过 1.通过 2。调整处方并通过) 20:服务结果通知 11.代办事项通知 21体检提醒
     * @param json 当type==1||type==2时:{"first":"消息主题",”doctor":"医生code","doctorName":"医生名","date":"签约时间","content":"签约内容","remark":"消息备注"}
     * @param json 当type==1||type==2时:{"first":"消息主题",”doctor":"医生code","doctorName":"医生名","date":"签约时间","content":"签约内容","remark":"消息备注"}
     *             type==3时:{"first":"消息主题","consult":"医生咨询编号","consultcontent":"咨询内容","replycontent":"回复内容","doctorName":"医生名","remark":"消息备注"}
     *             type==3时:{"first":"消息主题","consult":"医生咨询编号","consultcontent":"咨询内容","replycontent":"回复内容","doctorName":"医生名","remark":"消息备注"}
     *             type==4时:{"first":"消息主题","date":"指导时间","orgName":"指导机构","doctorName":"指导医生名","content":"指导内容","remark":"消息备注"}
     *             type==4时:{"first":"消息主题","date":"指导时间","orgName":"指导机构","doctorName":"指导医生名","content":"指导内容","remark":"消息备注"}
@ -668,6 +670,31 @@ public class PushMsgTask {
                keyword3.setColor("#000000");
                keyword3.setColor("#000000");
                keyword3.setValue(json.getString("keyword3"));
                keyword3.setValue(json.getString("keyword3"));
                m.put("keyword3", keyword3);
                m.put("keyword3", keyword3);
            }else if (type == 21) {
                if (json.has("url")) {
                    temp.setUrl(url + json.getString("url"));
                }
                temp.setTemplate_id(template_physical_examination);
                WechatTemplateData keyword1 = new WechatTemplateData();
                keyword1.setColor("#000000");
                keyword1.setValue(json.getString("keyword1"));
                m.put("keyword1", keyword1);
                WechatTemplateData keyword2 = new WechatTemplateData();
                keyword2.setColor("#000000");
                keyword2.setValue(json.getString("keyword2"));
                m.put("keyword2", keyword2);
                WechatTemplateData keyword3 = new WechatTemplateData();
                keyword3.setColor("#000000");
                keyword3.setValue(json.getString("keyword3"));
                m.put("keyword3", keyword3);
                WechatTemplateData keyword4 = new WechatTemplateData();
                keyword4.setColor("#000000");
                keyword4.setValue(json.getString("keyword4"));
                m.put("keyword4", keyword4);
                WechatTemplateData keyword5 = new WechatTemplateData();
                keyword5.setColor("#000000");
                keyword5.setValue(json.getString("keyword5"));
                m.put("keyword5", keyword5);
            }
            }
            temp.setData(m);
            temp.setData(m);

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/DateUtil.java

@ -1121,8 +1121,8 @@ public class DateUtil {
	}
	}
	public static int getWeekOfMonth(String dateString){
	public static int getWeekOfMonth(String dateString){
		Date date = strToDate(dateString);
		Date date = strToDate(dateString);
		return getWeekOfMonth(date);
		return getWeekOfMonth(date);
	}
	}

+ 53 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/BaseController.java

@ -46,7 +46,8 @@ public class BaseController {
            }
            }
            JSONObject json = new JSONObject(userAgent);
            JSONObject json = new JSONObject(userAgent);
            return json.getString("uid");
            return json.getString("uid");
//            return "xh1D2017031502222";// wjw00000001000e6badcfa163e424589
//            return "wjw00000001000e6badcfa163e424525";// wjw00000001000e6badcfa163e424589
        } catch (Exception e) {
        } catch (Exception e) {
            return null;
            return null;
        }
        }
@ -179,6 +180,57 @@ public class BaseController {
        }
        }
    }
    }
    /**
     * 获取当前用户的角色code
     * @return
     */
    public String getCurrentRoleCode(){
        try {
            String userAgent = request.getHeader("userAgent");
            if (StringUtils.isEmpty(userAgent)) {
                userAgent = request.getHeader("User-Agent");
            }
            JSONObject json = new JSONObject(userAgent);
            return json.getJSONObject("currentUserRole").getString("code");
        } catch (Exception e) {
            return null;
        }
    }
    /**
     * 获取当前用户的角色级别
     * @return
     */
    public String getCurrentRoleLevel(){
        try {
            String userAgent = request.getHeader("userAgent");
            if (StringUtils.isEmpty(userAgent)) {
                userAgent = request.getHeader("User-Agent");
            }
            JSONObject json = new JSONObject(userAgent);
            return json.getJSONObject("currentUserRole").getString("level");
        } catch (Exception e) {
            return null;
        }
    }
    /**
     * 获取当前用户的角色是否是管理员
     * @return
     */
    public String getCurrentRoleIsManange(){
        try {
            String userAgent = request.getHeader("userAgent");
            if (StringUtils.isEmpty(userAgent)) {
                userAgent = request.getHeader("User-Agent");
            }
            JSONObject json = new JSONObject(userAgent);
            return json.getJSONObject("currentUserRole").getString("isManange");
        } catch (Exception e) {
            return null;
        }
    }
    public void error(Exception e) {
    public void error(Exception e) {
        logger.error(DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss")+":"+getClass().getName() + ":", e.getMessage());
        logger.error(DateUtil.dateToStr(new Date(),"yyyy-MM-dd HH:mm:ss")+":"+getClass().getName() + ":", e.getMessage());
        e.printStackTrace();
        e.printStackTrace();

+ 7 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/LoginController.java

@ -247,6 +247,13 @@ public class LoginController extends BaseController {
                    //获取医生角色和区域权限
                    //获取医生角色和区域权限
                    List<Map<String, String>> roleMap = roleService.getUserRoleAndArea(doctor.getCode());
                    List<Map<String, String>> roleMap = roleService.getUserRoleAndArea(doctor.getCode());
                    map.put("userRole", roleMap);
                    map.put("userRole", roleMap);
                    //医生当前登录的角色
                    for(Map<String, String> one:roleMap){
                        if("1".equals(one.get("isManage"))){
                            map.put("currentUserRole", one);
                            continue;
                        }
                    }
                    if ("10" .equals(doctor.getLevel()) && roleMap.size() == 0) {
                    if ("10" .equals(doctor.getLevel()) && roleMap.size() == 0) {
                        errorMessage = "改用户没有管理员权限";
                        errorMessage = "改用户没有管理员权限";
                        loginLog.setErrorMessage(errorMessage);
                        loginLog.setErrorMessage(errorMessage);

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthEduArticleController.java

@ -512,7 +512,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
    }
    }
    private void getPatientByGroup(String labelCode, String labelType, Long teamCode, Set<String> patientSet, int page, int pagesize) throws Exception {
    private void getPatientByGroup(String labelCode, String labelType, Long teamCode, Set<String> patientSet, int page, int pagesize) throws Exception {
        JSONArray result = signPatientLabelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page, pagesize, false, "");
        JSONArray result = signPatientLabelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page, pagesize, false, "",false);
        for (Object o : result) {
        for (Object o : result) {
            JSONObject json = (JSONObject) o;
            JSONObject json = (JSONObject) o;
            String patient = (String) json.get("code");
            String patient = (String) json.get("code");

+ 34 - 21
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEduPC/DoctorJMJkEduArticlePCController.java

@ -1,8 +1,10 @@
package com.yihu.wlyy.web.doctor.jimeiJkEduPC;
package com.yihu.wlyy.web.doctor.jimeiJkEduPC;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
import com.yihu.wlyy.service.third.jkEduArticle.ThirdJkEduArticleService;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperation;
@ -11,6 +13,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.*;
import java.util.Iterator;
/**
/**
 * Created by Trick on 2017/11/14.
 * Created by Trick on 2017/11/14.
 */
 */
@ -21,10 +25,14 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
    @Autowired
    @Autowired
    private JMJkEduArticleService jmJkEduArticleService;
    private JMJkEduArticleService jmJkEduArticleService;
    @Autowired
    private ThirdJkEduArticleService thirdJkEduArticleService;
    @RequestMapping(value = "saveArticle", method = RequestMethod.POST)
    @RequestMapping(value = "saveArticle", method = RequestMethod.POST)
    @ApiOperation("添加文章")
    @ApiOperation("添加文章")
    public  String saveArticle(@ApiParam(name = "articleTitle", value = "文章标题")
    public  String saveArticle(@ApiParam(name = "articleId", value = "文章Id")
                               @RequestParam(value = "articleId", required = true) String articleId,
                               @ApiParam(name = "articleTitle", value = "文章标题")
                               @RequestParam(value = "articleTitle", required = true) String articleTitle,
                               @RequestParam(value = "articleTitle", required = true) String articleTitle,
                               @ApiParam(name = "articleType", value = "文章类型")
                               @ApiParam(name = "articleType", value = "文章类型")
                               @RequestParam(value = "articleType", required = true) String articleType,
                               @RequestParam(value = "articleType", required = true) String articleType,
@ -42,16 +50,16 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
                               @RequestParam(value = "content", required = true) String content,
                               @RequestParam(value = "content", required = true) String content,
                               @ApiParam(name = "imageUrl", value = "文章封面图片地址")
                               @ApiParam(name = "imageUrl", value = "文章封面图片地址")
                               @RequestParam(value = "imageUrl", required = true) String imageUrl,
                               @RequestParam(value = "imageUrl", required = true) String imageUrl,
                               @ApiParam(name = "operatorRoleCode", value = "操作人角色code")
                               @RequestParam(value = "operatorRoleCode", required = true) String operatorRoleCode,
                               @ApiParam(name = "opertorRoleLevel", value = "操作人角色级别")
                               @RequestParam(value = "opertorRoleLevel", required = true) String opertorRoleLevel,
//                               @ApiParam(name = "operatorRoleCode", value = "操作人角色code")
//                               @RequestParam(value = "operatorRoleCode", required = true) String operatorRoleCode,
//                               @ApiParam(name = "opertorRoleLevel", value = "操作人角色级别")
//                               @RequestParam(value = "opertorRoleLevel", required = true) String opertorRoleLevel,
                               @ApiParam(name = "userScope", value = "使用范围(1、全市使用,2、全区使用,3、全社区使用)")
                               @ApiParam(name = "userScope", value = "使用范围(1、全市使用,2、全区使用,3、全社区使用)")
                               @RequestParam(value = "userScope", required = true) Integer userScope){
                               @RequestParam(value = "userScope", required = true) Integer userScope){
        try {
        try {
            jmJkEduArticleService.saveArticle(getUID(),articleTitle,articleType,articlelevel,secondLevelCategoryId,imageUrl,
            jmJkEduArticleService.saveArticle(getUID(),articleTitle,articleType,articlelevel,secondLevelCategoryId,imageUrl,
                    secondLevelCategoryName,firstLevelCategoryId,firstLevelCategoryName,content,operatorRoleCode,opertorRoleLevel,userScope);
                    secondLevelCategoryName,firstLevelCategoryId,firstLevelCategoryName,content,getCurrentRoleCode(),getCurrentRoleLevel(),userScope,articleId);
            return success("添加成功!");
            return success("添加成功!");
        }catch (Exception e){
        }catch (Exception e){
            e.printStackTrace();
            e.printStackTrace();
@ -67,8 +75,6 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
     * @param insertTimeEnd
     * @param insertTimeEnd
     * @param articlelevel
     * @param articlelevel
     * @param articleTitle
     * @param articleTitle
     * @param currentUserRole
     * @param currentUserRoleLevel
     * @return
     * @return
     */
     */
    @RequestMapping(value = "queryArticlePcList", method = RequestMethod.GET)
    @RequestMapping(value = "queryArticlePcList", method = RequestMethod.GET)
@ -85,18 +91,24 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
                                      @RequestParam(value = "articlelevel", required = false) String articlelevel,
                                      @RequestParam(value = "articlelevel", required = false) String articlelevel,
                                      @ApiParam(name = "articleTitle", value = "文章标题关键字")
                                      @ApiParam(name = "articleTitle", value = "文章标题关键字")
                                      @RequestParam(value = "articleTitle", required = false) String articleTitle,
                                      @RequestParam(value = "articleTitle", required = false) String articleTitle,
                                      @ApiParam(name = "currentUserRole", value = "当前登录的角色")
                                      @RequestParam(value = "currentUserRole", required = true) String currentUserRole,
                                      @ApiParam(name = "currentUserRoleLevel", value = "当前登录的角色级别")
                                      @RequestParam(value = "currentUserRoleLevel", required = true )String currentUserRoleLevel,
                                      @ApiParam(name = "isAuthentication", value = "是否有权限")
//                                      @ApiParam(name = "currentUserRole", value = "当前登录的角色")
//                                      @RequestParam(value = "currentUserRole", required = true) String currentUserRole,
//                                      @ApiParam(name = "currentUserRoleLevel", value = "当前登录的角色级别")
//                                      @RequestParam(value = "currentUserRoleLevel", required = true )String currentUserRoleLevel,
                                      @ApiParam(name = "isAuthentication", value = "是否认证")
                                      @RequestParam(value = "isAuthentication", required = false) String isAuthentication,
                                      @RequestParam(value = "isAuthentication", required = false) String isAuthentication,
                                      @ApiParam(name = "isMyArticle", value = "是否过滤我的文章")
                                      @ApiParam(name = "isMyArticle", value = "是否过滤我的文章")
                                      @RequestParam(value = "isMyArticle", required = false) Boolean isMyArticle){
                                      @RequestParam(value = "isMyArticle", required = false) Boolean isMyArticle,
                                      @ApiParam(name = "iDisplayStart", value = "当前页")
                                      @RequestParam(value = "iDisplayStart", required = true) Integer page,
                                      @ApiParam(name = "iDisplayLength", value = "是否过滤我的文章")
                                      @RequestParam(value = "iDisplayLength", required = true) Integer pageSize){
        try {
        try {
            JSONArray response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,articleTitle,
                    getUID(),currentUserRole,currentUserRoleLevel,isAuthentication,isMyArticle);
            JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,articleTitle,
                    getUID(),getCurrentRoleCode(),getCurrentRoleLevel(),isAuthentication,isMyArticle,page,pageSize);
            return write(200,"查询成功!","data",response);
            return write(200,"查询成功!","data",response);
        } catch (Exception e){
        } catch (Exception e){
            e.printStackTrace();
            e.printStackTrace();
@ -106,10 +118,11 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
    @RequestMapping(value = "saveOrUpdateArticleQR", method = RequestMethod.POST)
    @RequestMapping(value = "saveOrUpdateArticleQR", method = RequestMethod.POST)
    @ApiOperation("保存或更新认证标识")
    @ApiOperation("保存或更新认证标识")
    public  String saveOrUpdateArticleQR(@ApiParam(name = "currentRoleLevel", value = "当前登录角色的级别")
                                         @RequestParam(value = "currentRoleLevel", required = true) String currentRoleLevel,
                                         @ApiParam(name = "currentRoleCode", value = "当前登录角色的code")
                                         @RequestParam(value = "currentRoleCode", required = true) String currentRoleCode,
    public  String saveOrUpdateArticleQR(
//                                        @ApiParam(name = "currentRoleLevel", value = "当前登录角色的级别")
//                                         @RequestParam(value = "currentRoleLevel", required = true) String currentRoleLevel,
//                                         @ApiParam(name = "currentRoleCode", value = "当前登录角色的code")
//                                         @RequestParam(value = "currentRoleCode", required = true) String currentRoleCode,
                                         @ApiParam(name = "position", value = "位置")
                                         @ApiParam(name = "position", value = "位置")
                                         @RequestParam(value = "position", required = false) Integer position,
                                         @RequestParam(value = "position", required = false) Integer position,
                                         @ApiParam(name = "imgUrl", value = "二维码图片地址")
                                         @ApiParam(name = "imgUrl", value = "二维码图片地址")
@ -118,7 +131,7 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
                                         @RequestParam(value = "id", required = false) Integer id){
                                         @RequestParam(value = "id", required = false) Integer id){
        try{
        try{
            jmJkEduArticleService.saveOrUpdateArticleQR(currentRoleLevel,currentRoleCode,position,imgUrl,getUID(),id);
            jmJkEduArticleService.saveOrUpdateArticleQR(getCurrentRoleLevel(),getCurrentRoleCode(),position,imgUrl,getUID(),id);
            return success("保存成功!");
            return success("保存成功!");
        } catch (Exception e){
        } catch (Exception e){
            e.printStackTrace();
            e.printStackTrace();

+ 10 - 7
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java

@ -53,7 +53,8 @@ public class SignPatientLabelInfoController extends BaseController {
    public String getPatientByParams(@RequestParam String filter,
    public String getPatientByParams(@RequestParam String filter,
                                     @RequestParam String teamCode,
                                     @RequestParam String teamCode,
                                     @RequestParam int page,
                                     @RequestParam int page,
                                     @RequestParam int pagesize) {
                                     @RequestParam int pagesize,
                                     @RequestParam(required = false, defaultValue = "false") boolean isFollowWeChat) {
        try {
        try {
            if (StringUtils.isEmpty(filter)) {
            if (StringUtils.isEmpty(filter)) {
                return error(-1, "搜索条件不能为空!");
                return error(-1, "搜索条件不能为空!");
@ -62,7 +63,7 @@ public class SignPatientLabelInfoController extends BaseController {
                return error(-1, "团队不能为空!");
                return error(-1, "团队不能为空!");
            }
            }
            long team = Long.parseLong(teamCode);
            long team = Long.parseLong(teamCode);
            JSONArray temp = labelInfoService.getPatientByParams(getUID(), filter, null, null, team, null, null, page, pagesize);
            JSONArray temp = labelInfoService.getPatientByParams(getUID(), filter, null, null, team, null, null, page, pagesize,isFollowWeChat);
            return write(200, "查询成功!", "data", temp);
            return write(200, "查询成功!", "data", temp);
        } catch (Exception e) {
        } catch (Exception e) {
            error(e);
            error(e);
@ -154,7 +155,8 @@ public class SignPatientLabelInfoController extends BaseController {
                                        @RequestParam(required = false) int page,
                                        @RequestParam(required = false) int page,
                                        @RequestParam(required = false) int pagesize,
                                        @RequestParam(required = false) int pagesize,
                                        @RequestParam(required = false) String diseaseCondition,
                                        @RequestParam(required = false) String diseaseCondition,
                                        @RequestParam(required = false) boolean isSlowDisease) {
                                        @RequestParam(required = false) boolean isSlowDisease,
                                        @RequestParam(required = false, defaultValue = "false") boolean isFollowWeChat) {
        try {
        try {
            if (StringUtils.isEmpty(labelCode)) {
            if (StringUtils.isEmpty(labelCode)) {
                return error(-1, "标签cdoe不能为空");
                return error(-1, "标签cdoe不能为空");
@ -171,12 +173,12 @@ public class SignPatientLabelInfoController extends BaseController {
            //labelType=9 签约过期的居民列表
            //labelType=9 签约过期的居民列表
            if (labelType.equals("9")) {
            if (labelType.equals("9")) {
                JSONObject jsonObject = signWebService.getOverDuePatients(labelCode, teamCode, getUID(), page, pagesize);
                JSONObject jsonObject = signWebService.getOverDuePatients(labelCode, teamCode, getUID(),isFollowWeChat, page, pagesize);
                return write(200, "查询成功", "data", jsonObject);
                return write(200, "查询成功", "data", jsonObject);
            }
            }
            JSONArray result = labelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page, pagesize,isSlowDisease,diseaseCondition);
//            JSONArray result = labelInfoService.getPatientByLabel("xy201703150222", labelCode, labelType, teamCode, page, pagesize,isSlowDisease,diseaseCondition);
            JSONArray result = labelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page, pagesize,isSlowDisease,diseaseCondition,isFollowWeChat);
//            JSONArray result = labelInfoService.getPatientByLabel("xy201703150222", labelCode, labelType, teamCode, page, pagesize,isSlowDisease,diseaseCondition,isFollowWeChat);
            return write(200, "查询成功", "data", result);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
        } catch (Exception e) {
@ -292,7 +294,8 @@ public class SignPatientLabelInfoController extends BaseController {
            @RequestParam(required = false) String labelType,
            @RequestParam(required = false) String labelType,
            @RequestParam(required = false) Long teamCode,
            @RequestParam(required = false) Long teamCode,
            @RequestParam(required = false) boolean isSlowDisease,
            @RequestParam(required = false) boolean isSlowDisease,
            @RequestParam(required = false) String diseaseCondition) {
            @RequestParam(required = false) String diseaseCondition,
            @RequestParam(required = false) boolean isBindWechat) {
        try {
        try {
            if (StringUtils.isEmpty(labelType)) {
            if (StringUtils.isEmpty(labelType)) {
                return error(-1, "标签类型不能为空");
                return error(-1, "标签类型不能为空");

+ 16 - 30
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java

@ -620,31 +620,6 @@ public class PrescriptionInfoController extends BaseController {
        }
        }
    }
    }
    /**
     *长处方统计-点击柱状图获取详情
     * @Author zhangdan
     * @param interval
     * @param date
     * @param disease
     * @param type
     * @return
     */
    @RequestMapping(value = "/getPrescriptionTotalDetailTime", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("长处方统计-点击柱状图获取详情")
    public String getPrescriptionTotalDetailTime(
            @RequestParam(required = true)int interval,
            @RequestParam(required = true)String date,
            @ApiParam(name="disease", value="疾病类型") @RequestParam(required = false)String disease,
            @ApiParam(name="type", value="类型1.总量,2.已完成,3.居民取消,4.审核不通过,5.进行中,6.其他原因取消") @RequestParam(required = true)String type){
        try{
            return write(200, "查询成功", "data", prescriptionService.getPrescriptionTotalDetailTime(interval,date,disease,type));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败");
        }
    }
    /**
    /**
     * 长处方统计--长处方记录筛选
     * 长处方统计--长处方记录筛选
@ -667,7 +642,9 @@ public class PrescriptionInfoController extends BaseController {
            @RequestParam(required = false,defaultValue = "1")String status,
            @RequestParam(required = false,defaultValue = "1")String status,
            @RequestParam(required = false)String type,
            @RequestParam(required = false)String type,
            @RequestParam(required = false)String startTime,
            @RequestParam(required = false)String startTime,
            @RequestParam(required = false)String endTime){
            @RequestParam(required = false)String endTime,
            @RequestParam(required = true,defaultValue = "1")String pageNo,
            @RequestParam(required = false)String pageSize){
        try{
        try{
            if (StringUtils.isNotBlank(startTime)){
            if (StringUtils.isNotBlank(startTime)){
                if (StringUtils.isNotBlank(endTime)){
                if (StringUtils.isNotBlank(endTime)){
@ -678,7 +655,10 @@ public class PrescriptionInfoController extends BaseController {
                    }
                    }
                }
                }
            }
            }
            return write(200, "查询成功", "data", prescriptionService.getPrescriptionByCondition(level,area,disease,status,type,startTime,endTime));
            if (StringUtils.isBlank(pageSize)){
                pageSize="10";
            }
            return write(200, "查询成功", "data", prescriptionService.getPrescriptionByCondition(level,area,disease,status,type,startTime,endTime,Integer.valueOf(pageNo),Integer.valueOf(pageSize)));
        } catch (Exception e) {
        } catch (Exception e) {
            error(e);
            error(e);
            return error(-1, "查询失败");
            return error(-1, "查询失败");
@ -694,9 +674,14 @@ public class PrescriptionInfoController extends BaseController {
    @RequestMapping(value = "/getPrescriptionByKeyWord", method = RequestMethod.GET)
    @RequestMapping(value = "/getPrescriptionByKeyWord", method = RequestMethod.GET)
    @ResponseBody
    @ResponseBody
    public String getPrescriptionByKeyWord(
    public String getPrescriptionByKeyWord(
            @RequestParam(required = true)String keyWord){
            @RequestParam(required = true)String keyWord,
            @RequestParam(required = true,defaultValue = "1")String pageNo,
            @RequestParam(required = false)String pageSize){
        try{
        try{
            return write(200, "查询成功", "data", prescriptionService.getPrescriptionByKeyWord(keyWord));
            if (StringUtils.isBlank(pageSize)){
                pageSize="10";
            }
            return write(200, "查询成功", "data", prescriptionService.getPrescriptionByKeyWord(keyWord,Integer.valueOf(pageNo),Integer.valueOf(pageSize)));
        } catch (Exception e) {
        } catch (Exception e) {
            error(e);
            error(e);
            return error(-1, "查询失败");
            return error(-1, "查询失败");
@ -704,10 +689,11 @@ public class PrescriptionInfoController extends BaseController {
    }
    }
    /**
    /**
     * 长处方统计--点击查看详情
     * 长处方统计--点击查看详情(弃用)
     * @param code
     * @param code
     * @return
     * @return
     */
     */
    @Deprecated
    @RequestMapping(value = "/getPrescriptionByCode", method = RequestMethod.GET)
    @RequestMapping(value = "/getPrescriptionByCode", method = RequestMethod.GET)
    @ResponseBody
    @ResponseBody
    public String getPrescriptionByCode(@RequestParam(required = true)String code){
    public String getPrescriptionByCode(@RequestParam(required = true)String code){

+ 52 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/HealthEduArticleController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.patient.health;
package com.yihu.wlyy.web.patient.health;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.education.HealthEduArticle;
import com.yihu.wlyy.entity.education.HealthEduArticle;
import com.yihu.wlyy.entity.education.HealthEduArticleOpHistory;
import com.yihu.wlyy.entity.education.HealthEduArticleOpHistory;
@ -54,6 +55,9 @@ public class HealthEduArticleController extends BaseController {
    private DoctorService doctorService;
    private DoctorService doctorService;
    @Autowired
    @Autowired
    private ThirdJkEduArticleService healthEducationArticleService;
    private ThirdJkEduArticleService healthEducationArticleService;
    
    @Autowired
    private ThirdJkEduArticleService thirdJkEduArticleService;
    /**
    /**
     * 查询文章列表
     * 查询文章列表
@ -263,5 +267,53 @@ public class HealthEduArticleController extends BaseController {
            return error(-1,"查询失败!");
            return error(-1,"查询失败!");
        }
        }
    }
    }
    
    @RequestMapping(value = "saveArticleCollection",method = RequestMethod.POST)
    @ApiOperation("收藏文章")
    @ObserverRequired
    public String saveArticleCollection(@ApiParam(name = "articleId", value = "文章id")
                                        @RequestParam(value = "articleId", required = true) String articleId,
                                        @ApiParam(name = "articleCategoryId", value = "文章类别ID")
                                        @RequestParam(value = "articleCategoryId", required = false,defaultValue = "1") String articleCategoryId,
                                        @ApiParam(name = "articleCategoryName", value = "文章类别名称")
                                        @RequestParam(value = "articleCategoryName", required = false) String articleCategoryName){
        try {
            thirdJkEduArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,getRepUID(),2);
//            thirdJkEduArticleService.saveArticleCollection(articleId,articleCategoryId,articleCategoryName,"0de7295862dd11e69faffa163e8aee56",1);
            
            return success("收藏成功!");
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"收藏失败!");
        }
    }
    
    @RequestMapping(value = "cancelArticleCollection",method = RequestMethod.POST)
    @ApiOperation("取消收藏文章")
    @ObserverRequired
    public String cancelArticleCollection(@ApiParam(name = "articleId", value = "文章id",defaultValue = "1")
                                          @RequestParam(value = "articleId", required = true) String articleId){
        try {
            thirdJkEduArticleService.cancelArticleCollection(articleId,getRepUID(),2);
//            thirdJkEduArticleService.cancelArticleCollection(articleId,"0de7295862dd11e69faffa163e8aee56",1);
            return success("取消成功!");
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"取消失败!");
        }
    }
    
    @RequestMapping(value = "getArticalById",method = RequestMethod.GET)
    @ApiOperation("获取文章详情")
    public String getArticalById(@ApiParam(name = "articleId", value = "文章id",defaultValue = "1")
                                 @RequestParam(value = "articleId", required = true) String articleId){
        try {
            com.alibaba.fastjson.JSONObject response = thirdJkEduArticleService.getArticalById(articleId,getRepUID());
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败!");
        }
    }
}
}

+ 3 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/doctor/GcLableController.java

@ -96,10 +96,11 @@ public class GcLableController extends BaseController {
            @ApiParam(name = "teamCode", value = "所属团队", required = true) @RequestParam(value = "teamCode", required = true) Long teamCode,
            @ApiParam(name = "teamCode", value = "所属团队", required = true) @RequestParam(value = "teamCode", required = true) Long teamCode,
            @ApiParam(name = "page", value = "当前页(1开始)", required = true) @RequestParam(value = "page", required = true, defaultValue = "1") Integer page,
            @ApiParam(name = "page", value = "当前页(1开始)", required = true) @RequestParam(value = "page", required = true, defaultValue = "1") Integer page,
            @ApiParam(name = "pageSize", value = "每页大小", required = true) @RequestParam(value = "pageSize", required = true, defaultValue = "10") Integer pageSize,
            @ApiParam(name = "pageSize", value = "每页大小", required = true) @RequestParam(value = "pageSize", required = true, defaultValue = "10") Integer pageSize,
            @ApiParam(name = "isSlowDisease", value = "是否是慢病管理", required = true) @RequestParam(value="isSlowDisease",required = false,defaultValue = "false") boolean isSlowDisease
            @ApiParam(name = "isSlowDisease", value = "是否是慢病管理", required = true) @RequestParam(value="isSlowDisease",required = false,defaultValue = "false") boolean isSlowDisease,
            @ApiParam(name = "isFollowWeChat", value = "是否过滤微信关注居民", required = false) @RequestParam(value="isFollowWeChat",required = false,defaultValue = "false") boolean isFollowWeChat
    ) {
    ) {
        try {
        try {
            JSONArray result = signPatientLabelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page-1, pageSize, isSlowDisease, "");
            JSONArray result = signPatientLabelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page-1, pageSize, isSlowDisease, "",isFollowWeChat);
            List<PatientModel> patientLabelModels = new ArrayList<>();
            List<PatientModel> patientLabelModels = new ArrayList<>();
            for (int i = 0; i < result.length(); i++) {
            for (int i = 0; i < result.length(); i++) {
                JSONObject jo = result.getJSONObject(i);
                JSONObject jo = result.getJSONObject(i);

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/service/GcEduArticleService.java

@ -250,7 +250,7 @@ public class GcEduArticleService {
        //通过文章id 获取文章详情
        //通过文章id 获取文章详情
        JSONObject article = healthEducationArticleService.getArticalById(articleId);
        JSONObject article = healthEducationArticleService.getArticalById(articleId,"");
        healthEduArticlePatient.setArticleId(article.get("articleId") + "");
        healthEduArticlePatient.setArticleId(article.get("articleId") + "");
        healthEduArticlePatient.setAttachedTitle(article.get("articleTitle") + "");
        healthEduArticlePatient.setAttachedTitle(article.get("articleTitle") + "");

+ 30 - 13
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkEduArticle/ThirdJkEduArticleController.java

@ -106,7 +106,7 @@ public class ThirdJkEduArticleController extends BaseController {
    public String getArticalById(@ApiParam(name = "articleId", value = "文章id",defaultValue = "1")
    public String getArticalById(@ApiParam(name = "articleId", value = "文章id",defaultValue = "1")
                                 @RequestParam(value = "articleId", required = true) String articleId){
                                 @RequestParam(value = "articleId", required = true) String articleId){
        try {
        try {
            com.alibaba.fastjson.JSONObject response = thirdJkEduArticleService.getArticalById(articleId);
            com.alibaba.fastjson.JSONObject response = thirdJkEduArticleService.getArticalById(articleId,"");
            return write(200,"查询成功!","data",response);
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
        }catch (Exception e){
            e.printStackTrace();
            e.printStackTrace();
@ -193,7 +193,7 @@ public class ThirdJkEduArticleController extends BaseController {
    /*************************************************** Category *****************************************************/
    /*************************************************** Category *****************************************************/
    @RequestMapping(value = "addCategory",method = RequestMethod.GET)
    @RequestMapping(value = "addCategory",method = RequestMethod.POST)
    @ApiOperation("添加二级分类-仅向市级管理员开放编辑权限")
    @ApiOperation("添加二级分类-仅向市级管理员开放编辑权限")
    public String addCategory(@ApiParam(name = "categoryName", value = "文章分类名称")
    public String addCategory(@ApiParam(name = "categoryName", value = "文章分类名称")
                                           @RequestParam(value = "categoryName", required = true) String categoryName,
                                           @RequestParam(value = "categoryName", required = true) String categoryName,
@ -202,12 +202,13 @@ public class ThirdJkEduArticleController extends BaseController {
                                           @ApiParam(name = "firstlevelId", value = "一级类别ID")
                                           @ApiParam(name = "firstlevelId", value = "一级类别ID")
                                           @RequestParam(value = "firstlevelId", required = true ) String firstlevelId,
                                           @RequestParam(value = "firstlevelId", required = true ) String firstlevelId,
                                           @ApiParam(name = "secondLevelId", value = "二级类别ID")
                                           @ApiParam(name = "secondLevelId", value = "二级类别ID")
                                           @RequestParam(value = "secondLevelId", required = true ) String secondLevelId,
                                           @ApiParam(name = "currentRoleCode", value = "当前登录角色")
                                           @RequestParam(value = "currentRoleCode", required = true ) String currentRoleCode){
                                           @RequestParam(value = "secondLevelId", required = false ) String secondLevelId
//                                           @ApiParam(name = "currentRoleCode", value = "当前登录角色")
//                                           @RequestParam(value = "currentRoleCode", required = true ) String currentRoleCode
    ){
        try {
        try {
            thirdJkEduArticleService.addCategory(categoryName,categoryLevel,firstlevelId,secondLevelId,getUID(),currentRoleCode);
            thirdJkEduArticleService.addCategory(categoryName,categoryLevel,firstlevelId,secondLevelId,getUID(),getCurrentRoleCode());
            return success("添加成功!");
            return success("添加成功!");
        }catch (Exception e){
        }catch (Exception e){
            e.printStackTrace();
            e.printStackTrace();
@ -222,12 +223,12 @@ public class ThirdJkEduArticleController extends BaseController {
                              @ApiParam(name = "categoryName", value = "文章分类名称")
                              @ApiParam(name = "categoryName", value = "文章分类名称")
                              @RequestParam(value = "categoryName", required = true ) String categoryName,
                              @RequestParam(value = "categoryName", required = true ) String categoryName,
                              @ApiParam(name = "categoryState", value = "类别状态1、正常、2删除")
                              @ApiParam(name = "categoryState", value = "类别状态1、正常、2删除")
                              @RequestParam(value = "categoryState", required = true ) Integer categoryState,
                              @ApiParam(name = "currentRoleCode", value = "当前登录角色")
                              @RequestParam(value = "currentRoleCode", required = true ) String currentRoleCode){
                              @RequestParam(value = "categoryState", required = false ) Integer categoryState){
//                              @ApiParam(name = "currentRoleCode", value = "当前登录角色")
//                              @RequestParam(value = "currentRoleCode", required = true ) String currentRoleCode){
        try {
        try {
            thirdJkEduArticleService.updateCategory(categoryId,categoryName,categoryState,getUID(),currentRoleCode);
            thirdJkEduArticleService.updateCategory(categoryId,categoryName,categoryState,getUID(),getCurrentRoleCode());
            return success("更新成功!");
            return success("更新成功!");
        }catch (Exception e){
        }catch (Exception e){
            e.printStackTrace();
            e.printStackTrace();
@ -237,10 +238,14 @@ public class ThirdJkEduArticleController extends BaseController {
    @RequestMapping(value = "getCategoryList",method = RequestMethod.GET)
    @RequestMapping(value = "getCategoryList",method = RequestMethod.GET)
    @ApiOperation("获取文章类别")
    @ApiOperation("获取文章类别")
    public String getCategoryList(@ApiParam(name = "categoryLevel", value = "获取类别:1、一级类别 2、二级类别",defaultValue = "1")
                                  @RequestParam(value = "categoryLevel", required = false) String categoryLevel){
    public String getCategoryList(@ApiParam(name = "categoryLevel", value = "获取类别:1、一级类别 2、二级类别")
                                  @RequestParam(value = "categoryLevel", required = false) Integer categoryLevel,
                                  @ApiParam(name = "firstlevelId", value = "一级类别Id")
                                  @RequestParam(value = "firstlevelId", required = false) String firstlevelId,
                                  @ApiParam(name = "secondLevelId", value = "二级类别Id")
                                  @RequestParam(value = "secondLevelId", required = false) String secondLevelId){
        try {
        try {
            com.alibaba.fastjson.JSONArray response = thirdJkEduArticleService.getCategoryList(categoryLevel);
            com.alibaba.fastjson.JSONArray response = thirdJkEduArticleService.getCategoryList(categoryLevel,firstlevelId,secondLevelId);
            return write(200,"查询成功!","data",response);
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
        }catch (Exception e){
            e.printStackTrace();
            e.printStackTrace();
@ -262,4 +267,16 @@ public class ThirdJkEduArticleController extends BaseController {
            return error(-1,"查询失败!");
            return error(-1,"查询失败!");
        }
        }
    }
    }
    @RequestMapping(value = "getArticleQRCode",method = RequestMethod.GET)
    @ApiOperation("获取认证标识")
    public String getArticleQRCode(){
        try {
            com.alibaba.fastjson.JSONObject response = thirdJkEduArticleService.getArticleQRCode(getCurrentRoleLevel(), getCurrentRoleCode());
            return write(200,"查询成功!","data",response);
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败!");
        }
    }
}
}

+ 3 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkedu/controller/doctor/EduLableController.java

@ -96,10 +96,11 @@ public class EduLableController extends BaseController {
            @ApiParam(name = "teamCode", value = "所属团队", required = true) @RequestParam(value = "teamCode", required = true) Long teamCode,
            @ApiParam(name = "teamCode", value = "所属团队", required = true) @RequestParam(value = "teamCode", required = true) Long teamCode,
            @ApiParam(name = "page", value = "当前页(1开始)", required = true) @RequestParam(value = "page", required = true, defaultValue = "1") Integer page,
            @ApiParam(name = "page", value = "当前页(1开始)", required = true) @RequestParam(value = "page", required = true, defaultValue = "1") Integer page,
            @ApiParam(name = "pageSize", value = "每页大小", required = true) @RequestParam(value = "pageSize", required = true, defaultValue = "10") Integer pageSize,
            @ApiParam(name = "pageSize", value = "每页大小", required = true) @RequestParam(value = "pageSize", required = true, defaultValue = "10") Integer pageSize,
            @ApiParam(name = "isSlowDisease", value = "是否是慢病管理", required = true) @RequestParam(value="isSlowDisease",required = false,defaultValue = "false") boolean isSlowDisease
            @ApiParam(name = "isSlowDisease", value = "是否是慢病管理", required = true) @RequestParam(value="isSlowDisease",required = false,defaultValue = "false") boolean isSlowDisease,
            @ApiParam(name = "isFollowWeChat", value = "是否过滤微信关注居民", required = true) @RequestParam(value="isFollowWeChat",required = false,defaultValue = "false") boolean isFollowWeChat
    ) {
    ) {
        try {
        try {
            JSONArray result = signPatientLabelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page-1, pageSize, isSlowDisease, "");
            JSONArray result = signPatientLabelInfoService.getPatientByLabel(getUID(), labelCode, labelType, teamCode, page-1, pageSize, isSlowDisease, "",isFollowWeChat);
            List<PatientModel> patientLabelModels = new ArrayList<>();
            List<PatientModel> patientLabelModels = new ArrayList<>();
            for (int i = 0; i < result.length(); i++) {
            for (int i = 0; i < result.length(); i++) {
                JSONObject jo = result.getJSONObject(i);
                JSONObject jo = result.getJSONObject(i);

+ 127 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/ylzpay/ThirdOnepayController.java

@ -0,0 +1,127 @@
package com.yihu.wlyy.web.third.ylzpay;
import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.entity.organization.HospitalMapping;
import com.yihu.wlyy.entity.ylz.PayConfigura;
import com.yihu.wlyy.repository.organization.HospitalMappingDao;
import com.yihu.wlyy.repository.ylz.PayConfiguraDao;
import com.yihu.wlyy.service.third.ylz.PayLogService;
import com.yihu.wlyy.service.weixin.wxpay.model.Charge;
import com.yihu.wlyy.service.weixin.wxpay.service.OnePayService;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.web.WeixinBaseController;
import com.ylzinfo.onepay.sdk.OnepayDefaultClient;
import com.ylzinfo.onepay.sdk.domain.ResponseParams;
import com.ylzinfo.onepay.sdk.exception.PayException;
import com.ylzinfo.onepay.sdk.utils.StringUtil;
import io.swagger.annotations.Api;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StreamUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
/**
 * Created by Reece on 2017/8/30/030.
 *
 * 供易联众支付类相关业务调用
 */
@RestController
@RequestMapping(value = "/onepay")
@Api(description = "供易联众家庭签约支付调用")
public class ThirdOnepayController extends WeixinBaseController {
    private static final Logger LOGGER = LoggerFactory.getLogger(ThirdOnepayController.class);
    @Autowired
    private OnePayService pay;
    @Autowired
    PayLogService logService;
    @Autowired
    private PayConfiguraDao configuraDao;
    @Autowired
    private HospitalMappingDao mappingDao;
    @Autowired
    ObjectMapper objectMapper;
    /**
     * 支付真正完成,异步回调返回支付参数 后台做数据操作
     *
     * @param request
     * @param response
     * @throws IOException
     * @throws PayException
     */
    @RequestMapping(value = "/receiveNotify")
    public void receiveNotify(HttpServletRequest request, HttpServletResponse response) throws IOException, PayException {
        SimpleDateFormat formatDate = new SimpleDateFormat("yyyyMMddHHmmss");
        PayConfigura config = configuraDao.findWorkConfigura();
        Boolean isSuccess = false;
        String error = "";
        String responses = "";
        response.setContentType("text/html;charset=utf-8");
        InputStream inputStream = request.getInputStream();
        String params = StreamUtils.copyToString(inputStream, Charset.forName("UTF-8"));
        try {
            JSONObject json = new JSONObject(params);
            String appId = json.getString("appId");
            HospitalMapping hospital = mappingDao.findByAppId(appId);
            String appSecret = hospital.getAppSecret();
            LOGGER.info("回调参数:{}", params);
            if (StringUtil.isEmpty(params)) {
                response.getWriter().write("empty");
                return;
            }
            // 参数转换
            ResponseParams<?> encryptRes = JSON.parseObject(params, ResponseParams.class);
            OnepayDefaultClient client = new OnepayDefaultClient("", appId, appSecret, encryptRes.getSignType(), encryptRes.getEncryptType());
            LOGGER.info("解密前:{}", JSON.toJSONString(encryptRes));
            ResponseParams<?> decryptRes = client.decryptNotifyResponse(encryptRes);
            LOGGER.info("解密后:{}", JSON.toJSONString(decryptRes));
            boolean isDecrypt = ("-1".equals(decryptRes.getRespCode()) ? false : true); // 是否解密失败
            if (!isDecrypt) {
                response.getWriter().write("DECRYPT FAILURE");
            } else {
                boolean isVerify = client.verifyResponseSign(decryptRes);
                LOGGER.info("验签结果:{}", isVerify);
                if (!isVerify) {
                    response.getWriter().write("FAILURE");
                } else {
//					业务逻辑代码
                    isSuccess = true;
                    responses = JSON.toJSONString(decryptRes);
                    JSONObject requestParam = new JSONObject(responses);//业务出参
                    JSONObject responseParam = requestParam.getJSONObject("param");
                    Charge chargeView = objectMapper.readValue(responseParam.toString(), Charge.class);
                    pay.saveToWlyyCharge(chargeView);
                    response.getWriter().write("SUCCESS");
                }
            }
        } catch (Exception e) {
            response.getWriter().write(e.getMessage());
            StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw);
            e.printStackTrace(pw);
            error = sw.toString();
        }
        //                记录log日志到数据库
        logService.saveHttpLog(isSuccess, config.getReceiveNotify(), "异步支付通知", "POST", null, params, responses, error, logService.onepayType);
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/ylzpay/ThirdQrcodeController.java

@ -48,7 +48,7 @@ public class ThirdQrcodeController extends WeixinBaseController {
            String content = "wechat_" + scene;
            String content = "wechat_" + scene;
            String path = server_url + File.separator + "qrcode";
            String path = server_url + File.separator + "qrcode";
            // 通过微信接口生成医生二维码
            // 通过微信接口生成医生二维码
            String result = qrcodeService.makeQrcodeFromWeiXin(content, content.replaceAll("\r\n", ""), path, getAccessToken());
            String result = qrcodeService.getQrcodeFromWeiXin(content, content.replaceAll("\r\n", ""), path, getAccessToken());
            return write(200, "生成二维码成功!", "data", result);
            return write(200, "生成二维码成功!", "data", result);
        } catch (Exception e) {
        } catch (Exception e) {
            e.printStackTrace();
            e.printStackTrace();

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/wx/OnePayController.java

@ -61,7 +61,7 @@ import java.util.*;
 * Created by hzp on 2017/05/23.
 * Created by hzp on 2017/05/23.
 */
 */
@Controller
@Controller
@RequestMapping(value = "/onepay", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/patient", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "统一支付服务")
@Api(description = "统一支付服务")
public class OnePayController extends WeixinBaseController {
public class OnePayController extends WeixinBaseController {

+ 17 - 14
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/process/WeiXinEventProcess.java

@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Component;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.*;
/**
/**
@ -299,16 +300,17 @@ public class WeiXinEventProcess {
        if (StringUtils.isNotEmpty(eventKey) && (("wechat_ehc").equals(eventKey)) ||
        if (StringUtils.isNotEmpty(eventKey) && (("wechat_ehc").equals(eventKey)) ||
                eventKey.startsWith("qrscene_wechat_ehc")) {
                eventKey.startsWith("qrscene_wechat_ehc")) {
            System.out.println("第三方ehr关注推送事件");
            JSONObject json = new JSONObject();
            JSONObject json = new JSONObject();
            json.put("first", "first");
            json.put("remark", "remark");
            json.put("keyword1", "keyword1");
            json.put("keyword2", "keyword2");
            json.put("url", "www.baidu.com");
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
            json.put("first", "尊敬的用户,您已成功注册居民电子健康卡");
            json.put("remark", "请点击领取使用");
            json.put("keyword1", "电子健康卡注册");
            json.put("keyword2", "线下自助机");
            json.put("keyword3", format.format(new Date()));
            json.put("url", "grzx/html/my-health-card.html");
            //跳转路径问题,如果是第三方不加本地服务器名称(要改push公用方法)
            //跳转路径问题,如果是第三方不加本地服务器名称(要改push公用方法)
            json.put("openId", message.get("FromUserName"));
            json.put("openId", message.get("FromUserName"));
            json.put("type", 11);
            json.put("type", 20);
            //模板消息json串
            //模板消息json串
            result = json.toString();
            result = json.toString();
        } else {
        } else {
@ -540,16 +542,17 @@ public class WeiXinEventProcess {
            result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
            result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        } else if (StringUtils.isNotEmpty(eventKey) && (("wechat_ehc").equals(eventKey)) ||
        } else if (StringUtils.isNotEmpty(eventKey) && (("wechat_ehc").equals(eventKey)) ||
                eventKey.startsWith("qrscene_wechat_ehc")) {
                eventKey.startsWith("qrscene_wechat_ehc")) {
            System.out.println("第三方ehr扫描推送事件");
            JSONObject json = new JSONObject();
            JSONObject json = new JSONObject();
            json.put("first", "first");
            json.put("remark", "remark");
            json.put("keyword1", "keyword1");
            json.put("keyword2", "keyword2");
            json.put("url", "www.baidu.com");
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
            json.put("first", "尊敬的用户,您已成功注册居民电子健康卡");
            json.put("remark", "请点击领取使用");
            json.put("keyword1", "电子健康卡注册");
            json.put("keyword2", "线下自助机");
            json.put("keyword3", format.format(new Date()));
            json.put("url", "grzx/html/my-health-card.html");
            //跳转路径问题,如果是第三方不加本地服务器名称(要改push公用方法)
            //跳转路径问题,如果是第三方不加本地服务器名称(要改push公用方法)
            json.put("openId", message.get("FromUserName"));
            json.put("openId", message.get("FromUserName"));
            json.put("type", 11);
            json.put("type", 20);
            //模板消息json串
            //模板消息json串
            result = json.toString();
            result = json.toString();
        }
        }

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

@ -64,6 +64,8 @@ wechat:
   template_doctor_audit:  OFyLUeBW3r9trWw-i6pbB1sPSTD4J2recCv_mc-gKxA
   template_doctor_audit:  OFyLUeBW3r9trWw-i6pbB1sPSTD4J2recCv_mc-gKxA
   #服务结果通知
   #服务结果通知
   template_doctor_service:  ezr5RlX0nvh7bGU9aVsGDMJbjKDp1uMKP-AGGYXwI5g
   template_doctor_service:  ezr5RlX0nvh7bGU9aVsGDMJbjKDp1uMKP-AGGYXwI5g
   #体检报告提醒
   template_physical_examination:  jTsvKU3iFw0yiJi5ESyFGDTmFSVcWlMot3yHier39Vc
yihu:
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/

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

@ -64,6 +64,8 @@ wechat:
    template_doctor_audit:  lCtOgJgL1tBJbAytqN7cn-FgCH_Usg99FENEy2TrC08
    template_doctor_audit:  lCtOgJgL1tBJbAytqN7cn-FgCH_Usg99FENEy2TrC08
    #服务结果通知
    #服务结果通知
    template_doctor_service: i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
    template_doctor_service: i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
    #体检报告提醒
    template_physical_examination:  tlsPJlgA90-I73j2QudyMG7C-LmrMn1lC4_UnJPyWSM
yihu:
yihu:

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

@ -64,6 +64,8 @@ wechat:
     template_doctor_audit:  egrX5Larpkv8opQW67_hwsZoT0OHwwUpE1v7HeU_Jnw
     template_doctor_audit:  egrX5Larpkv8opQW67_hwsZoT0OHwwUpE1v7HeU_Jnw
     #服务结果通知
     #服务结果通知
     template_doctor_service:  xhi1LEudiZwJfZylOHuZNo8EiA73GtSshPQv5XOt9Lk
     template_doctor_service:  xhi1LEudiZwJfZylOHuZNo8EiA73GtSshPQv5XOt9Lk
     #体检报告提醒
     template_physical_examination:  jTsvKU3iFw0yiJi5ESyFGDTmFSVcWlMot3yHier39Vc
yihu:
yihu:

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

@ -64,6 +64,8 @@ wechat:
    template_doctor_audit:  lCtOgJgL1tBJbAytqN7cn-FgCH_Usg99FENEy2TrC08
    template_doctor_audit:  lCtOgJgL1tBJbAytqN7cn-FgCH_Usg99FENEy2TrC08
    #服务结果通知
    #服务结果通知
    template_doctor_service: i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
    template_doctor_service: i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
    #体检报告提醒
    template_physical_examination:  tlsPJlgA90-I73j2QudyMG7C-LmrMn1lC4_UnJPyWSM
yihu:
yihu:

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

@ -63,6 +63,8 @@ wechat:
   template_doctor_audit:  egrX5Larpkv8opQW67_hwsZoT0OHwwUpE1v7HeU_Jnw
   template_doctor_audit:  egrX5Larpkv8opQW67_hwsZoT0OHwwUpE1v7HeU_Jnw
   #服务结果通知
   #服务结果通知
   template_doctor_service:  xhi1LEudiZwJfZylOHuZNo8EiA73GtSshPQv5XOt9Lk
   template_doctor_service:  xhi1LEudiZwJfZylOHuZNo8EiA73GtSshPQv5XOt9Lk
   #体检报告提醒
   template_physical_examination:  jTsvKU3iFw0yiJi5ESyFGDTmFSVcWlMot3yHier39Vc
yihu:
yihu:

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

@ -63,6 +63,8 @@ wechat:
   template_doctor_audit:  lCtOgJgL1tBJbAytqN7cn-FgCH_Usg99FENEy2TrC08
   template_doctor_audit:  lCtOgJgL1tBJbAytqN7cn-FgCH_Usg99FENEy2TrC08
   #服务结果通知
   #服务结果通知
   template_doctor_service:  i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
   template_doctor_service:  i34rq3xFLnpf_VN2Jor9n2YlQqJMM7oXyYvuctriISw
   #体检报告提醒
   template_physical_examination:  tlsPJlgA90-I73j2QudyMG7C-LmrMn1lC4_UnJPyWSM
yihu:
yihu:
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/
  yihu_OpenPlatform_url: http://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/