Selaa lähdekoodia

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

chenweida 7 vuotta sitten
vanhempi
commit
8587580bf0

+ 24 - 8
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionExpressageService.java

@ -44,12 +44,11 @@ public class PrescriptionExpressageService {
     *
     * @param code     编码code
     * @param userCode
     * @param type     1是医生  2是患者
     * @return 返回取药码或者配送码的类型  1 居民取药码 2 配送员(健管师)取药码 3 配送员(健管师)配送码
     * 前端根据这个类型去跳转
     */
    @Transactional
    public Integer expressage(String code, String userCode, Integer type) throws Exception {
    public Integer expressage(String code, String userCode) throws Exception {
        Integer returnStatus = -1;
        //获取根据wlyy_prescription_dispensary_code的code处方编码
        PrescriptionDispensaryCode prescriptionDispensaryCode = prescriptionDispensaryCodeDao.finByCode(code);
@ -65,11 +64,26 @@ public class PrescriptionExpressageService {
            prescriptionLog.setUserCode(userCode);
            prescriptionLog.setUserType(2);
            prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
            prescriptionLog.setRemark("配送失败,处方编码不存在");
            prescriptionLog.setRemark("编码不存在");
            prescriptionLogDao.save(prescriptionLog);
            return returnStatus;
        }
        if (prescriptionDispensaryCode.getIsUse() == 1) {
            //判断编码是否使用过
            PrescriptionLog prescriptionLog = new PrescriptionLog();
            prescriptionLog.setCode(UUID.randomUUID().toString());
            prescriptionLog.setPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
            prescriptionLog.setCreateTime(new Date());
            prescriptionLog.setType(PrescriptionLog.PrescriptionLogType.expressage.getValue());
            prescriptionLog.setFlag(1);
            prescriptionLog.setUserCode(userCode);
            prescriptionLog.setUserType(2);
            prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
            prescriptionLog.setRemark("编码重复扫描");
            prescriptionLogDao.save(prescriptionLog);
            returnStatus = -2;
            return returnStatus;
        }
        switch (prescriptionDispensaryCode.getType()) {
            case 1: {
                //判断是1 居民取药码
@ -86,7 +100,7 @@ public class PrescriptionExpressageService {
                returnStatus = dispensaryCode_3(userCode, prescriptionDispensaryCode);
                break;
            }
            default:{
            default: {
                PrescriptionLog prescriptionLog = new PrescriptionLog();
                prescriptionLog.setCode(UUID.randomUUID().toString());
                prescriptionLog.setPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
@ -96,9 +110,10 @@ public class PrescriptionExpressageService {
                prescriptionLog.setUserCode(userCode);
                prescriptionLog.setUserType(2);
                prescriptionLog.setStatus(PrescriptionLog.PrescriptionLogStatus.expressageing_error.getValue());
                prescriptionLog.setRemark("二维码类型错误");
                prescriptionLog.setRemark("编码类型错误");
                prescriptionLogDao.save(prescriptionLog);
                break;
                returnStatus = -3;
                return returnStatus;
            }
        }
        return returnStatus;
@ -192,10 +207,11 @@ public class PrescriptionExpressageService {
    /**
     * 保存快递单号和增加处方物流记录为配送
     *
     * @param prescriptionExpressage
     * @throws Exception
     */
    public void updatePrescriptionExpressage(PrescriptionExpressage prescriptionExpressage)throws Exception{
    public void updatePrescriptionExpressage(PrescriptionExpressage prescriptionExpressage) throws Exception {
        //保存处方物流记录
        prescriptionExpressageDao.save(prescriptionExpressage);

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

@ -95,9 +95,13 @@ public class PrescriptionCodeController extends BaseController {
    public String expressage(
            @ApiParam(required = true, name = "code", value = " 二维码code") @RequestParam(value = "code", required = true) String code) {
        try {
            Integer status = prescriptionExpressageService.expressage(code, getUID(), 1);
            Integer status = prescriptionExpressageService.expressage(code, getUID());
            if (status == -1) {
                return error(-1, "取药码错误");
            } else if (status == -2) {
                return error(-1, "编码已使用");
            } else if (status == -3) {
                return error(-1, "编码类型错误");
            }
            return write(200, "配送成功", "status", status);
        } catch (Exception e) {