Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

8 years ago
parent
commit
b1ba152edb
19 changed files with 405 additions and 93 deletions
  1. 4 0
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/dao/DoctorDao.java
  2. 3 0
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/dao/PatientDao.java
  3. 63 0
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/data/DataHandingService.java
  4. 34 0
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/data/DataHandlingController.java
  5. 53 47
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/storage/RedisStorage.java
  6. 12 10
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentDayAllQuotaJob.java
  7. 64 0
      patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/util/MD5.java
  8. 7 0
      patient-co-wlyy/pom.xml
  9. 3 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/record/DrugService.java
  10. 10 9
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/record/HealthDataService.java
  11. 23 0
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/record/OutpatientService.java
  12. 44 6
      patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/record/RegDeptSpeDoctorService.java
  13. 45 5
      patient-co-wlyy/src/main/java/com/yihu/wlyy/util/XMLUtil.java
  14. 7 3
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/record/DrugController.java
  15. 7 4
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/record/HealthDataController.java
  16. 7 4
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/record/HospitalizationController.java
  17. 5 1
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/record/InspectionController.java
  18. 7 1
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/record/OutpatientController.java
  19. 7 3
      patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/record/RegDeptSpeDoctorController.java

+ 4 - 0
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/dao/DoctorDao.java

@ -108,4 +108,8 @@ public interface DoctorDao extends PagingAndSortingRepository<Doctor, Long>, Jpa
    @Query("select p from Doctor p where p.isFamous=1 ")
    Page<Doctor> doctorFamousDoctorList(Pageable pageRequest);
    @Query("select d from Doctor d where d.del = 1 and (d.password is null or password = '' )")
    List<Doctor> findAllNoPasswordDoctors();
}

+ 3 - 0
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/dao/PatientDao.java

@ -50,4 +50,7 @@ public interface PatientDao extends PagingAndSortingRepository<Patient, Long> {
	@Query(" select p from Patient p,SignFamily s where p.code=s.patient and s.status > 0 ")
	List<Patient> findAllSignPatient();
	@Query(" select p from Patient p where password is null or password = ''  ")
	List<Patient> findAllIdCardPatientAndNoPassword();
}

+ 63 - 0
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/data/DataHandingService.java

@ -0,0 +1,63 @@
package com.yihu.wlyy.statistics.data;
import com.yihu.wlyy.statistics.dao.DoctorDao;
import com.yihu.wlyy.statistics.dao.PatientDao;
import com.yihu.wlyy.statistics.model.doctor.Doctor;
import com.yihu.wlyy.statistics.model.patient.Patient;
import com.yihu.wlyy.statistics.util.MD5;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.UUID;
/**
 * Created by Administrator on 2016.10.17.
 */
@Service
public class DataHandingService {
    @Autowired
    private PatientDao patientDao;
    @Autowired
    private DoctorDao doctorDao;
    @Transactional
    public String producePatientAndDoctorPassword() {
        int patientCount=0;
        int patientErrorCount=0;
        int doctorCount=0;
        int doctorErrorCount=0;
        List<Patient> patients= patientDao.findAllIdCardPatientAndNoPassword();
        for (Patient patient:patients){
            String idcard=patient.getIdcard();
            if(!StringUtils.isEmpty(patient.getPassword())||StringUtils.isEmpty(idcard)||(idcard.length()!=15&&idcard.length()!=18)){
                patientErrorCount++;
                continue;
            }
            String password=idcard.substring(idcard.length()-6);
            String salt= UUID.randomUUID().toString().replace("-","");
            patient.setSalt(salt);
            patient.setPassword(MD5.GetMD5Code(password+salt));
            patientCount++;
        }
        patientDao.save(patients);
        List<Doctor> doctors= doctorDao.findAllNoPasswordDoctors();
        for (Doctor doctor:doctors){
            String phone= doctor.getMobile();
            if(!StringUtils.isEmpty(doctor.getPassword())||StringUtils.isEmpty(phone)||phone.length()!=11){
                doctorErrorCount++;
                continue;
            }
            String password=phone.substring(5);
            String salt= UUID.randomUUID().toString().replace("-","");
            doctor.setSalt(salt);
            doctor.setPassword(MD5.GetMD5Code(password+salt));
            doctorCount++;
        }
        doctorDao.save(doctors);
        return "更新患者(默认身份证后六位):"+patientCount+",有身份证异常的患者:"+patientErrorCount+",更新医生(默认电话后六位):"+doctorCount+",有电话号码异常的医生:"+doctorErrorCount;
    }
}

+ 34 - 0
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/data/DataHandlingController.java

@ -0,0 +1,34 @@
package com.yihu.wlyy.statistics.data;
import com.yihu.wlyy.statistics.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
 * Created by Administrator on 2016.10.08.
 * 修改历史数据处理控制器
 */
@Controller
@RequestMapping(value = "/dataHandling", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class DataHandlingController extends BaseController {
    @Autowired
    private DataHandingService dataHandingService;
    /**
     * 生成医生和患者表中有身份的用户的密码
     * @return
     */
    @RequestMapping(value = "producePatientAndDoctorPassword")
    @ResponseBody
    public String producePatientAndDoctorPasswor() {
        try {
            return write(200, dataHandingService.producePatientAndDoctorPassword());
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
}

+ 53 - 47
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/etl/storage/RedisStorage.java

@ -11,6 +11,7 @@ import com.yihu.wlyy.statistics.model.system.City;
import com.yihu.wlyy.statistics.model.system.Town;
import com.yihu.wlyy.statistics.model.team.AdminTeam;
import com.yihu.wlyy.statistics.util.DateUtil;
import org.apache.logging.log4j.message.StringFormattedMessage;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
@ -53,19 +54,19 @@ public class RedisStorage {
    public void saveByLevel1(List<Map<String, List<ETLModel>>> data,List<Map<String, List<ETLModel>>> deleteData, String wlyyQuotaId) throws Exception {
        List<AdminTeam> adminTeams=doctorAdminTeamDao.findAllTeam();
        Map<String, AdminTeam> adminTeamMap = new HashMap<String, AdminTeam>();
        adminTeamMap = new HashMap<String, AdminTeam>();
        for (AdminTeam adminTeam : adminTeams) {
            adminTeamMap.put(adminTeam.getId()+"", adminTeam);
        }
        //查找出系统全部的机构
        List<Hospital> hospitals = hospitalDao.findHospitalzxFWZ();
         Map<String, Hospital> hospitalsMap = new HashMap<String, Hospital>();
        hospitalsMap = new HashMap<String, Hospital>();
        for (Hospital hospital : hospitals) {
            hospitalsMap.put(hospital.getCode(), hospital);
        }
        //查找出厦门市全部的区
        List<Town> towns = townDao.findByCityCode(Constant.city);
        Map<String, Town> townsMap = new HashMap<String, Town>();
        townsMap = new HashMap<String, Town>();
        for (Town town : towns) {
            townsMap.put(town.getCode(), town);
        }
@ -90,14 +91,14 @@ public class RedisStorage {
            //保存全科团队
            saveLevel1Team(wlyyQuotaId,adminTeamMap, adminTeam);
        }else{
            //保存市
            saveLevel1City(wlyyQuotaId, cityMap, cityTeam,deleteData.get(3));
            //保存区
            saveLevel1Town(wlyyQuotaId, townsMap, townTeam,deleteData.get(2));
            //保存机构
            saveLevel1Org(wlyyQuotaId, hospitalsMap, orgTeam,deleteData.get(1));
            //保存全科团队
            saveLevel1Team(wlyyQuotaId,adminTeamMap, adminTeam,deleteData.get(0));
//            //保存市
//            saveLevel1City(wlyyQuotaId, cityMap, cityTeam,deleteData.get(3));
//            //保存区
//            saveLevel1Town(wlyyQuotaId, townsMap, townTeam,deleteData.get(2));
//            //保存机构
//            saveLevel1Org(wlyyQuotaId, hospitalsMap, orgTeam,deleteData.get(1));
//            //保存全科团队
//            saveLevel1Team(wlyyQuotaId,adminTeamMap, adminTeam,deleteData.get(0));
        }
    }
@ -260,8 +261,8 @@ public class RedisStorage {
                    JSONObject jo=new JSONObject();
                    jo.put("date", DateUtil.dateToStrLong(new Date()));
                    jo.put("num", num);
                    jo.put("name", level3);
                    jo.put("code", getLevel3Name(level3,type3));
                    jo.put("name", getLevel3Name(level3,type3));
                    jo.put("code", level3);
                    StringBuffer sb=new StringBuffer("quota:"+wlyyQuotaId+":"+level1+":"+adminTeamObj.getId()+":"+level2+":"+":"+level3+":"+timeKey);
                    keys.add(sb.toString());
@ -369,8 +370,8 @@ public class RedisStorage {
                    JSONObject jo=new JSONObject();
                    jo.put("date", DateUtil.dateToStrLong(new Date()));
                    jo.put("num", num);
                    jo.put("name", level3);
                    jo.put("code", getLevel3Name(level3,type3));
                    jo.put("name", getLevel3Name(level3,type3));
                    jo.put("code", level3);
                    StringBuffer sb=new StringBuffer("quota:"+wlyyQuotaId+":"+level1+":"+":"+hospital.getCode()+":"+level2+":"+level3+":"+timeKey);
                    keys.add(sb.toString());
                    redisTemplate.opsForValue().set(sb.toString(), jo.toString());
@ -515,8 +516,8 @@ public class RedisStorage {
                    //jo.put("code", town.getCode());
                    jo.put("level2code", level2);
                    jo.put("level2name", getLevel2Name(level2,type2));
                    jo.put("name", level3);
                    jo.put("code", getLevel3Name(level3,type3));
                    jo.put("name", getLevel3Name(level3,type3));
                    jo.put("code",level3 );
                    StringBuffer sb=new StringBuffer("quota:"+wlyyQuotaId+":"+level1+":"+town.getCode()+":"+level2+":"+level3+":"+timeKey);
                    keys.add(sb.toString());
                    redisTemplate.opsForValue().set(sb.toString(), jo.toString());
@ -562,8 +563,8 @@ public class RedisStorage {
                    JSONObject jo=new JSONObject();
                    jo.put("date", DateUtil.dateToStrLong(new Date()));
                    jo.put("num", num);
                    jo.put("name", level3);
                    jo.put("code", getLevel3Name(level3,type3));
                    jo.put("name",getLevel3Name(level3,type3));
                    jo.put("code",level3);
                    StringBuffer sb=new StringBuffer("quota:"+wlyyQuotaId+":"+level1+":"+cityObj.getCode()+":"+level2+":"+level3+":"+timeKey);
                    keys.add(sb.toString());
@ -584,19 +585,19 @@ public class RedisStorage {
    private void saveByLevel2Public(List<Map<String, Map<String, List<ETLModel>>>> data,List<Map<String, Map<String, List<ETLModel>>>> deleteData, String wlyyQuotaId, Integer foreachNum, Integer type, Integer start) {
        List<AdminTeam> adminTeams=doctorAdminTeamDao.findAllTeam();
        Map<String, AdminTeam> adminTeamMap = new HashMap<String, AdminTeam>();
        adminTeamMap = new HashMap<String, AdminTeam>();
        for (AdminTeam adminTeam : adminTeams) {
            adminTeamMap.put(adminTeam.getId()+"", adminTeam);
        }
        //查找出系统全部的机构
        List<Hospital> hospitals = hospitalDao.findHospitalzxFWZ();
        Map<String, Hospital> hospitalsMap = new HashMap<String, Hospital>();
        hospitalsMap = new HashMap<String, Hospital>();
        for (Hospital hospital : hospitals) {
            hospitalsMap.put(hospital.getCode(), hospital);
        }
        //查找出厦门市全部的区
        List<Town> towns = townDao.findByCityCode(Constant.city);
        Map<String, Town> townsMap = new HashMap<String, Town>();
         townsMap = new HashMap<String, Town>();
        for (Town town : towns) {
            townsMap.put(town.getCode(), town);
        }
@ -613,14 +614,14 @@ public class RedisStorage {
        Map<String, Map<String, List<ETLModel>>> cityTeam=data.get(3);//市的数据
        if(deleteData!=null){
            //保存市
            saveLevel2City(wlyyQuotaId, cityMap, cityTeam,deleteData.get(3),foreachNum,type,start);
            //保存区
            saveLevel2Town(wlyyQuotaId, townsMap, townTeam,deleteData.get(2),foreachNum,type,start);
            //保存机构
            saveLevel2Org(wlyyQuotaId, hospitalsMap, orgTeam,deleteData.get(1),foreachNum,type,start);
            //保存全科团队
            saveLevel2Team(wlyyQuotaId, adminTeamMap, adminTeam,deleteData.get(0),foreachNum,type,start);
//            //保存市
//            saveLevel2City(wlyyQuotaId, cityMap, cityTeam,deleteData.get(3),foreachNum,type,start);
//            //保存区
//            saveLevel2Town(wlyyQuotaId, townsMap, townTeam,deleteData.get(2),foreachNum,type,start);
//            //保存机构
//            saveLevel2Org(wlyyQuotaId, hospitalsMap, orgTeam,deleteData.get(1),foreachNum,type,start);
//            //保存全科团队
//            saveLevel2Team(wlyyQuotaId, adminTeamMap, adminTeam,deleteData.get(0),foreachNum,type,start);
        }else{
            //保存市
            saveLevel2City(wlyyQuotaId, cityMap, cityTeam,foreachNum,type,start);
@ -681,8 +682,8 @@ public class RedisStorage {
                jo.put("date", DateUtil.dateToStrLong(new Date()));
                jo.put("num", num);
                String key=i+"";
                jo.put("name", key);
                jo.put("code",  Constant.getLevelSexName(key));
                jo.put("name", getLevel2Name(key,type));
                jo.put("code",key);
                StringBuffer sb=new StringBuffer("quota:"+wlyyQuotaId+":1:"+adminTeam.getKey().toString()+":"+key+":"+timeKey);
                keys.add(sb.toString());
@ -730,7 +731,7 @@ public class RedisStorage {
        for(Map.Entry<String,Town> town:townsMap.entrySet()){
            Map<String, List<ETLModel>> oneELTMap= eltModel.get(town.getKey());
            JSONArray level2=new JSONArray();
            for(int i=1;i<=foreachNum;i++){
            for(int i=start;i<=foreachNum;i++){
                JSONObject jo=new JSONObject();
                int num=0;
                if(oneELTMap!=null){
@ -742,13 +743,12 @@ public class RedisStorage {
                jo.put("date", DateUtil.dateToStrLong(new Date()));
                jo.put("num", num);
                String key=i+"";
                jo.put("name", key);
                jo.put("code", Constant.getLevelSexName(key));
                jo.put("name", getLevel2Name(key,type));
                jo.put("code",key);
                StringBuffer sb=new StringBuffer("quota:"+wlyyQuotaId+":3:"+town.getKey()+":"+key+":"+timeKey);
                keys.add(sb.toString());
                redisTemplate.opsForValue().set(sb.toString(), jo.toString());
                level2.put(jo);
            }
@ -776,14 +776,14 @@ public class RedisStorage {
                jo.put("date", DateUtil.dateToStrLong(new Date()));
                jo.put("num", num);
                String key=i+"";
                jo.put("name", key);
                jo.put("code", Constant.getLevelSexName(key));
                jo.put("name", getLevel2Name(key,type));
                jo.put("code",key);
                addJOLeval2(townjr,hospitalObj.getTown(),key,jo);
                level2.put(jo);
                StringBuffer sb=new StringBuffer("quota:"+wlyyQuotaId+":2:"+hospital.getKey().toString()+":"+key+":"+timeKey);
                keys.add(sb.toString());
                redisTemplate.opsForValue().set(sb.toString(), level2.toString());
                redisTemplate.opsForValue().set(sb.toString(), jo.toString());
            }
            StringBuffer sb=new StringBuffer("quota:"+wlyyQuotaId+":2:"+hospital.getKey().toString()+":"+timeKey);
@ -896,7 +896,7 @@ public class RedisStorage {
            jo.put("date", DateUtil.dateToStrLong(new Date()));
            jo.put("num", num);
            jo.put("name", adminTeamObj.getName());
            jo.put("code", adminTeamObj.getId());
            jo.put("code", adminTeamObj.getId()+"");
            String orgKey=adminTeamObj.getOrgCode();
            Hospital hospital=hospitalsMap.get(orgKey);
@ -922,14 +922,12 @@ public class RedisStorage {
            keys.add(key.toString());
            redisTemplate.opsForValue().set(key.toString(), entry.getValue().toString());
        }
        townjr.clear();
        //保存机构下面全部的团队
        for(Map.Entry<String,JSONArray> entry:orgjr.entrySet()){
            key=new StringBuffer("quota:"+wlyyQuotaId+":2:"+entry.getKey()+":1:"+timeKey);
            keys.add(key.toString());
            redisTemplate.opsForValue().set(key.toString(), entry.getValue().toString());
        }
        orgjr.clear();
    }
    private void saveLevel1Team(String wlyyQuotaId, Map<String, AdminTeam> adminTeamMap, Map<String, List<ETLModel>> adminTeam, Map<String, List<ETLModel>> deleteAdminTeam) {
        for(Map.Entry<String,AdminTeam> entry:adminTeamMap.entrySet()){
@ -990,7 +988,6 @@ public class RedisStorage {
            keys.add(key.toString());
            redisTemplate.opsForValue().set(key.toString(), entry.getValue().toString());
        }
        townjr.clear();
    }
    private void addJO(Map<String, JSONArray> townjr,String key, JSONObject jo) {
@ -1111,7 +1108,7 @@ public class RedisStorage {
            jo.put("name", entry.getValue().getName());
            jo.put("code", entry.getValue().getCode());
            jr.put(jo);
            StringBuffer key=new StringBuffer("quota:"+wlyyQuotaId+":"+entry.getKey()+":3:"+timeKey);
            StringBuffer key=new StringBuffer("quota:"+wlyyQuotaId+":3:"+entry.getKey()+":"+timeKey);
            keys.add(key.toString());
            redisTemplate.opsForValue().set(key.toString(), jo.toString());
        }
@ -1121,6 +1118,7 @@ public class RedisStorage {
        redisTemplate.opsForValue().set(key.toString(), jr.toString());
    }
    private void saveLevel1City(String wlyyQuotaId, Map<String, City> cityMap, Map<String, List<ETLModel>> cityTeam, Map<String, List<ETLModel>> deleteCityTeam) {
        JSONArray jr=new JSONArray();
        for(Map.Entry<String,City> entry:cityMap.entrySet()){
            JSONObject jo=new JSONObject();
            Integer num=0;
@ -1138,8 +1136,11 @@ public class RedisStorage {
            jo.put("num", num);
            jo.put("name", entry.getValue().getName());
            jo.put("code", entry.getValue().getCode());
            redisTemplate.opsForValue().set(new StringBuffer("quota:"+wlyyQuotaId+":4:"+entry.getKey()).toString(), jo.toString());
            jr.put(jo);
        }
        StringBuffer key=new StringBuffer("quota:"+wlyyQuotaId+":4:"+Constant.city+":");
        keys.add(key.toString());
        redisTemplate.opsForValue().set(key.toString(), jr.toString());
    }
    private void saveLevel1City(String wlyyQuotaId, Map<String, City> cityMap, Map<String, List<ETLModel>> cityTeam) {
        for(Map.Entry<String,City> entry:cityMap.entrySet()){
@ -1153,10 +1154,11 @@ public class RedisStorage {
            jo.put("num", num);
            jo.put("name", entry.getValue().getName());
            jo.put("code", entry.getValue().getCode());
            StringBuffer key=new StringBuffer("quota:"+wlyyQuotaId+":4:"+entry.getKey()+":"+timeKey);
            StringBuffer key=new StringBuffer("quota:"+wlyyQuotaId+":4:"+Constant.city+":"+timeKey);
            keys.add(key.toString());
            redisTemplate.opsForValue().set(key.toString(), jo.toString());
        }
    }
    private String getLevel2Name(String i, Integer type) {
        switch (type){
@ -1177,6 +1179,10 @@ public class RedisStorage {
                return Constant.getLevelDiseaseName(i);
            }
            case  5:{
                //疾病
                return Constant.getlevelHealthFbName(i);
            }
            case  6:{
                //疾病
                return Constant.getLevelExpenseName(i);
            }

+ 12 - 10
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentDayAllQuotaJob.java

@ -80,7 +80,7 @@ public class CurrentDayAllQuotaJob implements Job {
    private String now = getDayString(-1)+ Constant.quota_date_last;
    private String tomorrow = DateUtil.dateToStrLong(new Date());
    private String tomorrow = getDayString(1);
    private StringBuffer allContent=new StringBuffer();//日志内容
@ -132,11 +132,8 @@ public class CurrentDayAllQuotaJob implements Job {
    //统计
    private void computequota() throws Exception {
        //更新统计时间
        redisTemplate.opsForValue().set("quota:date",DateUtil.dateToStrLong(new Date()));
        //更新时间key
        RedisStorage.timeKey=new Date().getTime()+"";
        redisTemplate.opsForValue().set("quota:timeKey",RedisStorage.timeKey);
        QuartzJobLog quartzJobLog =new QuartzJobLog();
        quartzJobLog.setJobStartTime(new Date());
@ -173,13 +170,18 @@ public class CurrentDayAllQuotaJob implements Job {
            redisTemplate.expire(key, 1, TimeUnit.HOURS);//1小时过期
        }
        RedisStorage.keys.clear();//清空Key
        //更新统计时间
        redisTemplate.opsForValue().set("quota:date",DateUtil.dateToStrLong(new Date()));
        //更新时间key
        redisTemplate.opsForValue().set("quota:timeKey",RedisStorage.timeKey);
    }
    private void computequota_16_1(String sql,List<SignFamily> signFamilies_1,List<SignFamily> deleteSignFamilies) {
        String quotaId="16";
        try{
            sql=" select id,code,idcard,hospital,admin_team_code,expenses_status from wlyy_sign_family a where  a.type =2 and (expenses_status =0 or expenses_status is null) and    a.apply_date< '"+tomorrow+"' ";
            String sqlCount=" select count(id) from wlyy_sign_family a where  a.type =2 and (expenses_status =0 or expenses_status is null)  and  a.apply_date< '"+tomorrow+"' ";
            sql=" select id,code,idcard,hospital,admin_team_code,expenses_status from wlyy_sign_family a where  a.type =2 and (expenses_status !=1 or expenses_status is null) and status in (1,2) and    a.apply_date< '"+tomorrow+"' ";
            String sqlCount=" select count(id) from wlyy_sign_family a where  a.type =2 and (expenses_status !=1 or expenses_status is null) and status in (1,2) and  a.apply_date< '"+tomorrow+"' ";
            List<SignFamily> signFamilies_2= SpringUtil.getBean(DBExtract.class).extractByPage(SignFamily.class,sql,sqlCount,true);
            signFamilies_2.addAll(signFamilies_1);
            //清洗數據
@ -189,7 +191,7 @@ public class CurrentDayAllQuotaJob implements Job {
            //统计数据 二级维度
            List<Map<String, Map<String, List<ETLModel>>>> level2Data= SpringUtil.getBean(Level2Role.class).elt(returnDatas);
            //保存redis
            SpringUtil.getBean(RedisStorage.class).saveByLevel2(level2Data,null,quotaId,2,5,0);
            SpringUtil.getBean(RedisStorage.class).saveByLevel2(level2Data,null,quotaId,2,6,0);
            allContent.append(JsonUtil.objToStr(etlModels.getLogModel()));
        }catch (Exception e){
            e.printStackTrace();
@ -340,7 +342,7 @@ public class CurrentDayAllQuotaJob implements Job {
        String quotaId="2";
        try{
            //找出今天的解约信息
            String sql=" select id,code,idcard,hospital,admin_team_code,expenses_status from wlyy_sign_family a where  a.type =2  and  a.apply_unsign_date< '"+tomorrow+"' and a.expenses_status=1 ";
            String sql=" select id,code,idcard,hospital,admin_team_code,expenses_status from wlyy_sign_family a where  a.type =2 and a.status in(-3,-4) and  a.apply_unsign_date< '"+tomorrow+"' ";
            //抽取數據
            List<SignFamily> signFamilies= SpringUtil.getBean(DBExtract.class).extract(SignFamily.class,sql);
            //清洗數據
@ -491,7 +493,7 @@ public class CurrentDayAllQuotaJob implements Job {
    private void computequota_9() {
        String quotaId="9";
        //找出今天的待签约信息
        String sql=" select id,code,idcard,hospital,admin_team_code from wlyy_sign_family a where  a.type =2   and   a.patient_apply_date< '"+tomorrow+"' and a.expenses_status=1 ";
        String sql=" select id,code,idcard,hospital,admin_team_code from wlyy_sign_family a where   a.type =2  and a.status=0 and  a.patient_apply_date< '"+tomorrow+"'  ";
        try{
            //抽取數據
            List<SignFamily> signFamilies= SpringUtil.getBean(DBExtract.class).extract(SignFamily.class,sql);

+ 64 - 0
patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/util/MD5.java

@ -0,0 +1,64 @@
package com.yihu.wlyy.statistics.util;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
/*
 * MD5 算法
 */
public class MD5 {
	// 全局数组
	private final static String[] strDigits = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };
	public MD5() {
	}
	// 返回形式为数字跟字符串
	private static String byteToArrayString(byte bByte) {
		int iRet = bByte;
		// System.out.println("iRet="+iRet);
		if (iRet < 0) {
			iRet += 256;
		}
		int iD1 = iRet / 16;
		int iD2 = iRet % 16;
		return strDigits[iD1] + strDigits[iD2];
	}
	// 返回形式只为数字
//	private static String byteToNum(byte bByte) {
//		int iRet = bByte;
//		System.out.println("iRet1=" + iRet);
//		if (iRet < 0) {
//			iRet += 256;
//		}
//		return String.valueOf(iRet);
//	}
	// 转换字节数组为16进制字串
	private static String byteToString(byte[] bByte) {
		StringBuffer sBuffer = new StringBuffer();
		for (int i = 0; i < bByte.length; i++) {
			sBuffer.append(byteToArrayString(bByte[i]));
		}
		return sBuffer.toString();
	}
	public static String GetMD5Code(String strObj) {
		String resultString = null;
		try {
			resultString = new String(strObj);
			MessageDigest md = MessageDigest.getInstance("MD5");
			// md.digest() 该函数返回值为存放哈希值结果的byte数组
			resultString = byteToString(md.digest(strObj.getBytes()));
		} catch (NoSuchAlgorithmException ex) {
			ex.printStackTrace();
		}
		return resultString;
	}
	public static void main(String[] args) {
		System.out.println(GetMD5Code("123456abcdefg"));
	}
}

+ 7 - 0
patient-co-wlyy/pom.xml

@ -271,6 +271,13 @@
            <version>1.1</version>
        </dependency>
        <dependency>
            <groupId>com.thoughtworks.xstream</groupId>
            <artifactId>xstream</artifactId>
            <version>1.4.7</version>
        </dependency>
        <!-- LOGGING begin -->
        <dependency>
            <groupId>org.slf4j</groupId>

+ 3 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/record/DrugService.java

@ -58,6 +58,9 @@ public class DrugService extends BaseService {
            if (status == 200){
                String data = responseObject.getString("data");
                if (!StringUtils.isEmpty(data)){
                    if (data.startsWith("error")) {
                        return data;
                    }
                    JSONObject jsonData = new JSONObject(data);
                    JSONArray jsonArray = jsonData.getJSONArray("EhrList");
                    if (!jsonArray.isNull(0) && jsonArray.getJSONObject(0).length() != 0) {

+ 10 - 9
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/record/HealthDataService.java

@ -4,7 +4,6 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.SystemConf;
import com.yihu.wlyy.util.XMLUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
@ -13,9 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * Created by zhenglingfeng on 2016/10/17.
@ -29,7 +26,7 @@ public class HealthDataService extends BaseService {
    /**
     * 获取健康档案信息
     */
    public Map getHealthData(String strSSID, String strEvent, String strCatalog, String strSerial) throws Exception {
    public String getHealthData(String strSSID, String strEvent, String strCatalog, String strSerial) throws Exception {
        String url = SystemConf.getInstance().getSystemProperties().getProperty("sign_check_upload");
        url = url + "/third/smjk/HealthData";
@ -40,16 +37,20 @@ public class HealthDataService extends BaseService {
        params.add(new BasicNameValuePair("strSerial", strSerial));
        String response = HttpClientUtil.post(url, params, "UTF-8");
        Map result = new HashMap<>();
        String result = "";
        if (!StringUtils.isEmpty(response)){
            JSONObject jsonObject = new JSONObject(response);
            int status = jsonObject.getInt("status");
            if (status == 200){
                String xmlData = jsonObject.getString("data");
                if (!StringUtils.isEmpty(xmlData)){
                    String xmlJson = XMLUtil.xml2json(xmlData);
                    result = objectMapper.readValue(xmlJson, Map.class);
                result = jsonObject.getString("data");
                result = result.replaceAll("<\\?xml version=\"1.0\" encoding=\"utf-8\"\\?>","");
                if (result.startsWith("error")) {
                    return result;
                }
//                if (!StringUtils.isEmpty(xmlData)){
//                    String xmlJson = XMLUtil.xml2json(xmlData);
//                    result = objectMapper.readValue(xmlJson, Map.class);
//                }
            }
        }

+ 23 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/record/OutpatientService.java

@ -11,6 +11,7 @@ import com.yihu.wlyy.util.XMLUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.apache.poi.util.StringUtil;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
@ -64,6 +65,9 @@ public class OutpatientService extends BaseService {
            if (status == 200){
                String data = responseObject.getString("data");
                if (!StringUtils.isEmpty(data)){
                    if (data.startsWith("error")) {
                        return data;
                    }
                    JSONObject jsonData = new JSONObject(data);
                    JSONArray jsonArray = jsonData.getJSONArray("EhrList");
                    if (!jsonArray.isNull(0) && jsonArray.getJSONObject(0).length() != 0) {
@ -76,20 +80,39 @@ public class OutpatientService extends BaseService {
                            String key = patientId + eventNo + orgId;
                            JSONObject catalogObject = new JSONObject();
                            String catalogCode = jsonObject.get("CATALOG_CODE").toString();
                            String endTimeNew = jsonObject.get("END_TIME").toString();
                            String catalogValue = systemDictMap.get(catalogCode);
                            jsonObject.remove("CATALOG_CODE");
                            if (jsonObjectMap.containsKey(key)) {
                                jsonObject = jsonObjectMap.get(key);
                                String endTimeOld = jsonObject.get("END_TIME").toString();
                                if (endTimeNew.compareTo(endTimeOld) < 0) {
                                    endTimeNew = endTimeOld;
                                }
                                catalogObject = jsonObject.getJSONObject("CATALOG");
                            }
                            catalogObject.put(catalogCode, catalogValue);
                            jsonObject.put("CATALOG", catalogObject);
                            jsonObject.put("END_TIME", endTimeNew);
                            jsonObjectMap.put(key, jsonObject);
                        }
                        for (String key : jsonObjectMap.keySet()) {
                            resultArray.put(jsonObjectMap.get(key));
                        }
                        JSONObject temp;
                        for (int i = 0; i < resultArray.length(); i++) {
                            for (int j = i+1; j < resultArray.length(); j++) {
                                String endTimeNew = resultArray.getJSONObject(j).get("END_TIME").toString();
                                String endTimeOld = resultArray.getJSONObject(i).get("END_TIME").toString();
                                if (endTimeNew.compareTo(endTimeOld) > 0) {
                                    temp = resultArray.getJSONObject(i);
                                    resultArray.put(i, resultArray.getJSONObject(j));
                                    resultArray.put(j, temp);  // 两个数交换位置
                                }
                            }
                        }
                    }
                }
            }

+ 44 - 6
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/record/RegDeptSpeDoctorService.java

@ -1,6 +1,8 @@
package com.yihu.wlyy.service.app.record;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.system.SystemDictService;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.SystemConf;
import org.apache.commons.lang3.StringUtils;
@ -8,6 +10,7 @@ import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@ -21,6 +24,8 @@ import java.util.Map;
@Service
public class RegDeptSpeDoctorService extends BaseService {
    @Autowired
    SystemDictService systemDictService;
    /**
     * 获取转诊预约医生号源信息
     */
@ -37,20 +42,53 @@ public class RegDeptSpeDoctorService extends BaseService {
        params.add(new BasicNameValuePair("DocCode", DocCode));
        String response = HttpClientUtil.post(url, params, "UTF-8");
        JSONArray result = new JSONArray();
        JSONArray resultArray = new JSONArray();
        List<SystemDict> systemDictList = systemDictService.getDictByDictName("EHR_CATALOG");
        Map<String, String> systemDictMap = new HashMap<>();
        for (SystemDict systemDict : systemDictList) {
            systemDictMap.put(systemDict.getCode(), systemDict.getValue());
        }
        if (!StringUtils.isEmpty(response)){
            JSONObject jsonObject = new JSONObject(response);
            int status = jsonObject.getInt("status");
            JSONObject responseObject = new JSONObject(response);
            int status = responseObject.getInt("status");
            if (status == 200){
                String data = jsonObject.getString("data");
                String data = responseObject.getString("data");
                if (!StringUtils.isEmpty(data)){
                    if (data.startsWith("error")) {
                        return data;
                    }
                    JSONObject jsonData = new JSONObject(data);
                    result = jsonData.getJSONArray("EhrList");
                    JSONArray jsonArray = jsonData.getJSONArray("EhrList");
                    if (!jsonArray.isNull(0) && jsonArray.getJSONObject(0).length() != 0) {
                        Map<String, JSONObject> jsonObjectMap = new HashMap<>();
                        for (int i=0; i<jsonArray.length(); i++) {
                            JSONObject jsonObject = jsonArray.getJSONObject(i);
                            String patientId = jsonObject.getString("XMAN_ID");
                            String eventNo = jsonObject.getString("EVENT");
                            Integer orgId = jsonObject.getInt("ORG_ID");
                            String key = patientId + eventNo + orgId;
                            JSONObject catalogObject = new JSONObject();
                            String catalogCode = jsonObject.get("CATALOG_CODE").toString();
                            String catalogValue = systemDictMap.get(catalogCode);
                            jsonObject.remove("CATALOG_CODE");
                            if (jsonObjectMap.containsKey(key)) {
                                jsonObject = jsonObjectMap.get(key);
                                catalogObject = jsonObject.getJSONObject("CATALOG");
                            }
                            catalogObject.put(catalogCode, catalogValue);
                            jsonObject.put("CATALOG", catalogObject);
                            jsonObjectMap.put(key, jsonObject);
                        }
                        for (String key : jsonObjectMap.keySet()) {
                            resultArray.put(jsonObjectMap.get(key));
                        }
                    }
                }
            }
        }
        return result.toString();
        return resultArray.toString();
    }
}

+ 45 - 5
patient-co-wlyy/src/main/java/com/yihu/wlyy/util/XMLUtil.java

@ -13,6 +13,7 @@ import org.dom4j.*;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.SAXReader;
import org.dom4j.io.XMLWriter;
import org.dom4j.tree.DefaultAttribute;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils;
@ -544,13 +545,13 @@ public class XMLUtil {
        ele2map(map, rootElement);
        System.out.println(map);
        // 到此xml2map完成,下面的代码是将map转成了json用来观察我们的xml2map转换的是否ok
        String string = JSONObject.fromObject(map).toString();
        String string = net.sf.json.JSONObject.fromObject(map).toString();
        System.out.println(string);
        return map;
    }
    private static void ele2map(Map map, Element ele) {
        System.out.println(ele);
    private static void ele2map(Map map, Element ele)  {
        // 获得当前节点的子节点
        List<Element> elements = ele.elements();
        if (elements.size() == 0) {
@ -560,7 +561,13 @@ public class XMLUtil {
            // 只有一个子节点说明不用考虑list的情况,直接继续递归即可
            Map<String, Object> tempMap = new HashMap<String, Object>();
            ele2map(tempMap, elements.get(0));
            map.put(ele.getName(), tempMap);
            //设置标签属性
            setAttributes(tempMap,elements.get(0));
            if (tempMap.size()==1){
                map.put(ele.getName(), ele.getText());
            }else {
                map.put(ele.getName(), tempMap);
            }
        } else {
            // 多个子节点的话就得考虑list的情况了,比如多个子节点有节点名称相同的
            // 构造一个map用来去重
@ -578,19 +585,52 @@ public class XMLUtil {
                    for (Element element : elements2) {
                        Map<String, Object> tempMap1 = new HashMap<String, Object>();
                        ele2map(tempMap1, element);
                        setAttributes(tempMap1,element);
                        list.add(tempMap1);
                    }
                    map.put(string, list);
                } else {
                    // 同名的数量不大于1则直接递归去
                    Map<String, Object> tempMap1 = new HashMap<String, Object>();
                    ele2map(tempMap1, elements2.get(0));
                    map.put(string, tempMap1);
                    setAttributes(tempMap1,elements2.get(0));
                    if (tempMap1.containsKey(string)) {
                        map.put(string, tempMap1.get(string));
                    }else {
                        map.put(string, tempMap1);
                    }
                }
            }
        }
    }
    /**
     *
     * 设置属性值(xml转map)
     * @param map
     * @param element
     */
    public static void setAttributes(Map map,Element element){
        List list = element.attributes();
        Map<String,Object> attrMap = null;
        DefaultAttribute e = null;
        if (!list.isEmpty()) {
            attrMap = new HashMap<>();
            for (int i = 0; i < list.size(); i++) {
                e = (DefaultAttribute) list.get(i);
                attrMap.put(e.getName(),e.getText());
            }
            attrMap.put("text",element.getText());
        }
        if (attrMap!=null && !attrMap.isEmpty()){
            map.put(element.getName(),attrMap);
        }
    }
    public static Map xmltoMap(String xml) {

+ 7 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/record/DrugController.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
@ -17,7 +18,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 * Created by zhenglingfeng on 2016/10/17.
 */
@Controller
@RequestMapping(value = "/doctor/record", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/wlyy_service/record", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端-健康档案用药记录")
public class DrugController extends BaseController {
@ -38,8 +39,11 @@ public class DrugController extends BaseController {
                               @ApiParam(name="endNum",value="需要获取的结束的行数",defaultValue = "10")
                               @RequestParam(value="endNum",required = true) String endNum) {
        try {
            String data = drugService.getDrugsList(strSSID, startNum, endNum);
            return write(200, "获取用药记录成功!", "data", data);
            String result = drugService.getDrugsList(strSSID, startNum, endNum);
            if (result.startsWith("error")) {
                return write(200, result, "data", new JSONArray().toString());
            }
            return write(200, "获取用药记录成功!", "data", result);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "获取用药记录失败!");

+ 7 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/record/HealthDataController.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
@ -19,7 +20,7 @@ import java.util.Map;
 * Created by zhenglingfeng on 2016/10/17.
 */
@Controller
@RequestMapping(value = "/doctor/record", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/wlyy_service/record", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端-健康档案信息")
public class HealthDataController extends BaseController {
@ -43,9 +44,11 @@ public class HealthDataController extends BaseController {
                                @ApiParam(name="strSerial",value="该类别顺序号,默认填1",defaultValue = "1")
                                @RequestParam(value="strSerial",required = true) String strSerial) {
        try {
            Map data = healthDataService.getHealthData(strSSID, strEvent, strCatalog, strSerial);
            return write(200, "获取健康档案信息成功!", "data", data);
            String result = healthDataService.getHealthData(strSSID, strEvent, strCatalog, strSerial);
            if (result.startsWith("error")) {
                return write(200, result, "data", new JSONArray().toString());
            }
            return write(200, "获取健康档案信息成功!", "data", result);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "获取健康档案信息失败!");

+ 7 - 4
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/record/HospitalizationController.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
@ -17,7 +18,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 * Created by zhenglingfeng on 2016/10/17.
 */
@Controller
@RequestMapping(value = "/doctor/record", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/wlyy_service/record", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端-健康档案住院记录")
public class HospitalizationController extends BaseController {
@ -39,9 +40,11 @@ public class HospitalizationController extends BaseController {
                                     @ApiParam(name="endNum",value="需要获取的结束的行数",defaultValue = "10")
                                     @RequestParam(value="endNum",required = true) String endNum) {
        try {
            String data = hospitalizationService.getHospitalizationRecord(strSSID, startNum, endNum);
            return write(200, "获取住院记录成功!", "data", data);
            String result = hospitalizationService.getHospitalizationRecord(strSSID, startNum, endNum);
            if (result.startsWith("error")) {
                return write(200, result, "data", new JSONArray().toString());
            }
            return write(200, "获取住院记录成功!", "data", result);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "获取住院记录失败!");

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

@ -5,6 +5,7 @@ import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
@ -20,7 +21,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 * Created at 2016/10/17.
 */
@Controller
@RequestMapping(value = "/doctor/patient_inspection", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/wlyy_service/patient_inspection", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端- 居民检查/检验记录")
public class InspectionController extends BaseController {
@ -40,6 +41,9 @@ public class InspectionController extends BaseController {
        try {
            //TODO 检查/检验报告接口
            String result = inspectionService.getInspectionAndChecking(strSSID, startNum, endNum);
            if (result.startsWith("error")) {
                return write(200, result, "data", new JSONArray().toString());
            }
            return write(200, "获取检查/检验记录成功!", "data", result);
        } catch (Exception e) {
            error(e);

+ 7 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/record/OutpatientController.java

@ -5,6 +5,9 @@ import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.util.StringUtil;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
@ -16,7 +19,7 @@ import java.util.Map;
 * Created by zhenglingfeng on 2016/10/17.
 */
@Controller
@RequestMapping(value = "/doctor/record", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/wlyy_service/record", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端-健康档案门/急诊记录")
public class OutpatientController extends BaseController {
@ -38,6 +41,9 @@ public class OutpatientController extends BaseController {
                      @RequestParam(value="endNum",required = true) String endNum) {
        try {
            String result = outpatientService.getOutpatientRecord(strSSID, startNum, endNum);
            if (result.startsWith("error")) {
                return write(200, result, "data", new JSONArray().toString());
            }
            return write(200, "获取门/急诊数据成功!", "data", result);
        } catch (Exception e) {
            error(e);

+ 7 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/record/RegDeptSpeDoctorController.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
@ -17,7 +18,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 * Created by zhenglingfeng on 2016/10/17.
 */
@Controller
@RequestMapping(value = "/doctor/record", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/wlyy_service/record", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(description = "医生端-获取转诊预约医生号源信息")
public class RegDeptSpeDoctorController extends BaseController {
@ -42,8 +43,11 @@ public class RegDeptSpeDoctorController extends BaseController {
                                                 @ApiParam(name="DocCode",value="医生编码",defaultValue = "80772")
                                                 @RequestParam(value="DocCode",required = true) String DocCode) {
        try {
            String data = regDeptSpeDoctorService.getRegDeptSpeDoctorSectionList(OrgCode, DeptCode, strStart, strEnd, DocCode);
            return write(200, "获取转诊预约医生号源信息成功!", "data", data);
            String result = regDeptSpeDoctorService.getRegDeptSpeDoctorSectionList(OrgCode, DeptCode, strStart, strEnd, DocCode);
            if (result.startsWith("error")) {
                return write(200, result, "data", new JSONArray().toString());
            }
            return write(200, "获取转诊预约医生号源信息成功!", "data", result);
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "获取转诊预约医生号源信息失败!");