瀏覽代碼

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

trick9191 7 年之前
父節點
當前提交
b155c4994a

+ 17 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/applets/AppletsService.java

@ -5,12 +5,15 @@ import com.yihu.wlyy.entity.patient.PatientAimSports;
import com.yihu.wlyy.repository.patient.PatientAimSportsDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.health.bank.TaskService;
import com.yihu.wlyy.util.SecretUtils;
import com.yihu.wlyy.util.http.HttpResponse;
import com.yihu.wlyy.util.http.HttpUtils;
import org.apache.commons.collections.map.HashedMap;
import org.json.JSONArray;
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.jdbc.core.JdbcTemplate;
@ -28,6 +31,7 @@ import java.util.Map;
@Transactional
public class AppletsService extends BaseService {
    private static Logger logger = LoggerFactory.getLogger(AppletsService.class);
    @Value("${applets.appId}")
    private String appid;
    @Value("${applets.appSecret}")
@ -38,6 +42,8 @@ public class AppletsService extends BaseService {
    private PatientDao patientDao;
    @Autowired
    private PatientAimSportsDao patientAimSportsDao;
    @Autowired
    private TaskService taskService;
    public Map<String, Object> checkApplets(String code) throws Exception {
        HttpUtils httpUtils = new HttpUtils();
@ -50,6 +56,8 @@ public class AppletsService extends BaseService {
        HttpResponse response = httpUtils.doGet("https://api.weixin.qq.com/sns/jscode2session", param);
        JSONObject rs = new JSONObject(response.getContent());
        Map<String, Object> res = new HashedMap();
        logger.info("checkApplets:"+response.getContent());
        res.put("openid", rs.getString("openid"));
        res.put("sessionKey", rs.getString("session_key"));
        res.put("unionid", rs.getString("unionid"));
@ -133,6 +141,15 @@ public class AppletsService extends BaseService {
            patientAimSportsDao.save(patientAimSports);
        }
        //上传步数记录
        try{
            com.alibaba.fastjson.JSONObject json  = new com.alibaba.fastjson.JSONObject();
            json.put("patientId",patient);
            json.put("taskCode","ACTIVITY_STEP");
            taskService.createActiveRecord(json);
        }catch (Exception e){
            logger.info(e.toString());
        }
        return true;
    }

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -1335,7 +1335,7 @@ public class ConsultController extends WeixinBaseController {
            if (result.has("count") && result.has("amount")){
                return write(200, "查询成功!", "data", result);
            }else if (result.has("count") && !result.has("amount")){
                return error(-1, "查询已签约记录失败!");
                return error(-1, "您的签约已到期,请重新申请");
            }else {
                return error(-1, "查询失败!");
            }

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

@ -115,7 +115,7 @@ images:
sign:
  #check_upload: http://172.19.103.88:8011/wlyy_service
  check_upload: localhost:8070/wlyy_service
  check_upload: http://localhost:8070/
express:

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

@ -34,7 +34,7 @@ im:
#专病配置
specialist:
  url: http://127.0.0.1:10051/svr-wlyy-specialist/
  url: http://192.168.120.167:8661/svr-wlyy-specialist/
#物联网配置
iot:
  url: http://192.168.131.24:8088/svr-iot/