فهرست منبع

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

yeshijie 7 سال پیش
والد
کامیت
8c4f1e6cea

+ 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{
                //请求报错
            }
        }
    }
}

+ 19 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/CommonUtil.java

@ -127,7 +127,25 @@ public class CommonUtil {
        if(d==null){
            return 0;
        }
        return new Double(d*100).intValue();
        String currency = String.valueOf(d);
        int index = currency.indexOf(".");
        int length = currency.length();
        Integer amLong = 0;
        if(index == -1){
            amLong = Integer.valueOf(currency+"00");
        }else if(length - index >= 3){
            String temp = String.valueOf(d);
            amLong = Integer.valueOf((currency.substring(0, index+3)).replace(".", ""));
            Integer i = Integer.valueOf(currency.substring(index+3,index+4));
            if(i>=5){
                amLong++;
            }
        }else if(length - index == 2){
            amLong = Integer.valueOf((currency.substring(0, index+2)).replace(".", "")+0);
        }else{
            amLong = Integer.valueOf((currency.substring(0, index+1)).replace(".", "")+"00");
        }
        return amLong;
    }
    /**

+ 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;
}