Parcourir la source

完成居民健康管理服务平台的设备统计报表导出字段修改

humingfen il y a 7 ans
Parent
commit
b542b75bd9

+ 3 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/device/DeviceHealthIndexController.java

@ -112,7 +112,7 @@ public class DeviceHealthIndexController extends BaseController{
    
    public void addHeader(WritableSheet ws) throws WriteException {
        
        String[] header = {"居民姓名","手机号","身份证","设备码","设备名称","签约医生", "地址"};
        String[] header = {"居民姓名","手机号","身份证","设备码","设备名称","签约医生", "地址", "更新日期", "总记录数"};
        int i = 0;
        for (String h : header) {
            addCell(ws, 0, i, h);//表名,行,列,header
@ -144,6 +144,8 @@ public class DeviceHealthIndexController extends BaseController{
                addCell(ws, i, 4, m.getDevice_name(),"");
                addCell(ws, i, 5, m.getDoctor_name(),"");
                addCell(ws, i, 6, m.getAddress(),"");
                addCell(ws, i, 7, m.getRecord_date(),"");
                addCell(ws, i, 8, m.getAmount(),"");
                i++;
            }
            wwb.write();

+ 10 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/device/entity/DeviceHealthIndexExportVO.java

@ -15,7 +15,8 @@ public class DeviceHealthIndexExportVO {
	private String statusName;
	private String doctor_name;
	private String address;
	
	private String amount;
	public String getPatient() {
		return patient;
	}
@ -95,4 +96,12 @@ public class DeviceHealthIndexExportVO {
	public void setDevice_name(String device_name) {
		this.device_name = device_name;
	}
	public String getAmount() {
		return amount;
	}
	public void setAmount(String amount) {
		this.amount = amount;
	}
}

+ 35 - 5
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/DeviceHealthIndexService.java

@ -17,9 +17,11 @@ import com.yihu.wlyy.util.SystemConf;
import com.yihu.wlyy.util.query.BaseDeviceJpaService;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.*;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -27,7 +29,6 @@ import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.*;
/**
@ -291,7 +292,7 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
       return patientDao.findByCode(patientCode);
    }
	
	public List<DeviceHealthIndexExportVO> exportDeviceHealthIndexList(String town, String hospital) {
	/*public List<DeviceHealthIndexExportVO> exportDeviceHealthIndexList(String town, String hospital) {
        List<DeviceHealthIndexExportVO> list = new ArrayList<>();
        String sql  = "SELECT " +
                "s.patient," +
@ -306,7 +307,36 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
                "SELECT `user`,device_sn,type,max(record_date) record_date FROM device.wlyy_patient_health_index WHERE device_sn IS NOT NULL AND del=1 GROUP BY `user`,device_sn,type) d WHERE s.patient=d.`user` AND s.hospital='"+hospital+"' AND s.`status`> 0) ORDER BY patient";
        list =  jdbcTemplate.query(sql,new BeanPropertyRowMapper(DeviceHealthIndexExportVO.class));
        return list ;
	}
	}*/
    /**
     * 导出体征上传明细
     * @param town
     * @param hospital
     * @return
     */
    public List<DeviceHealthIndexExportVO> exportDeviceHealthIndexList(String town, String hospital) {
        List<DeviceHealthIndexExportVO> list = new ArrayList<>();
        String sql  = "SELECT " +
                "s.patient," +
                "s.`name`," +
                "s.mobile," +
                "s.idcard," +
                "d.device_sn," +
                "d.device_name," +
                "d.record_date," +
                "d.amount,"+
                "CASE d.type WHEN 1 THEN '血糖' WHEN 2 THEN '血压' WHEN 3 THEN '体重' WHEN 4 THEN '腰围' END statusName,"+
                "s.doctor_name," +
                "p.address FROM wlyy_sign_family s,wlyy_patient p,(" +
                "SELECT i.`user`,i.device_sn, i.type, max(i.record_date) record_date, count(i.id) amount, w.device_name " +
                "FROM device.wlyy_patient_health_index i,wlyy_patient_device w "+
                "WHERE i.device_sn = w.device_sn AND i.del=1 GROUP BY i.`user`,i.device_sn,i.type) d "+
                "WHERE s.patient = d.`user` AND s.hospital='"+hospital+"' AND s.`status`> 0 AND s.patient=p.code AND d.`type` in (1,2) ORDER BY d.record_date desc ";
        list =  jdbcTemplate.query(sql,new BeanPropertyRowMapper(DeviceHealthIndexExportVO.class));
        return list ;
    }
    public JSONObject gethealthStandard(Integer type, String patientCode) {
        //血糖校验

+ 0 - 3
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/third/jw/JwPatientMedicareNumberService.java

@ -12,7 +12,6 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
/**
@ -40,8 +39,6 @@ public class JwPatientMedicareNumberService {
        for(String hospital : hospitals) {
            List<String> idcards = signFamilyDao.findIdcardByStatus(hospital);
            String url = jwUrl + "/third/zysoftservice/getSickCurrnetFamilySignInfo";
            //医疗保险号的居民集合
            HashMap<String, String> idcard_medicare_number_map = new HashMap<>();
            for (String idcard : idcards) {
                List<NameValuePair> params = new ArrayList<>();
                params.add(new BasicNameValuePair("idcard", idcard));