Browse Source

代码修改

yeshijie 7 năm trước cách đây
mục cha
commit
e0648f580d

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

@ -0,0 +1,51 @@
package com.yihu.wlyy.service.app.prescription;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.patient.prescription.Prescription;
import com.yihu.wlyy.entity.patient.prescription.PrescriptionLog;
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * 线下调整处方
 * Created by yeshijie on 2017/8/17.
 */
@Service
public class PrescriptionAdjustService extends BaseService {
    @Autowired
    private JwPrescriptionService jwPrescriptionService;
    @Autowired
    private PrescriptionDao prescriptionDao;
    /**
     * 线下调整处方
     * @param code
     */
    public void adjustPrescription(String code){
        Prescription prescription = prescriptionDao.findByCode(code);
        if(prescription.getStatus()== PrescriptionLog.PrescriptionLogStatus.revieweding.getValue()){
            //待审核状态才可以线下调整处方
            String response = jwPrescriptionService.saveRecipe(code,prescription.getJwGisterTypeCode(),prescription.getJwDeptCode());
            JSONObject json = JSONObject.parseObject(response);
            if(json.getInteger("status")==200){
                JSONObject data = json.getJSONObject("data");
            }else{
                //请求报错
            }
        }
    }
}

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

@ -0,0 +1,34 @@
package com.yihu.wlyy.web.doctor.prescription;
import com.yihu.wlyy.repository.prescription.PrescriptionDao;
import com.yihu.wlyy.service.app.prescription.PrescriptionAdjustService;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
 * Created by yeshijie on 2017/8/17.
 */
@RestController
@RequestMapping(value = "/doctor/prescriptionAdjust")
@Api(description = "医生端-长处方线下调整相关接口接口")
public class PrescriptionAdjustController extends BaseController {
    @Autowired
    private JwPrescriptionService jwPrescriptionService;
    @Autowired
    private PrescriptionDao prescriptionDao;
    @Autowired
    private PrescriptionAdjustService prescriptionAdjustService;
}