Просмотр исходного кода

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

chenweida 7 лет назад
Родитель
Сommit
4106bd7a27

+ 24 - 13
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandingService.java

@ -11,6 +11,7 @@ import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.manage.UserDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.PatientDeviceDao;
import com.yihu.wlyy.service.app.concern.ConcernService;
import com.yihu.wlyy.util.Base64Utils;
import com.yihu.wlyy.util.ElasticsearchUtil;
import com.yihu.wlyy.util.LatitudeUtils;
@ -50,6 +51,8 @@ public class DataHandingService {
    private PatientDeviceDao patientDeviceDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private ConcernService concernService;
    @Transactional
    public String producePatientAndDoctorPassword() {
@ -183,14 +186,14 @@ public class DataHandingService {
    public JSONArray getAllDeviceData() {
        JSONArray ja = new JSONArray();
        List<Map<String, Object>> returnData = elasticsearchUtil.excuteDataModel("SELECT location,idCard FROM wlyy_patient_device");
        returnData.stream().forEach(one->{
            net.sf.json.JSONObject jo=new net.sf.json.JSONObject();
            jo.put("idcard",one.get("idCard"));
        returnData.stream().forEach(one -> {
            net.sf.json.JSONObject jo = new net.sf.json.JSONObject();
            jo.put("idcard", one.get("idCard"));
            net.sf.json.JSONObject locatio=new net.sf.json.JSONObject();
            locatio.put("lat",one.get("location.lat")); //纬度 -90 ~~ 90
            locatio.put("lon",one.get("location.lon")); //经度 -180 ~~ 180
            jo.put("location",locatio);
            net.sf.json.JSONObject locatio = new net.sf.json.JSONObject();
            locatio.put("lat", one.get("location.lat")); //纬度 -90 ~~ 90
            locatio.put("lon", one.get("location.lon")); //经度 -180 ~~ 180
            jo.put("location", locatio);
            ja.add(jo);
@ -199,7 +202,7 @@ public class DataHandingService {
    }
    //原有CA的密码没有加密,清洗成加密密码
    public boolean updateCAPassword(){
    public boolean updateCAPassword() {
        boolean flag = true;
        try {
            String sql = " select * from wlyy_doctor where check_password is not null and check_password <> ''";
@ -215,19 +218,27 @@ public class DataHandingService {
//            });
            List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
            List<Doctor> result = new ArrayList<>();
            list.stream().forEach(one->{
                Doctor d = doctorDao.findByCode(one.get("code")!=null?one.get("code").toString():"");
                if(d!=null){
            list.stream().forEach(one -> {
                Doctor d = doctorDao.findByCode(one.get("code") != null ? one.get("code").toString() : "");
                if (d != null) {
                    d.setCheckPassword(Base64Utils.encryptBASE64(d.getCheckPassword()));
                    result.add(d);
                }
            });
            doctorDao.save(result);
        }catch (Exception e){
        } catch (Exception e) {
            e.printStackTrace();
            flag = false;
        }
        return  flag;
        return flag;
    }
    @Transactional
    public void addConcerns(String doctorCode, String[] patients) {
        Random rand = new Random();
        for (String patient : patients) {
            concernService.addConcern(patient, doctorCode, rand.nextInt(3)+1);
        }
    }
}

+ 19 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandlingController.java

@ -268,7 +268,8 @@ public class DataHandlingController extends BaseController {
    @RequestMapping(value = "/updateCAPassword", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("CA密码加密")
    public String updateCAPassword() {
    public String updateCAPassword(
    ) {
        boolean flag = dataHandingService.updateCAPassword();
        if (flag) {
            return write(200, "清洗数据成功!");
@ -276,4 +277,21 @@ public class DataHandlingController extends BaseController {
            return write(0, "清洗数据失败!");
        }
    }
    @RequestMapping(value = "/addConcerns", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("给某个医生添加关注信息")
    public String addConcerns(
            @ApiParam(name = "doctorCode", value = "医生code", required = true)
            @RequestParam(value = "doctorCode") String doctorCode,
            @ApiParam(name = "patients", value = "患者code", required = true)
            @RequestParam(value = "patients") String patients) {
        try{
            String [] patient=patients.split(",");
            dataHandingService.addConcerns(doctorCode,patient);
            return write(200, "添加数据成功!");
        }catch (Exception e){
            return write(0, "添加数据失败!");
        }
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/concern/DoctorConcernController.java

@ -50,7 +50,7 @@ public class DoctorConcernController extends BaseController {
                jsonObject.put("photo", patient.getPhoto());
                jsonObject.put("sex", patient.getSex());
                jsonObject.put("age", IdCardUtil.getAgeForIdcard(patient.getIdcard()));
                jsonObject.put("isWX", StringUtils.isEmpty(patient.getOpenid()) ? "false" : "true");
                jsonObject.put("isWX", StringUtils.isEmpty(patient.getOpenid()) ? false : true);
                jsonObject.put("concernTime", DateUtil.dateToStr(patient.getConcernCreateTime(), "yyyy-MM-dd HH:mm:ss"));

+ 3 - 3
patient-co/patient-co-wlyy/src/main/resources/application-dev.yml

@ -129,8 +129,8 @@ es:
#集美宣教居民端健康文章
jkEdu:
  web:
    #articleBaseUrl: http://172.19.103.87:9088/
    articleBaseUrl: http://192.168.131.131:8088/
    articleBaseUrl: http://172.19.103.87:9088/
    #articleBaseUrl: http://192.168.131.131:8088/
#消息队列
activemq:
  username: admin
@ -141,7 +141,7 @@ activemq:
##如果是外网项目就是flase 内网是true
neiwang:
  enable: false
  enable: true
  #wlyy: http://59.61.92.90:8072/wlyy
  wlyy: http://192.168.131.131:8080/