Browse Source

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

chenweida 7 years ago
parent
commit
3e0ec141ec

+ 1 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/patient/prescription/Prescription.java

@ -37,7 +37,7 @@ public class Prescription extends IdEntity {
    private String patientName;             //患者名称
    private String ssc;//社保卡号
    private Integer type;                    //1 处方 2 续方
    private Integer status;                  //(-4线下退费 -3 支付过期 -2 患者自己取消 )续方取消,-1 审核不通过 ,
    private Integer status;                  //(-5线下取消 -4线下退费 -3 支付过期 -2 患者自己取消 )续方取消,-1 审核不通过 ,
    // (0 待审核, 2调整中,3调整成功, 4调整失败 ,10 医生审核(CA)通过)审核中,
    // 20药师审核中,21.药师审核失败,30 开方中/药师审核成功,31.开方失败/预结算失败,
    // (40开方完成/待支付 ,41 支付失败 )待支付,  50 支付成功/待配药,(60配药成功/待配送)等待领药,

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

@ -327,7 +327,7 @@ public class PrescriptionController extends BaseController{
	
	@RequestMapping(value = "getDataStatus",method = RequestMethod.POST)
	@ApiOperation("获取长处方相关数据状态接口")
	public Result affirmCARecipe(@ApiParam(name="type",value="数据类型:1:挂号数据;2:处方数据;3:结算数据",defaultValue = "")
	public Result getDataStatus(@ApiParam(name="type",value="数据类型:1:挂号数据;2:处方数据;3:结算数据",defaultValue = "")
	                             @RequestParam(value = "type",required = true) String type,
	                             @ApiParam(name="prescriptionCode",value="长处方单号",defaultValue = "")
	                             @RequestParam(value = "prescriptionCode",required = true) String prescriptionCode){

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

@ -409,4 +409,42 @@ public class PrescriptionService extends BaseService {
        }
    }
    public JSONObject checkRecipeNoPay(int type,String prescriptionCode) throws Exception{
        String result = jwPrescriptionService.getDataStatus(type,prescriptionCode);
        JSONObject statusObj = new JSONObject();
        if(StringUtils.isNotBlank(result)){
            JSONObject jsonobj = JSON.parseObject(result);
            JSONObject statusInfon = jsonobj.getJSONObject("data");
            Integer status = jsonobj.getInteger("status");
            if(200 == status){
                JSONArray ReturnData = statusInfon.getJSONArray("returnData");
                if(ReturnData.size()!=0 && !ReturnData.isEmpty()) {
                    JSONObject data = ReturnData.getJSONArray(0).getJSONObject(0);
                    String code = data.getString("RECIPE_STATUS_CODE");
                    //如果基卫返回回来的处方状态为“作废”,code为9的时候,修改本地数据库
                    //处方状态为“线下取消”
                    if("9".equals(code)){
                        prescriptionDao.updateStatus(prescriptionCode,-5);
                        statusObj.put("status",200);
                        statusObj.put("code",200);
                        statusObj.put("message","基卫处方为作废,已修改本地数据库该处方为线下取消");
                    }else{
                        statusObj.put("status",200);
                        statusObj.put("code",data.getString("RECIPE_STATUS_CODE"));
                        statusObj.put("message",data.getString("RECIPE_STATUS_NAME"));
                    }
                }
            }else if (404 == status){
                statusObj.put("status",404);
                statusObj.put("message","没有找到相应的结果");
            }else{
                statusObj.put("status",0);
                statusObj.put("message","操作失败!");
            }
        }
        return statusObj;
    }
}

+ 15 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java

@ -353,4 +353,19 @@ public class JwPrescriptionService {
        return response;
    }
    /**
     * 获取数据状态
     * @param type 传入数字,1:挂号数据;2:处方数据;3:结算数据
     * @param prescriptionCode 对应传入处方业务主键
     * @return
     */
    public String getDataStatus(int type, String prescriptionCode){
        String url = jwUrl + "/third/prescription/getDataStatus";
        List<NameValuePair> params = new ArrayList<>();
        params.add(new BasicNameValuePair("type", String.valueOf(type)));
        params.add(new BasicNameValuePair("prescriptionCode", prescriptionCode));
        String response = httpClientUtil.post(url, params, "UTF-8");
        return response;
    }
}

+ 21 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.web.patient.prescription;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
@ -13,6 +14,8 @@ import com.yihu.wlyy.web.WeixinBaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
@ -265,4 +268,22 @@ public class PatientPrescriptionController extends WeixinBaseController {
        }
    }
    /**
     *
     * @param prescriptionCode
     * @return
     */
    @RequestMapping(value = "/checkRecipeNoPay",method = RequestMethod.POST)
    @ApiOperation(value = "查询待结算订单是否作废,如果作废更新本地数据为线下取消")
    public String checkRecipeNoPay(@ApiParam(value = "处方业务主键",name = "prescriptionCode")@RequestParam(value = "prescriptionCode")String prescriptionCode){
        try{
            //Prescription prescription = prescriptionService.findByCode(prescriptionCode);
            JSONObject object = prescriptionService.checkRecipeNoPay(2,prescriptionCode);
            return write(200,"操作成功!","result",object);
        }catch (Exception e){
            error(e);
            return error(-1,"操作失误!"+e.getMessage());
        }
    }
}