|  | @ -126,9 +126,9 @@ public class DoctorSchemeService {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         List<DoctorSchemeBloodSugger> schemelist = doctroSchemeBloodSuggerDao.getListByDoctorcode(doctorcode);
 |  |         List<DoctorSchemeBloodSugger> schemelist = doctroSchemeBloodSuggerDao.getListByDoctorcode(doctorcode);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         List<DoctorSchemeBloodSugger> defaultSchemeBloodSugger = doctroSchemeBloodSuggerDao.findByCode("default");
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         schemelist.addAll(defaultSchemeBloodSugger);
 |  | 
 | 
												
													
														
															|  | 
 |  | //        List<DoctorSchemeBloodSugger> defaultSchemeBloodSugger = doctroSchemeBloodSuggerDao.findByCode("default");
 | 
												
													
														
															|  | 
 |  | //
 | 
												
													
														
															|  | 
 |  | //        schemelist.addAll(defaultSchemeBloodSugger);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         if(!schemelist.isEmpty()){
 |  |         if(!schemelist.isEmpty()){
 | 
												
													
														
															|  |             for (DoctorSchemeBloodSugger doctorSchemeBloodSugger : schemelist) {
 |  |             for (DoctorSchemeBloodSugger doctorSchemeBloodSugger : schemelist) {
 | 
												
											
												
													
														
															|  | @ -167,9 +167,9 @@ public class DoctorSchemeService {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         List<DoctorSchemeBloodPressure> schemelist = doctoreSchemeBloodPressureDao.getListByDoctorcode(doctorcode);
 |  |         List<DoctorSchemeBloodPressure> schemelist = doctoreSchemeBloodPressureDao.getListByDoctorcode(doctorcode);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         List<DoctorSchemeBloodPressure> defaultSchemeBloodPressure = doctoreSchemeBloodPressureDao.findByCode("default");
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         schemelist.addAll(defaultSchemeBloodPressure);
 |  | 
 | 
												
													
														
															|  | 
 |  | //        List<DoctorSchemeBloodPressure> defaultSchemeBloodPressure = doctoreSchemeBloodPressureDao.findByCode("default");
 | 
												
													
														
															|  | 
 |  | //
 | 
												
													
														
															|  | 
 |  | //        schemelist.addAll(defaultSchemeBloodPressure);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         if(!schemelist.isEmpty()){
 |  |         if(!schemelist.isEmpty()){
 | 
												
													
														
															|  |             for (DoctorSchemeBloodPressure doctorSchemeBloodPressure : schemelist) {
 |  |             for (DoctorSchemeBloodPressure doctorSchemeBloodPressure : schemelist) {
 | 
												
											
												
													
														
															|  | @ -202,7 +202,7 @@ public class DoctorSchemeService {
 | 
												
													
														
															|  |      * @param data
 |  |      * @param data
 | 
												
													
														
															|  |      * @throws Exception
 |  |      * @throws Exception
 | 
												
													
														
															|  |      */
 |  |      */
 | 
												
													
														
															|  |     public void saveDoctorSchemeBloodSugger(String data) {
 |  | 
 | 
												
													
														
															|  | 
 |  |     public void saveDoctorSchemeBloodSugger(String data) throws Exception{
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         JSONObject dataObj =  JSON.parseObject(data);
 |  |         JSONObject dataObj =  JSON.parseObject(data);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
											
												
													
														
															|  | @ -223,7 +223,10 @@ public class DoctorSchemeService {
 | 
												
													
														
															|  |         for (int i = 0; i < datalist.size(); i++) {
 |  |         for (int i = 0; i < datalist.size(); i++) {
 | 
												
													
														
															|  |             DoctorSchemeBloodSugger doctorSchemeBloodSugger = new DoctorSchemeBloodSugger();
 |  |             DoctorSchemeBloodSugger doctorSchemeBloodSugger = new DoctorSchemeBloodSugger();
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |             Long id = datalist.getJSONObject(i).getLong("id");
 |  | 
 | 
												
													
														
															|  | 
 |  |             long id = 0;
 | 
												
													
														
															|  | 
 |  |             if(datalist.getJSONObject(i).containsKey("id")){
 | 
												
													
														
															|  | 
 |  |                 id=datalist.getJSONObject(i).getLong("id");
 | 
												
													
														
															|  | 
 |  |             }
 | 
												
													
														
															|  |             if(id != 0){
 |  |             if(id != 0){
 | 
												
													
														
															|  |                 doctorSchemeBloodSugger.setId(datalist.getJSONObject(i).getLong("id"));
 |  |                 doctorSchemeBloodSugger.setId(datalist.getJSONObject(i).getLong("id"));
 | 
												
													
														
															|  |             }
 |  |             }
 | 
												
											
												
													
														
															|  | @ -284,7 +287,10 @@ public class DoctorSchemeService {
 | 
												
													
														
															|  |         for (int i = 0; i < datalist.size(); i++) {
 |  |         for (int i = 0; i < datalist.size(); i++) {
 | 
												
													
														
															|  |             DoctorSchemeBloodPressure doctorSchemeBloodPressure = new DoctorSchemeBloodPressure();
 |  |             DoctorSchemeBloodPressure doctorSchemeBloodPressure = new DoctorSchemeBloodPressure();
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |             Long id = datalist.getJSONObject(i).getLong("id");
 |  | 
 | 
												
													
														
															|  | 
 |  |             long id = 0;
 | 
												
													
														
															|  | 
 |  |             if(datalist.getJSONObject(i).containsKey("id")){
 | 
												
													
														
															|  | 
 |  |                 id=datalist.getJSONObject(i).getLong("id");
 | 
												
													
														
															|  | 
 |  |             }
 | 
												
													
														
															|  |             if(id != 0){
 |  |             if(id != 0){
 | 
												
													
														
															|  |                 doctorSchemeBloodPressure.setId(datalist.getJSONObject(i).getLong("id"));
 |  |                 doctorSchemeBloodPressure.setId(datalist.getJSONObject(i).getLong("id"));
 | 
												
													
														
															|  |             }
 |  |             }
 | 
												
											
												
													
														
															|  | @ -334,7 +340,7 @@ public class DoctorSchemeService {
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         for (int i = 0; i < codes.size(); i++) {
 |  |         for (int i = 0; i < codes.size(); i++) {
 | 
												
													
														
															|  |             patientcodeList.add(codes.getJSONObject(i).toString());
 |  | 
 | 
												
													
														
															|  | 
 |  |             patientcodeList.add(codes.get(i).toString());
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         if (!patientcodeList.isEmpty()) {
 |  |         if (!patientcodeList.isEmpty()) {
 | 
												
											
												
													
														
															|  | @ -345,8 +351,9 @@ public class DoctorSchemeService {
 | 
												
													
														
															|  |             TransactionStatus status = transactionManager.getTransaction(def); // 获得事务状态
 |  |             TransactionStatus status = transactionManager.getTransaction(def); // 获得事务状态
 | 
												
													
														
															|  |             try {
 |  |             try {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |                 PatientSchemeList patientSchemeListObj = new PatientSchemeList();
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |                 for (String patientcode : patientcodeList) {
 |  |                 for (String patientcode : patientcodeList) {
 | 
												
													
														
															|  | 
 |  |                     PatientSchemeList patientSchemeListObj = new PatientSchemeList();
 | 
												
													
														
															|  |                     patientSchemeListDao.delByPatientCodeAndSchemeCode(patientcode, Integer.parseInt(type), schemecode);
 |  |                     patientSchemeListDao.delByPatientCodeAndSchemeCode(patientcode, Integer.parseInt(type), schemecode);
 | 
												
													
														
															|  |                     patientSchemeListObj.setCode(UUID.randomUUID().toString());
 |  |                     patientSchemeListObj.setCode(UUID.randomUUID().toString());
 | 
												
													
														
															|  |                     patientSchemeListObj.setPatientcode(patientcode);
 |  |                     patientSchemeListObj.setPatientcode(patientcode);
 | 
												
											
												
													
														
															|  | @ -508,4 +515,21 @@ public class DoctorSchemeService {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         return result;
 |  |         return result;
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |     /**
 | 
												
													
														
															|  | 
 |  |      * 删除医生监测方案
 | 
												
													
														
															|  | 
 |  |      * @param doctorcode
 | 
												
													
														
															|  | 
 |  |      * @param schemecode
 | 
												
													
														
															|  | 
 |  |      * @param type
 | 
												
													
														
															|  | 
 |  |      */
 | 
												
													
														
															|  | 
 |  |     public void delDoctorScheme(String doctorcode, String schemecode, String type) throws Exception{
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |         if("1".equals(type)){
 | 
												
													
														
															|  | 
 |  |             doctroSchemeBloodSuggerDao.updateDel(1,doctorcode,schemecode);
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |         if("2".equals(type)){
 | 
												
													
														
															|  | 
 |  |             doctoreSchemeBloodPressureDao.updateDel(1,doctorcode,schemecode);
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  |     }
 | 
												
													
														
															|  | }
 |  | }
 |