Bladeren bron

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

LiTaohong 7 jaren geleden
bovenliggende
commit
f974ea9967

+ 56 - 3
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/datastatic/HealthEduController.java

@ -2,10 +2,16 @@ package com.yihu.wlyy.controller.manager.datastatic;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.entity.SignFamily;
import com.yihu.wlyy.entity.es.HealthEduPatientCode;
import com.yihu.wlyy.entity.organization.HospitalMapping;
import com.yihu.wlyy.repository.organization.HospitalMappingDao;
import com.yihu.wlyy.service.healthedu.HealthEduService;
import com.yihu.wlyy.service.manager.sign.FamilyContractService;
import com.yihu.wlyy.util.ElasticsearchUtil;
import jxl.Workbook;
import jxl.write.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@ -14,7 +20,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
import java.util.*;
/**
 * 健康教育推送报表导出
@ -28,6 +34,17 @@ public class HealthEduController extends BaseController {
	@Autowired
	private HealthEduService healthEduService;
	
	@Value("${es.type.HealthEduArticlePatient}")
	private String esType;
	@Value("${es.index.HealthEduArticlePatient}")
	private String esIndex;
	@Autowired
	private ElasticsearchUtil elasticsearchUtil;
	@Autowired
	private FamilyContractService familyContractService;
	@Autowired
	private HospitalMappingDao hospitalMappingDao;
	
	//页面跳转(主页面)
	@RequestMapping(value = "initial")
	public String listInit() {
@ -41,11 +58,47 @@ public class HealthEduController extends BaseController {
			@RequestParam(value = "endDate",required = false)String endDate,
			HttpServletResponse response){
		try {
			List<SignFamily> datalist = healthEduService.getPatientPushList(beginDate,endDate);
			
			List<SignFamily> signFamilies = new ArrayList<>();
			
			Map<String,String> orgcodemap = new HashMap<>();
			
			Set<String> patientcodesets = new HashSet<>();
			
			String sql = "SELECT patientCode FROM "+esType+" where createTime >='"+beginDate+"T00:00:00+0800' and createTime <='"+endDate+"T23:59:59+0800'  group by patientCode limit 0,1000000";
			
			List<HealthEduPatientCode> patientCodes = elasticsearchUtil.excute(sql, HealthEduPatientCode.class, esIndex, esType);
			
			for (HealthEduPatientCode es: patientCodes) {
				System.out.println(patientcodesets.size());
				if(patientcodesets.contains(es.getPatientCode())){
					continue;
				}else{
					patientcodesets.add(es.getPatientCode());
				}
				SignFamily obj = familyContractService.findSignByPatient(es.getPatientCode());
				if( obj == null){
					continue;
				}
				String jworgcode = "";
				if(orgcodemap.isEmpty() || !orgcodemap.keySet().contains(obj.getHospital())){
					HospitalMapping hospitalMapping =  hospitalMappingDao.findByCode(obj.getHospital());
					if(hospitalMapping == null){
						continue;
					}
					jworgcode = hospitalMapping.getMappingCode();
					orgcodemap.put(obj.getHospital(),jworgcode);
				}else{
					jworgcode = orgcodemap.get(obj.getHospital());
				}
				obj.setHospital(jworgcode);
				signFamilies.add(obj);
			}
			
			response.setContentType("octets/stream");
			response.setHeader("Content-Disposition", "attachment; filename="+ new String( "pushDataList.xls"));
			OutputStream os = response.getOutputStream();
			this.pushListWrite(os,datalist);
			this.pushListWrite(os,signFamilies);
		}catch (Exception ex){
			error(ex);
		}

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

@ -41,10 +41,10 @@ public class DeviceHealthIndexController extends BaseController{
            @RequestParam(value = "idcard",required = false) String idcard,
            @RequestParam(value = "userName",required = false) String userName,
            @RequestParam(value = "indexType",required = false) String indexType,
            @RequestParam(value = "indexTypeMin1",required = false) Integer indexTypeMin1,
            @RequestParam(value = "indexTypeMax1",required = false) Integer indexTypeMax1,
            @RequestParam(value = "indexTypeMin2",required = false) Integer indexTypeMin2,
            @RequestParam(value = "indexTypeMax2",required = false) Integer indexTypeMax2,
            @RequestParam(value = "indexTypeMin1",required = false) Double indexTypeMin1,
            @RequestParam(value = "indexTypeMax1",required = false) Double indexTypeMax1,
            @RequestParam(value = "indexTypeMin2",required = false) Double indexTypeMin2,
            @RequestParam(value = "indexTypeMax2",required = false) Double indexTypeMax2,
            @RequestParam(value = "doctorName",required = false) String doctorName,
            @RequestParam(value = "page",required = false) Integer page,
            @RequestParam(value = "rows",required = false) Integer pageSize){
@ -87,7 +87,7 @@ public class DeviceHealthIndexController extends BaseController{
     */
//    @ResponseBody
    @RequestMapping(value="getExcelByFilter",method = RequestMethod.POST,produces = "application/json;charset=UTF-8" )
    public  String exportList(
    public void exportList(
            @RequestParam(value = "deviceSn",required = false) String deviceSn,
            @RequestParam(value = "date",required = false) String date,
            @RequestParam(value = "idcard",required = false) String idcard,
@ -105,14 +105,8 @@ public class DeviceHealthIndexController extends BaseController{
            response.setHeader("Content-Disposition", "attachment; filename="+ new String( "patientHealthIndexDataList.xls"));
            OutputStream os = response.getOutputStream();
            this.writePatientHealth(os,deviceHealthIndexes);
            write(200, "操作成功!");
            Map<Object, Object> map = new HashMap<Object, Object>();
            map.put("status", 200);
            map.put("msg", "操作成功!");
            return write(200, "操作成功");
        }catch (Exception ex){
            error(ex);
            return null;
        }
    }
    

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

@ -54,7 +54,7 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
    public Page<DeviceHealthIndexVO> searchList(String deviceSn,String date,String idcard,String userName,String indexType,Integer page,Integer pageSize,
    Integer indexTypeMin1,Integer indexTypeMax1,Integer indexTypeMin2,Integer indexTypeMax2,String doctorName)throws Exception{
                                                Double indexTypeMin1,Double indexTypeMax1,Double indexTypeMin2,Double indexTypeMax2,String doctorName)throws Exception{
        if (page == null){
            page = 1;
        }
@ -87,10 +87,10 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
            filter.append(" and (s.doctor_name like '%"+doctorName+"%' or s.doctor_health_name like '%"+doctorName+"%') ");
        }
        if(!StringUtils.isEmpty(deviceSn)){
            filter.append(" and i.deviceSn="+deviceSn);
            filter.append(" and i.device_sn='"+deviceSn+"' ");
        }
        if(!StringUtils.isEmpty(idcard)){
            filter.append(" and i.idcard="+idcard);
            filter.append(" and i.idcard='"+idcard+"' ");
        }
        //体征数据创建时间
        if(!StringUtils.isEmpty(date)){
@ -102,15 +102,15 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
            calendar.set(Calendar.SECOND,59);
            calendar.set(Calendar.MILLISECOND,999);
            Date endTimeTemp = calendar.getTime();
            filter.append(" and i.czrq>=" + DateTimeUtil.utcDateTimeFormat(startTimeTemp));
            filter.append(" and i.czrq<=" + DateTimeUtil.utcDateTimeFormat(endTimeTemp));
            filter.append(" and i.czrq>='" + DateTimeUtil.simpleDateTimeFormat(startTimeTemp)+"'");
            filter.append(" and i.czrq<='" + DateTimeUtil.simpleDateTimeFormat(endTimeTemp)+"'");
        }
        //指标类型
        if(!StringUtils.isEmpty(indexType)){
            filter.append(" and i.type="+indexType);
        }
        //体征数据
        if("1".equals(indexType)||"2".equals(indexType)||"4".equals(indexType)){
//        if("1".equals(indexType)||"2".equals(indexType)||"4".equals(indexType)){
            if(indexTypeMin1!=null){
                filter.append(" and value1>="+indexTypeMin1);
            }
@ -123,21 +123,22 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
            if(indexTypeMax2!=null){
                filter.append(" and value2<="+indexTypeMax2);
            }
        }else{
            if(indexTypeMin1!=null){
                filter.append(" and value3>="+indexTypeMin1);
            }
            if(indexTypeMax1!=null){
                filter.append(" and value3<="+indexTypeMax1);
            }
            if(indexTypeMin2!=null){
                filter.append(" and value4>="+indexTypeMin2);
            }
            if(indexTypeMax2!=null){
                filter.append(" and value4<="+indexTypeMax2);
            }
        }
//        }else{
//            if(indexTypeMin1!=null){
//                filter.append(" and value3>="+indexTypeMin1);
//            }
//            if(indexTypeMax1!=null){
//                filter.append(" and value3<="+indexTypeMax1);
//            }
//            if(indexTypeMin2!=null){
//                filter.append(" and value4>="+indexTypeMin2);
//            }
//            if(indexTypeMax2!=null){
//                filter.append(" and value4<="+indexTypeMax2);
//            }
//        }
        String f = filter.toString();
//        System.out.println("sql:"+sql+f+" order by i.czrq desc "+" limit "+(page-1)+","+pageSize);
        List<Map<String, Object>> resultList = jdbcTemplate.queryForList(sql+f+" order by i.czrq desc "+" limit "+(page-1)+","+pageSize);
        if(resultList.size()<=0){
            return new PageImpl<DeviceHealthIndexVO>(new ArrayList<>(), pageRequest, 0);
@ -225,8 +226,8 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
            calendar.set(Calendar.SECOND,59);
            calendar.set(Calendar.MILLISECOND,999);
            Date endTimeTemp = calendar.getTime();
            filter.append(" and i.czrq>=" + DateTimeUtil.utcDateTimeFormat(startTimeTemp));
            filter.append(" and i.czrq<=" + DateTimeUtil.utcDateTimeFormat(endTimeTemp));
            filter.append(" and i.czrq>='" + DateTimeUtil.simpleDateTimeFormat(startTimeTemp)+"'");
            filter.append(" and i.czrq<='" + DateTimeUtil.simpleDateTimeFormat(endTimeTemp)+"'");
        }
        //指标类型
        if(!StringUtils.isEmpty(indexType)){

+ 4 - 4
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/device/deviceHealthIndex_list_js.jsp

@ -76,10 +76,10 @@
                            if(value){
                                var valueNum1='value1';
                                var valueNum2='value2';
                                if(value==3){
                                    valueNum1='value3';
                                    valueNum2='value4';
                                }
//                                if(value==3){
//                                    valueNum1='value3';
//                                    valueNum2='value4';
//                                }
                                $("#search-max-1").attr('placeholder',name+valueNum1+"最大值");
                                $("#search-min-1").attr('placeholder',name+valueNum1+'最小值');
                                $("#search-max-1").val('');

+ 3 - 3
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/main.jsp

@ -138,9 +138,9 @@
							<sec:authorize url="/admin/static/pay/initial">
								<li><a href="javascript:locationMenu('staticPay');">支付统计报表</a></li>
							</sec:authorize>
							<sec:authorize url="/admin/static/healthedu/initial">
								<li><a href="javascript:locationMenu('healthEdu');">健教推送报表</a></li>
							</sec:authorize>
							<%--<sec:authorize url="/admin/static/healthedu/initial">--%>
								<%--<li><a href="javascript:locationMenu('healthEdu');">健教推送报表</a></li>--%>
							<%--</sec:authorize>--%>
							<sec:authorize url="/admin/static/center">
						</ul>
					</div>

+ 2 - 2
patient-co-service/wlyy_sign/pom.xml

@ -128,12 +128,12 @@
        <dependency>
            <groupId>com.zoesoft</groupId>
            <artifactId>phip-ssp-sdk</artifactId>
            <version>1.0.1</version>
            <version>1.4.0</version>
        </dependency>
        <dependency>
            <groupId>com.zoesoft</groupId>
            <artifactId>zoe-crypto</artifactId>
            <version>1.0-PK</version>
            <version>1.4.0</version>
        </dependency>
        <!-- 智业接口引用 END -->

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/booking/PatientBookingController.java

@ -133,7 +133,7 @@ public class PatientBookingController extends WeixinBaseController{
                    json.put("toUser", p.getCode());
                    json.put("represented",p.getCode());//被代理人
                    json.put("name", obj.getName());
                    json.put("date", obj.getStartTime());
                    json.put("date", DateUtil.dateToStrLong(obj.getStartTime()));
                    json.put("doctorName", obj.getDoctorName());
                    json.put("orgName", obj.getOrgName());
//                    json.put("remark", obj.getName() + ",您好!\n您已取消了" + obj.getStartTime() + "的挂号!");

+ 17 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -106,6 +106,8 @@ public class ConsultController extends WeixinBaseController {
    private MessageService messageService;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Value("${im.data_base_name}")
    private String im;
    /**
     * 患者咨询记录查询
@ -889,9 +891,21 @@ public class ConsultController extends WeixinBaseController {
                            }
                        }*/
                        String sql = "SELECT t.participant_id FROM im_new.participants t where t.session_id = '" +
                                patient.getCode() + "_" + consultModel.getTeam() + "_" + consultModel.getType() +
                                "' and t.participant_role = 0";
                        String sql = "";
                        if (consultModel.getType() == 2){
                            //家庭咨询
                            sql = "SELECT t.participant_id FROM " + im +
                                    ".participants t where t.session_id = '" +
                                    patient.getCode() + "_" + consultModel.getTeam() + "_" + consultModel.getType() +
                                    "' and t.participant_role = 0";
                         }else if (consultModel.getType() == 8){
                            //续方咨询
                            sql = "SELECT t.participant_id FROM " + im +
                                    ".participants t where t.session_id = '" +
                                    patient.getCode() + "_" + consultModel.getConsult() + "_" + consultModel.getType() +
                                    "' and t.participant_role = 0";
                         }
                        List<Map<String, Object>> participants = jdbcTemplate.queryForList(sql);
                        for (Map<String, Object> participant : participants) {

+ 44 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/express/LuyanExpressApiController.java

@ -0,0 +1,44 @@
package com.yihu.wlyy.web.third.gateway.controller.express;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
 * 提供给鹭燕物流调用的接口
 * @author huangwenjie
 * @date 2018/3/26 14:05
 */
@RestController
@RequestMapping(value = "/wlyygc/express/luyan")
@Api(description = "鹭燕物流相关接口")
public class LuyanExpressApiController extends BaseController {
	private static Logger logger = LoggerFactory.getLogger(LuyanExpressApiController.class);
	
	@RequestMapping(value="/routepushservice",method = RequestMethod.POST)
	@ApiOperation("接受顺丰推送过来的路由信息")
	@ObserverRequired
	public String SFRoutePushService (
			@ApiParam(name="prescriptionCode", value="处方编码") @RequestParam(value = "prescriptionCode",required = true) String prescriptionCode,
			@ApiParam(name="mailno", value="快递单号") @RequestParam(value = "mailno",required = true) String mailno,
			@ApiParam(name="routinfo", value="入参报文") @RequestParam(value = "routinfo",required = true) String routinfo){
		try {
			System.out.println(routinfo);
			return write(200, "查询成功!");
		}catch (Exception e){
			logger.error("接收路演大药房信息推送失败,入参JSON:"+routinfo);
			//日志文件中记录异常信息
			error(e);
			//返回接口异常信息处理结果
			return error(-1, "请求失败!");
		}
	}
}

+ 4 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/zysoft/BookingController.java

@ -346,7 +346,7 @@ public class BookingController extends WeixinBaseController {
                json.put("toUser", p.getCode());
                json.put("represented",p.getCode());//被代理人
                json.put("id", obj.getCode());
                json.put("date", obj.getStartTime());
                json.put("date", DateUtil.dateToStrLong(obj.getStartTime()));
                json.put("orgCode", obj.getOrgCode());
                json.put("orgName", obj.getOrgName());
                json.put("doctorName", obj.getDoctorName());
@ -452,7 +452,7 @@ public class BookingController extends WeixinBaseController {
                    json.put("toUser", p.getCode());
                    json.put("represented",p.getCode());//被代理人
                    json.put("name", obj.getName());
                    json.put("date", obj.getStartTime());
                    json.put("date", DateUtil.dateToStrLong(obj.getStartTime()));
                    json.put("doctorName", obj.getDoctorName());
                    json.put("orgName", obj.getOrgName());
//                    json.put("remark", obj.getName() + ",您好!\n您已取消了" + obj.getStartTime() + "的挂号!");
@ -544,7 +544,7 @@ public class BookingController extends WeixinBaseController {
    @RequestMapping(value = "CreateOrderByDoctor", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("(内网)转诊预约挂号")
    @ApiOperation("(内网)转诊预约挂号-医生代预约")
    public String CreateOrderByDoctor(@ApiParam(name = "hospitalId", value = "医院ID", defaultValue = "350211A1001")
                                      @RequestParam(value = "hospitalId", required = true) String hospitalId,
                                      @ApiParam(name = "hospitalName", value = "医院名称", defaultValue = "厦门大学附属第一医院")
@ -618,7 +618,7 @@ public class BookingController extends WeixinBaseController {
                        json.put("toUser", patient);
                        json.put("represented",patient);//被代理人
                        json.put("id", orderCode);
                        json.put("date", obj.getStartTime());
                        json.put("date", DateUtil.dateToStrLong(obj.getStartTime()));
                        json.put("orgName", obj.getOrgName());
                        json.put("orgCode", obj.getOrgCode());
                        json.put("doctorName", obj.getDeptName());