Jelajahi Sumber

[cmd]健康小程序接口

wangzhinan 7 tahun lalu
induk
melakukan
db28d6070e

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

@ -137,6 +137,7 @@ public class CreditLogService {
        object.put("name",patient.getName());
        object.put("idCard",patient.getIdcard());
        object.put("openId",patient.getOpenid());
        object.put("unionId",patient.getUnionid());
        String url =getBaseUrl() + "createCreditsDetail";
        Map<String,String> params = new HashMap<>();
        params.put("creditsDetail",object.toJSONString());
@ -494,8 +495,14 @@ public class CreditLogService {
        String response = null;
        String url =getBaseUrl() + "doctorAddIntegrate";
        JSONArray array = object.getJSONArray("patientIds");
        JSONArray jsonArray  = new JSONArray();
        for (int i =0 ;i<array.size();i++){
            Patient patient = patientDao.findByCode(array.getString(i));
            JSONObject jsonObject = (JSONObject) JSONObject.toJSON(patient);
            jsonArray.add(jsonObject);
        }
        JSONObject object1 = new JSONObject();
        object1.put("patientIds",array);
        object1.put("patient",jsonArray);
        object1.put("ruleId",object.getString("ruleId"));
        object1.put("description",object.getString("description"));
        JSONObject object2 = null;

+ 0 - 19
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/bank/CreditsLogController.java

@ -225,24 +225,5 @@ public class CreditsLogController extends BaseController {
        }
    }
    /**
     * 步数获取积分
     *
     * @param creditsDetail {"patientId":"","transactionId":"","stepNumber":""}
     * @return
     */
    @RequestMapping(value = "/stepAddIntegrate",method = RequestMethod.POST)
    @ApiOperation("步数获取积分")
    public String stepAddIntegrate(@ApiParam(name = "creditsDetail",value = "对象JSON")
                         @RequestParam(name = "creditsDetail") String creditsDetail){
        try {
            JSONObject object = JSONObject.parseObject(creditsDetail);
            JSONObject result = service.insert(object);
            return write(200,"获取成功","data",result);
        }catch (Exception e){
            error(e);
            return error(-1,e.getMessage());
        }
    }
}

+ 20 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/health/bank/AccountController.java

@ -79,5 +79,25 @@ public class AccountController extends BaseController {
        }
    }
    /**
     * 步数获取积分
     *
     * @param creditsDetail {"patientId":"","transactionId":"","stepNumber":""}
     * @return
     */
    @RequestMapping(value = "/stepAddIntegrate",method = RequestMethod.POST)
    @ApiOperation("步数获取积分")
    public String stepAddIntegrate(@ApiParam(name = "creditsDetail",value = "对象JSON")
                                   @RequestParam(name = "creditsDetail") String creditsDetail){
        try {
            JSONObject object = JSONObject.parseObject(creditsDetail);
            JSONObject result = service.stepAddIntegrate(object);
            return write(200,"获取成功","data",result);
        }catch (Exception e){
            error(e);
            return error(-1,e.getMessage());
        }
    }
}