wujunjie 7 лет назад
Родитель
Сommit
a2db672111

+ 56 - 0
patient-co/patient-co-doctor-assistant/src/main/java/com/yihu/wlyy/web/third/template/WlyyFeldsherTemplateController.java

@ -0,0 +1,56 @@
package com.yihu.wlyy.web.third.template;
import com.yihu.wlyy.repository.template.DoctorGuidanceTempDao;
import com.yihu.wlyy.service.template.DoctorFeldsherTemplateService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
 * 医生助手模板(供外部应用调用,无需校验)
 * <p>
 * Created by Reece on 2017/9/14.
 */
@RestController
@RequestMapping(value = "/wlyy/feldsher")
@Api(description = "医生助手模板")
public class WlyyFeldsherTemplateController extends BaseController {
    @Autowired
    private DoctorFeldsherTemplateService feldsherTemplateService;
    /**
     * i健康往医生助手 医生端推送模板消息
     *
     * @param type 消息类型
     * @param openId
     * @param url
     * @param first
     * @param remark
     * @param keywords
     * @return
     */
    @RequestMapping(value = "/sendDoctorTemplates", method = RequestMethod.POST)
    @ApiOperation(value = "医生助手给医生发送模板消息")
    public String sendDoctorTemplates(@RequestParam @ApiParam(value = "模板类型",required = true) int type,
                                      @RequestParam @ApiParam(value = "openId", required = true) String openId,
                                      @RequestParam @ApiParam(value = "跳转链接", required = true) String url,
                                      @RequestParam @ApiParam(value = "消息头",required = true) String first,
                                      @RequestParam @ApiParam(value = "消息尾", required = true,defaultValue = "") String remark,
                                      @RequestParam @ApiParam(value = "消息体",required = true) String ... keywords) {
        try {
            feldsherTemplateService.sendDoctorTemplates(type, openId, url, first, remark, keywords);
            return write(200, "发送成功!");
        } catch (Exception e) {
            e.printStackTrace();
            return invalidUserException(e, -1, "发送失败!");
        }
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/followup/FollowUpService.java

@ -870,7 +870,7 @@ public class FollowUpService extends BaseService {
                    Doctor doctor1 = doctorDao.findByCode(doctor);
                    String doctorOpenID = doctor1.getOpenid();
                    if (StringUtils.isNotEmpty(doctorOpenID)) {
                        String url = doctorAssistant + "/doctor/feldsher/sendDoctorTemplates";
                        String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";
                        List<NameValuePair> params = new ArrayList<>();
                        params.add(new BasicNameValuePair("type", "6"));
                        params.add(new BasicNameValuePair("openId", doctorOpenID));

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java

@ -487,7 +487,7 @@ public class PatientHealthIndexService extends BaseService {
            //            新增发送医生助手模板消息 v1.4.0 by wujunjie
            if (StringUtils.isNotEmpty(doctorOpenID)) {
                List<Message> messagesList = messageDao.findUnreadHealthIndex(patientCode, receiver);
                String url = doctorAssistant + "/doctor/feldsher/sendDoctorTemplates";
                String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";
                List<NameValuePair> params = new ArrayList<>();
                params.add(new BasicNameValuePair("type", "3"));
                params.add(new BasicNameValuePair("openId", doctorOpenID));

+ 4 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/FamilyContractService.java

@ -577,7 +577,7 @@ public class FamilyContractService extends BaseService {
            }
//            新增发送医生助手模板消息 v1.4.0 by wujunjie
            if (StringUtils.isNotEmpty(d.getOpenid())){
                String url = doctorAssistant + "/doctor/feldsher/sendDoctorTemplates";
                String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";
                List<NameValuePair> params = new ArrayList<>();
                params.add(new BasicNameValuePair("type", "5"));
                params.add(new BasicNameValuePair("openId", d.getOpenid()));
@ -698,7 +698,7 @@ public class FamilyContractService extends BaseService {
            //            新增发送医生助手模板消息 v1.4.0 by wujunjie
            if (StringUtils.isNotEmpty(d.getOpenid())){
                String url = doctorAssistant + "/doctor/feldsher/sendDoctorTemplates";
                String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";
                List<NameValuePair> params = new ArrayList<>();
                params.add(new BasicNameValuePair("type", "5"));
                params.add(new BasicNameValuePair("openId", d.getOpenid()));
@ -3449,7 +3449,7 @@ public class FamilyContractService extends BaseService {
            }
            //            新增发送医生助手模板消息 v1.4.0 by wujunjie
            if (StringUtils.isNotEmpty(d.getOpenid())){
                String url = doctorAssistant + "/doctor/feldsher/sendDoctorTemplates";
                String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";
                List<NameValuePair> params = new ArrayList<>();
                params.add(new BasicNameValuePair("type", "5"));
                params.add(new BasicNameValuePair("openId", d.getOpenid()));
@ -3661,7 +3661,7 @@ public class FamilyContractService extends BaseService {
            }
            //            新增发送医生助手模板消息 v1.4.0 by wujunjie
            if (StringUtils.isNotEmpty(d.getOpenid())){
                String url = doctorAssistant + "/doctor/feldsher/sendDoctorTemplates";
                String url = doctorAssistant + "/wlyy/feldsher/sendDoctorTemplates";
                List<NameValuePair> params = new ArrayList<>();
                params.add(new BasicNameValuePair("type", "5"));
                params.add(new BasicNameValuePair("openId", d.getOpenid()));

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

@ -17,6 +17,7 @@ import com.yihu.wlyy.service.third.ylz.PayLogService;
import com.yihu.wlyy.service.weixin.wxpay.model.BindCard;
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.RequestParams;
@ -28,11 +29,14 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONException;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
@ -51,10 +55,7 @@ import java.io.StringWriter;
import java.net.URLDecoder;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * Created by hzp on 2017/05/23.
@ -84,6 +85,12 @@ public class OnePayController extends WeixinBaseController {
    ObjectMapper objectMapper;
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Value("${doctorAssistant.api}")
    private String doctorAssistant;
    @Value("${doctorAssistant.target_url}")
    private String targetUrl;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @RequestMapping(value = "bindCard", method = RequestMethod.POST)
    @ApiOperation("查询绑卡信息")
@ -758,12 +765,29 @@ public class OnePayController extends WeixinBaseController {
    @ResponseBody
    public String cleaData() throws IOException, PayException {
        try {
            String sql = "SELECT t.code FROM wlyy_charge t WHERE (t.need_upload != '0' OR t.need_upload is null) AND (t.trade_status = '0' OR t.trade_status = '1')";
            /*String sql = "SELECT t.code FROM wlyy_charge t WHERE (t.need_upload != '0' OR t.need_upload is null) AND (t.trade_status = '0' OR t.trade_status = '1')";
            List<Map<String, Object>> codes = jdbcTemplate.queryForList(sql);
            for (Map<String, Object> code :codes) {
                String outChargeNo = code.get("code").toString();
                pay.chargeQuery(outChargeNo,getAccessToken());
            }
            }*/
            String url = doctorAssistant + "/wllyy/feldsher/sendDoctorTemplates";
            List<NameValuePair> params = new ArrayList<>();
            params.add(new BasicNameValuePair("type", "5"));
            params.add(new BasicNameValuePair("openId", "orrOgwATDaljVunlAq_Tdx3imhYg"));
            params.add(new BasicNameValuePair("url", targetUrl));
            params.add(new BasicNameValuePair("first", "wjj" + "医生您好,你有一条新的签约申请待处理"));
            params.add(new BasicNameValuePair("remark", "请尽快使用厦门i健康APP处理居民的签约申请"));
            SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日 HH:mm");
            String date = format.format(new Date());
            String keywords = date + "," + "wjj";
            params.add(new BasicNameValuePair("keywords", keywords));
            LOGGER.info("==========================================");
            LOGGER.info("url ==>"+url);
            LOGGER.info("targetUrl ==>"+targetUrl);
            LOGGER.info("==========================================");
            httpClientUtil.post(url, params, "UTF-8");
            LOGGER.info("*********************************************");
            return write(200, "数据整理成功!");
        } catch (Exception e) {
            return write(-1, "数据整理成功失败!");

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

@ -21,7 +21,7 @@ server:
  server_url: http://ehr.yihu.com/wlyy/
#医生助手服务器地址及模板跳转链接(医生未读消息统计页)
doctorAssistant:
  api: http://ehr.yihu.com/wlyy/
  api: http://172.19.103.88:443/assistant/
  target_url: home/html/unreadMessageStatistic.html
im: