Browse Source

代码修改

liubing 3 năm trước cách đây
mục cha
commit
df9abf65b2

+ 9 - 0
common/common-rest-model/src/main/java/com/yihu/jw/restmodel/emergency/EmergencyOrderVO.java

@ -53,6 +53,7 @@ public class EmergencyOrderVO {
    private List<BaseEmergencyWarnLogDO> orderLogInfo;
    private List<PatientSosContactsDO> sosContacts;//紧急联系人
    private List<Map<String,Object>> securityDevices;//安防设备列表
    private String overTimeNotResponse;
    public String getId() {
        return id;
@ -285,4 +286,12 @@ public class EmergencyOrderVO {
    public void setSecurityDevices(List<Map<String, Object>> securityDevices) {
        this.securityDevices = securityDevices;
    }
    public String getOverTimeNotResponse() {
        return overTimeNotResponse;
    }
    public void setOverTimeNotResponse(String overTimeNotResponse) {
        this.overTimeNotResponse = overTimeNotResponse;
    }
}

+ 30 - 0
common/common-util/src/main/java/com/yihu/jw/util/date/DateUtil.java

@ -1427,6 +1427,36 @@ public class DateUtil {
        return result.toString();
    }
    /**
     *  返回 两个时间间隔天数/小时数
     * @param date1 当前时间
     * @param date2 过去时间
     * @return
     */
    public static String getDifferentTimeInfo1(Date date1, Date date2){
        if (date1 == null || date2 == null){
            return null;
        }
        String result = null;
        long millisecondsDiff = date1.getTime() - date2.getTime();
        long secondsDiff = millisecondsDiff / TimeUnit.SECONDS.toMillis(1L);
        long minutesDiff = millisecondsDiff / TimeUnit.MINUTES.toMillis(1L);
        long hoursDiff = millisecondsDiff / TimeUnit.HOURS.toMillis(1L);
        long daysDiff = millisecondsDiff / TimeUnit.DAYS.toMillis(1L);
        long hourFieldDiff = hoursDiff - TimeUnit.DAYS.toHours(daysDiff);
        long minuteFieldDiff = minutesDiff - TimeUnit.HOURS.toMinutes(hoursDiff);
        long secondFieldDiff = secondsDiff - TimeUnit.MINUTES.toSeconds(minutesDiff);
        if (daysDiff > 0L) {
            result = (String.format("%d天", daysDiff));
            return result.toString();
        }
        else if (hourFieldDiff > 0L) {
            result=String.format("%d小时", hourFieldDiff);
        }
        return result;
    }
    /**
     * 1970年1月1日来的 秒转化成时间
     * @param seconds

+ 3 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/sign/SignEndpoint.java

@ -520,6 +520,8 @@ public class SignEndpoint extends EnvelopRestEndpoint {
    public PageEnvelop<List<Map<String,Object>>> archiveList (
            @ApiParam(name = "doctorId", value = "医生id", required = false)
            @RequestParam(value = "doctorId",required = false) String doctorId,
            @ApiParam(name = "userRole", value = "管理员权限,没有传空", required = false)
            @RequestParam(value = "userRole",defaultValue = "0",required = false) String userRole,
            @ApiParam(name = "signStatus", value = "签约状态", required = false)
            @RequestParam(value = "signStatus",required = false) Integer signStatus,
            @ApiParam(name = "name", value = "居民姓名", required = false)
@ -532,7 +534,7 @@ public class SignEndpoint extends EnvelopRestEndpoint {
            if (StringUtils.isBlank(doctorId)&&StringUtils.isBlank(name)){
                return PageEnvelop.getError("请求参数错误");
            }
            return archiveService.archiveList(doctorId,page,size,signStatus,name);
            return archiveService.archiveList(doctorId,userRole,page,size,signStatus,name);
        }catch (Exception e){
            return failedPageEnvelopException2(e);
        }

+ 3 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/assistance/EmergencyAssistanceService.java

@ -350,6 +350,9 @@ public class EmergencyAssistanceService extends BaseJpaService<EmergencyAssistan
        List<BaseEmergencyWarnLogDO> logDOS = logDao.findByOrderIdOrderByCreateTimeDesc(assistanceDO.getId());
        for (BaseEmergencyWarnLogDO tmp:logDOS){
            tmp.setTimeInfo(DateUtil.getDifferentTimeInfo(new Date(),tmp.getCreateTime(),0));
        }
        if (logDOS.size()==0&&1==emergencyOrderVO.getStatus()){//未响应
        }
        emergencyOrderVO.setOrderLogInfo(logDOS);
        List<PatientSosContactsDO> contactsDOS = contactsService.getPatientSosContacts(assistanceDO.getPatient());

+ 3 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/contacts/ContactsService.java

@ -303,9 +303,7 @@ public class ContactsService {
        JSONObject result = new JSONObject();
        List<PatientSosContactsDO> list = sosContactsDao.findByPatientOrderByUpdateTimeDesc(patient);
        JSONArray jsonArray = JSONArray.parseArray(jsonStr);
        if (0==isUpdate){
            sosContactsDao.updateByPatient("updateByPatient");
        }else {
        if (1==isUpdate){//新增联系人
            for (int i=0;i<jsonArray.size();i++){
                list = sosContactsDao.findByPatientAndDel(patient,1);
                JSONObject obj = jsonArray.getJSONObject(i);
@ -329,6 +327,7 @@ public class ContactsService {
                    contactsDO = new PatientSosContactsDO();
                    contactsDO.setPhoneSeqid(1==seqid?2:1);
                }
                contactsDO.setErrorInfo(null);
                contactsDO.setUpdateInfo(null);
                contactsDO.setDel(1);
                contactsDO.setPatient(patient);
@ -337,9 +336,9 @@ public class ContactsService {
                contactsDO.setRelation(Integer.parseInt(relation));
                contactsDO.setSuccessFlag(0);
                sosContactsDao.save(contactsDO);
            }
        }
        sosContactsDao.updateByPatient(patient);//改为待同步状态
        result.put(ResponseContant.resultFlag,ResponseContant.success);
        result.put(ResponseContant.resultMsg,"修改成功");
        return result;

+ 6 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/ArchiveService.java

@ -80,13 +80,17 @@ public class ArchiveService extends BaseJpaService<ArchiveDO, ArchiveDao> {
        return json;
    }
    public PageEnvelop<List<Map<String,Object>>> archiveList(String doctorId, int page, int size,Integer signStatus,String name){
    public PageEnvelop<List<Map<String,Object>>> archiveList(String doctorId,String admin, int page, int size,Integer signStatus,String name){
        String sql = " select * from ( SELECT a.create_time,p.openid,p.pad_imei padImei,p.idcard,p.mobile,p.name,p.sex,p.id,p.photo,CAST(a.sign_status AS char) sign_status ";
        String countSql = "SELECT count(*) from ( ";
        String filters = "from wlyy_archive a,base_patient p " +
                "WHERE  a.patient = p.id ";
        if(StringUtils.isNotBlank(doctorId)){
        if (StringUtils.isNotBlank(admin)){//管理员展示所有档案
        }
        else if(StringUtils.isNotBlank(doctorId)){
            filters += " and a.doctor_code = '"+doctorId+"'";
        }
        if(signStatus!=null){