Browse Source

药柜处方订单状态接口获取修改

bing 2 years ago
parent
commit
eacdaa87c9

+ 0 - 46
svr/svr-base/src/main/java/com/yihu/jw/base/service/a3service/MedicineOrderService.java

@ -1553,52 +1553,6 @@ public class MedicineOrderService extends BaseJpaService<Mediicineorder, Mediici
    }
    /**
     * 根据处方号获取处方状态
     * @param realOrder
     * @return
     */
    public String getDataStatus(String realOrder){
        OauthWlyyConfigDO oauthWlyyConfigDO = oauthWlyyConfigDao.findOne("getDataStatus");
        //token获取accesstoken
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("appid", oauthWlyyConfigDO.getAppId()));
        params.add(new BasicNameValuePair("appSecret",oauthWlyyConfigDO.getAppSecret()));
        String res = httpClientUtil.post(oauthWlyyConfigDO.getTokenUrl(),params,"UTF-8");
        String token = null;
        JSONObject rsjson = JSONObject.parseObject(res);
        logger.info("checkWlyyDoctor token :"+rsjson.toString());
        Integer status = rsjson.getInteger("status");
        if(status==10000){
            //设置入参
            List<NameValuePair> p = new ArrayList<>();
            p.add(new BasicNameValuePair("jwCode", realOrder));
            //设置头部
            token = rsjson.getJSONObject("result").getString("accesstoken");
            Map<String,Object> headerMap = new HashedMap();
            headerMap.put("accesstoken",token);
            String rs = httpClientUtil.headerPost(oauthWlyyConfigDO.getUrl(),p,"UTF-8",headerMap);
            WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
            wlyyHttpLogDO.setCode("getDataStatus");
            wlyyHttpLogDO.setRequest(p.toString());
            wlyyHttpLogDO.setResponse(rs);
            wlyyHttpLogDO.setName("根据处方号获取i健康处方状态");
            wlyyHttpLogDO.setStatus("1");
            wlyyHttpLogDO.setCreateTime(new Date());
            httpLogDao.save(wlyyHttpLogDO);
            logger.info("getDataStatus:"+rs);
            return rs;
        }else {
            return null;
        }
    }
    /**
     * 取货预警发送模板消息

+ 4 - 3
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/MedicineService.java

@ -225,7 +225,7 @@ public class MedicineService {
        List<Mediicineorder> mediicineorderList = mediicineorderDao.findMediicineorderBySellState("0");
        int i=0;
        for (Mediicineorder mediicineorder:mediicineorderList){
            String result = getDataStatus(mediicineorder.getPickUpNum());
            String result = getDataStatus(mediicineorder.getPickUpNum(),mediicineorder.getBelongCommunity());
            if (StringUtils.isNoneBlank(result)){
                JSONObject resObj = JSONObject.parseObject(result);
                if (resObj.getString("status").equalsIgnoreCase("200")){
@ -286,7 +286,7 @@ public class MedicineService {
     * @param realOrder
     * @return
     */
    public String getDataStatus(String realOrder){
    public String getDataStatus(String realOrder,String hospital){
        OauthWlyyConfigDO oauthWlyyConfigDO = oauthWlyyConfigDao.findOne("getDataStatus");
        //token获取accesstoken
        List<NameValuePair> params = new ArrayList<>();
@ -303,7 +303,8 @@ public class MedicineService {
            //设置入参
            List<NameValuePair> p = new ArrayList<>();
            p.add(new BasicNameValuePair("jwCode", realOrder));
            p.add(new BasicNameValuePair("recipeNo", realOrder));
            p.add(new BasicNameValuePair("hospital", hospital));
            //设置头部
            token = rsjson.getJSONObject("result").getString("accesstoken");