瀏覽代碼

bug修改

chenweida 8 年之前
父節點
當前提交
d9abac771a

+ 29 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignFamilyServiceService.java

@ -97,7 +97,7 @@ public class SignFamilyServiceService {
        jo.put("status", 1);//执行成功
        jo.put("all", patients.size());//未成功的患者
        jo.put("success", patients.size()-errorPatient.size());//成功的患者
        jo.put("success", patients.size() - errorPatient.size());//成功的患者
        jo.put("errorPatients", errorPatient);//未成功的患者
        return jo;
    }
@ -177,6 +177,31 @@ public class SignFamilyServiceService {
        return jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper(ServiceItem.class));
    }
    /**
     * 查询患者的服务
     *
     * @param patientCode
     * @param serviceCode
     * @return
     */
    public Service getPatientService(String patientCode, String serviceCode) {
        StringBuffer sql = new StringBuffer("SELECT " +
                "  s.* " +
                "FROM " +
                "  wlyy_sign_family_service fs, " +
                "  wlyy_service s " +
                "WHERE " +
                "  s.del = 1 " +
                "AND fs.service_code = s.`code` " +
                "AND fs.patient = '" + patientCode + "' ");
        if (!StringUtils.isEmpty(serviceCode)) {
            sql.append(" and fs.service_code= '" + serviceCode + "' ");
        }
        List<Service> ss = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper(Service.class));
        return ss.get(0);
    }
    private SignFamily getSignFamily(String patient) {
        String sql = "select count(s.id) num,s.code from wlyy_sign_family s where s.patient='" + patient + "' and s.`status`>0 and s.expenses_status=1  ";
@ -203,7 +228,7 @@ public class SignFamilyServiceService {
        jo.put("status", 1);//执行成功
        jo.put("all", patients.size());//未成功的患者
        jo.put("success", patients.size()-errorPatient.size());//成功的患者
        jo.put("success", patients.size() - errorPatient.size());//成功的患者
        jo.put("errorPatients", errorPatient);//未成功的患者
        return jo;
    }
@ -317,4 +342,6 @@ public class SignFamilyServiceService {
        List<String> patients = jdbcTemplate.queryForList(sql, String.class);
        return patientsDeleteService(patients, serviceCode);
    }
}

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

@ -51,7 +51,15 @@ public class PrescriptionLogController extends BaseController {
                    PrescriptionLog.PrescriptionLogStatus.finish.getValue()};
            List<PrescriptionLog> prescriptionLogs = prescriptionLogService.findPrescriptionLogsByPrescriptionCode(prescriptionCode, status);
            if (prescriptionLogs != null) {
                return write(200, "获取处方流程成功", "data", new JSONArray(copyBeans(prescriptionLogs, "statusName", "createTime")));
                JSONArray ja = new JSONArray();
                prescriptionLogs.stream().forEach(one -> {
                    JSONObject jo = new JSONObject();
                    jo.put("createTime", DateUtil.dateToStrLong(one.getCreateTime()));
                    jo.put("statusName", one.getStatusName());
                    ja.put(jo);
                });
                return write(200, "获取处方流程成功", "data", ja);
            } else {
                return error(-1, "获取失败");
            }

+ 9 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/sign/PatientSignFamilyServiceController.java

@ -1,6 +1,9 @@
package com.yihu.wlyy.web.patient.sign;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.service.Service;
import com.yihu.wlyy.entity.service.ServiceItem;
import com.yihu.wlyy.entity.service.SignFamilyService;
import com.yihu.wlyy.service.app.sign.SignFamilyServiceService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
@ -30,8 +33,13 @@ public class PatientSignFamilyServiceController extends BaseController {
            @RequestParam(required = false, value = "patientCode") @ApiParam(required = false, value = "患者code", name = "patientCode") String patientCode
    ) {
        try {
            JSONObject jo = new JSONObject();
           Service service = signFamilyServiceService.getPatientService(patientCode, null);
            List<ServiceItem> serviceItems = signFamilyServiceService.getPatientServiceItem(patientCode, null);
            return write(200, "请求成功", "data", serviceItems);
            jo.put("service", service);
            jo.put("serviceItem", serviceItems);
            return write(200, "请求成功", "data", jo);
        } catch (Exception e) {
            return error(-1, e.getMessage());
        }