瀏覽代碼

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

yeshijie 7 年之前
父節點
當前提交
f55cd729c5

+ 4 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceService.java

@ -236,13 +236,14 @@ public class PatientDeviceService extends BaseService {
    /**
     * 删除患者设备
     */
    public List<JSONObject> deleteDevice(String id, String uuid) {
    public List<com.alibaba.fastjson.JSONObject> deleteDevice(String id, String uuid) {
        PatientDevice device = patientDeviceDao.findOne(Long.valueOf(id));
        patientDeviceDao.delete(device);
        List<PatientDevice> patientDevices = patientDeviceDao.findByDeviceSnAndCategoryCode(device.getDeviceSn(), device.getCategoryCode());
        List<JSONObject> objects = new ArrayList<>();
        List<com.alibaba.fastjson.JSONObject> objects = new ArrayList<>();
        for (PatientDevice patientDevice : patientDevices) {
            JSONObject object = new JSONObject(patientDevice);
            String json = com.alibaba.fastjson.JSONObject.toJSONString(patientDevice) ;
            com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(json) ;
            Patient patient = patientDao.findByCode(patientDevice.getUser());
            if (patient != null) {
                object.put("userName", patient.getName());

+ 2 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/device/DoctorDeviceController.java

@ -12,7 +12,6 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
@ -97,7 +96,7 @@ public class DoctorDeviceController extends BaseController {
			if(pd!=null)
			{
				if(StringUtils.isNotBlank(pd.getDoctor())&&StringUtils.equals(pd.getDoctor(), getUID())){
					List<JSONObject> objects = patientDeviceService.deleteDevice(id,getUID());
					List<com.alibaba.fastjson.JSONObject> objects = patientDeviceService.deleteDevice(id,getUID());
					return write(200,"","data",objects);
				}
				else if(StringUtils.isNotBlank(pd.getDoctor())&&!StringUtils.equals(pd.getDoctor(), getUID())){
@ -108,7 +107,7 @@ public class DoctorDeviceController extends BaseController {
						bo = true;
					}
					if(bo){//同行政团队
						List<JSONObject> objects = patientDeviceService.deleteDevice(id,getUID());
						List<com.alibaba.fastjson.JSONObject> objects = patientDeviceService.deleteDevice(id,getUID());
						return write(200,"","data",objects);
					}else{
						return error(-1, "只允许删除自己及自己行政团队绑定的设备!");