Parcourir la source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

Shi Kejing il y a 4 ans
Parent
commit
c4f474c6fb

+ 4 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/patient/PatientEndpoint.java

@ -84,9 +84,11 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
    @ApiOperation(value = "获取居民信息")
    public Envelop getPatientById(
            @ApiParam(name = "id", value = "居民id")
            @RequestParam(value = "id", required = true) String id) {
            @RequestParam(value = "id", required = true) String id,
            @ApiParam(name = "isCapacity", value = "是否返回能力评估,1返回其他值不返回,默认不返回", required = false)
            @RequestParam(value = "isCapacity", required = false) String isCapacity) {
        try{
            return success("获取成功",patientService.findPatientById(id));
            return success("获取成功",patientService.findPatientById(id,isCapacity));
        }catch (Exception e){
            e.printStackTrace();
            return failed("获取失败",-1);

+ 13 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/patient/CarePatientService.java

@ -5,11 +5,13 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.dao.label.WlyyPatientLabelDao;
import com.yihu.jw.care.service.common.DictService;
import com.yihu.jw.care.service.sign.CapacityAssessmentRecordService;
import com.yihu.jw.care.service.sign.ServicePackageService;
import com.yihu.jw.care.util.ConstantUtil;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.servicePackage.ServicePackageSignRecordDO;
import com.yihu.jw.entity.care.label.WlyyPatientLabelDO;
import com.yihu.jw.entity.care.sign.CapacityAssessmentRecordDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.service.BasePatientMedicardCardService;
import com.yihu.jw.restmodel.web.PageEnvelop;
@ -17,7 +19,6 @@ import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.security.MD5;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.stereotype.Service;
@ -54,6 +55,8 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
    private WlyyPatientLabelDao patientLabelDao;
    @Autowired
    private DictService dictService;
    @Autowired
    private CapacityAssessmentRecordService capacityAssessmentRecordService;
    /**
     * 签约记录
@ -97,7 +100,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
     * @param patientId
     * @return
     */
    public JSONObject findPatientById(String patientId) throws Exception{
    public JSONObject findPatientById(String patientId,String isCapacity) throws Exception{
        JSONObject res = new JSONObject();
        BasePatientDO patientDO = patientDao.findById(patientId);
        patientDO.setArchiveStatusName(dictService.fingByNameAndCode(ConstantUtil.DICT_ARCHIVESTATUS,String.valueOf(patientDO.getArchiveStatus())));
@ -120,7 +123,15 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
            signRecordDO.setHelperList(helperList);
            signRecordDO.setPackageList(packageList);
            res.put("signRecordDO",signRecordDO);
            if("1".equals(isCapacity)){
                //能力评估
                CapacityAssessmentRecordDO recordDO = capacityAssessmentRecordService.findAssessmentByPatientId(patientId);
                res.put("capAssRecordDO",recordDO);
            }
        }
        return res;
    }

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

@ -82,7 +82,9 @@ public class CapacityAssessmentRecordService extends BaseJpaService<CapacityAsse
     * @return
     */
    public CapacityAssessmentRecordDO findAssessmentByPatientId(String patient)  {
        return capacityAssessmentRecordDao.findByPatient(patient);
        CapacityAssessmentRecordDO recordDO = capacityAssessmentRecordDao.findByPatient(patient);
        recordDO.setLevelConclusionName(dictService.fingByNameAndCode(ConstantUtil.DICT_LEVEL_CONCLUSION,String.valueOf(recordDO.getLevelConclusion())));
        return recordDO;
    }
    /**

+ 10 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/analyzer/WlyyIotTzDict.java

@ -19,6 +19,8 @@ public class WlyyIotTzDict extends UuidIdentityEntity implements Serializable {
    private Integer del;
    private String value;
    public String getCode() {
        return code;
    }
@ -42,4 +44,12 @@ public class WlyyIotTzDict extends UuidIdentityEntity implements Serializable {
    public void setDel(Integer del) {
        this.del = del;
    }
    public String getValue() {
        return value;
    }
    public void setValue(String value) {
        this.value = value;
    }
}

+ 2 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/analyzer/WlyyIotTzDictDao.java

@ -7,4 +7,6 @@ import java.util.List;
public interface WlyyIotTzDictDao extends PagingAndSortingRepository<WlyyIotTzDict, String>, JpaSpecificationExecutor<WlyyIotTzDict>  {
    WlyyIotTzDict findByCodeAndDel(String code,Integer del);
}

+ 10 - 2
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -5,6 +5,8 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.iot.dao.dict.IotSystemDictDao;
import com.yihu.iot.dao.equipment.IotEquipmentDetailDao;
import com.yihu.iot.service.analyzer.WlyyIotTzDict;
import com.yihu.iot.service.analyzer.WlyyIotTzDictDao;
import com.yihu.iot.service.common.MyJdbcTemplate;
import com.yihu.iot.service.device.IotPatientDeviceService;
import com.yihu.iot.service.equipment.IotEqtDetailService;
@ -75,6 +77,8 @@ public class MonitorPlatformService  {
    private IotInterfaceLogService iotInterfaceLogService;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private WlyyIotTzDictDao wlyyIotTzDictDao;
    /**
     * 获取位置信息
@ -1208,6 +1212,8 @@ public class MonitorPlatformService  {
     */
    public JSONObject getEquipmentStatistics(String deviceType,String deviceName,String showLevel){
        try {
            WlyyIotTzDict dictObj =wlyyIotTzDictDao.findByCodeAndDel("IOT_LOST_DAY",1);
            String lost_day = dictObj.getValue();
            JSONObject result = new JSONObject();
            JSONArray arrTmp = new JSONArray();
            result.put("deviceInfo",arrTmp);
@ -1301,7 +1307,7 @@ public class MonitorPlatformService  {
                //失联设备(一周未上传当作失联)
                sql.append("and d.device_sn not in (select device_sn from ( select device_sn,MAX(record_date) record_date from device.wlyy_patient_health_index where device_sn<>'' GROUP BY device_sn)a ");
                sql.append("where TIMESTAMPDIFF(DAY,record_date,NOW()) <= 30)");
                sql.append("where TIMESTAMPDIFF(DAY,record_date,NOW()) <= "+lost_day+")");
                Integer lostContact = jdbcTemplate.queryForObject(sql.toString(),Integer.class);
                result.put("lostContact",lostContact);
            }
@ -1371,6 +1377,8 @@ public class MonitorPlatformService  {
     */
    public JSONObject iotAndLostRange(String startTime,String endTime,
                                      String deviceType,String area,String hospital,String quotaCode){
        WlyyIotTzDict dictObj =wlyyIotTzDictDao.findByCodeAndDel("IOT_LOST_DAY",1);
        String lost_day = dictObj.getValue();
        JSONObject result = new JSONObject();
        StringBuffer sql = new StringBuffer("select count(*) from wlyy.wlyy_patient_device d ,wlyy.wlyy_sign_family f WHERE f.`status`>0 and d.del=0 and f.patient = d.`user`  ");
        StringBuffer sqlCondition = new StringBuffer(" ");
@ -1424,7 +1432,7 @@ public class MonitorPlatformService  {
                sqlCondition.append("and record_date >='"+startTime+" 00:00:00' and record_date<='"+endTime+" 23:59:59'  ");
            }
            else{
                sqlCondition.append("and  TIMESTAMPDIFF(DAY,record_date,NOW()) <= 30  ");
                sqlCondition.append("and  TIMESTAMPDIFF(DAY,record_date,NOW()) <= "+lost_day+"  ");
            }
            sqlCondition.append(")");
            sql.append(sqlCondition);