Browse Source

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

yeshijie 7 years ago
parent
commit
8feff7ec15

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

@ -42,6 +42,21 @@ public class PrescriptionAdjustService extends BaseService {
    @Autowired
    private ImUtill imUtill;
    /**
     * 保存续方科室和挂号类型
     * @param code 续方code
     * @param jwGisterTypeCode 基卫-挂号类型编码
     * @param jwDeptCode 基卫-挂号科室
     * @param jwRegisterFee 基卫-诊金
     */
    public void saveDept(String code,String jwDeptCode,String jwGisterTypeCode,String jwRegisterFee){
        Prescription prescription = prescriptionDao.findByCode(code);
        prescription.setJwGisterTypeCode(jwGisterTypeCode);
        prescription.setJwDeptCode(jwDeptCode);
        prescription.setJwRegisterFee(jwRegisterFee);
        prescriptionDao.save(prescription);
    }
    /**
     * 线下调整处方
     * @param code

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

@ -38,6 +38,8 @@ public class JwPrescriptionService {
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private PrescriptionDao prescriptionDao;
    @Value("${spring.profiles}")
    private String profiles;
    /**
     * 获取字典列表
@ -89,15 +91,18 @@ public class JwPrescriptionService {
        params.add(new BasicNameValuePair("applyTimeFrom", applyTimeFrom));
        params.add(new BasicNameValuePair("applyTimeEnd", applyTimeEnd));
        String response = httpClientUtil.post(url, params, "UTF-8");
//        String sql = "SELECT h.response from wlyy_http_log h WHERE h.id = 806287";
//        List<Map<String ,Object>> list = jdbcTemplate.queryForList(sql);
//        String response = list.get(0).get("response").toString();
//        JSONObject jsonObject = new JSONObject();
//        jsonObject.put("status",200);
//        jsonObject.put("data",response);
//        response = jsonObject.toString();
        String response = "";
        if("prod".equals(profiles)){
            response = httpClientUtil.post(url, params, "UTF-8");
        }else {
            String sql = "SELECT h.response from wlyy_http_log h WHERE h.id = 806287";
            List<Map<String ,Object>> list = jdbcTemplate.queryForList(sql);
            response = list.get(0).get("response").toString();
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("status",200);
            jsonObject.put("data",response);
            response = jsonObject.toString();
        }
        return response;
    }

+ 7 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionAdjustController.java

@ -32,8 +32,14 @@ public class PrescriptionAdjustController extends BaseController {
    @ObserverRequired
    @ApiOperation("线下调整处方")
    public String adjustPrescription(@ApiParam(name = "code", value = "续方code", defaultValue = "10")
                                     @RequestParam(value = "code", required = true) String code){
                                     @RequestParam(value = "code", required = true) String code,
                                     @ApiParam(value = "科室", name = "dept") @RequestParam(required = true) String dept,
                                     @ApiParam(value = "诊金", name = "registerFee") @RequestParam(required = true) String registerFee,
                                     @ApiParam(value = "诊金类型", name = "rateTypeCode") @RequestParam(required = true) String rateTypeCode){
        try{
            //1、保存科室和挂号信息
            prescriptionAdjustService.saveDept(code,dept,rateTypeCode,registerFee);
            //2、调整处方
            JSONObject json = prescriptionAdjustService.adjustPrescription(code);
            if(json.getInteger("status")==-1){
                return error(-1,json.getString("msg"));