Explorar o código

Merge branch 'dev' of zd_123/patient-co-management into dev

huangwenjie %!s(int64=7) %!d(string=hai) anos
pai
achega
1223c542a3

+ 17 - 2
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/JMController.java

@ -289,7 +289,7 @@ public class JMController {
		}
	}
	@RequestMapping(value = "/imm/findWzymBymykh",method = RequestMethod.POST)
	/*@RequestMapping(value = "/imm/findWzymBymykh",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("计免:获取计划免疫接种记录")
	public Result findWzymBymykh()
@ -302,7 +302,7 @@ public class JMController {
			ex.printStackTrace();
			return Result.error(ex.getMessage());
		}
	}
	}*/
	@RequestMapping(value = "/imm/findMyVaccin",method = RequestMethod.POST)
	@ResponseBody
@ -334,4 +334,19 @@ public class JMController {
			return Result.error(ex.getMessage());
		}
	}
	@RequestMapping(value = "/imm/findWzymBymykh",method = RequestMethod.POST)
	@ResponseBody
	@ApiOperation("计免:根据免疫卡号查询接种记录")
	public Result findWzymBymykh(@RequestParam(value = "etmykh")String etmykh)
	{
		try {
			String data = jmService.findWzymBymykh(etmykh);
			return Result.success("获取接种记录成功!",data);
		} catch (Exception ex) {
			ex.printStackTrace();
			return Result.error(ex.getMessage());
		}
	}
}

+ 24 - 2
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/JMService.java

@ -42,6 +42,7 @@ public class JMService {
    private String FIND_MY_VACCIN="findMyVaccin";
    private String FIND_CHILDREN = "findChildren";
    private String FIND_DEPT="findDept";//获取接种门诊
    private String FIND_WZYM_BY_MYKH="findWzymBymykh";
    private String redis_key ="imm:imm_token_key";
@ -472,7 +473,7 @@ public class JMService {
     * 获取计划免疫接种记录
     * @return
     */
    public String findWzymBymykh() throws Exception  {
    /*public String findWzymBymykh() throws Exception  {
        String result = "";
        Map<String,String> params = new HashMap<>();
        params.put("act", "findWzymBymykh");
@ -480,7 +481,7 @@ public class JMService {
        params.put("_token", "118328844");
        params.put("etmykh", "0052182708");
        return ylzImmGetSecond(apiString,"计免预约-获取计划免疫接种记录",params);
    }
    }*/
    /**
     * 获取计划免疫接种记录
@ -516,6 +517,27 @@ public class JMService {
        return ylzImmGetSecond(FIND_DEPT,"计免预约-获取接种门诊",params);
    }
    /**
     * 根据免疫卡号查询接种记录
     * @param etmykh
     * @return
     * @throws Exception
     */
    public String findWzymBymykh(String etmykh) throws Exception  {
        String result = "";
        Map<String,String> params = new HashMap<>();
        params.put("act", FIND_WZYM_BY_MYKH);
        params.put("accId", accId);
        params.put("token", getTokenCheck());
        params.put("etmykh", etmykh);
        //params.put("etmykh", "0052182708");
        /*params.put("act", "findWzymBymykh");
        params.put("accId", "q9Bt3TE00KaigEW5EJVIMA==");
        params.put("_token", "118328844");
        params.put("etmykh", "0052182708");*/
        return ylzImmGetSecond(FIND_WZYM_BY_MYKH,"计免预约-获取接种记录",params);
    }
    public String getTokenCheck() throws Exception{
        String token = "";
        if (!redisTemplate.hasKey(redis_key)){

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceLogService.java

@ -90,10 +90,10 @@ public class PatientDeviceLogService extends BaseService {
                "  SELECT sf.name, pd.* FROM wlyy_patient_device_log pd" +
                "  LEFT JOIN wlyy_sign_family sf ON pd.patient = sf.patient" +
                "  WHERE" +
                "  pd.is_del = 1 and (sf.doctor= '" +doctor+"' or sf.doctor_health = '"+doctor+"') and sf.`status`>0"+
                "  pd.is_del = 1 and (sf.doctor= '"+doctor+"' or sf.doctor_health = '"+doctor+"') and sf.`status`>0"+
                "  ORDER BY" +
                "  create_time DESC) a" +
                " GROUP BY a.device_sn) b" +
                "  pd.create_time DESC) a" +
                " GROUP BY a.device_sn,a.patient) b" +
                " LEFT JOIN dm_device dd ON b.device_id = dd.id where 1=1 ";
        resultList = jdbcTemplate.queryForList(sql);
        resultMap.put("tatalCount",resultList.size());

+ 10 - 10
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -6204,27 +6204,27 @@ public class StatisticsESService {
        List<SaveModel> esModelList = new ArrayList<>();
        if ((level == 2 && "5".equals(lowLevel)) || (level == 4) || (level == 3 && "5".equals(lowLevel))) {
            String time = getStatisticsTime();
            String time = DateUtil.getStringDateShort();
            String sql ="SELECT" +
                    " pd.doctor team," +
                    " pd.doctor_name teamName," +
                    " COUNT(1) result1" +
                    " FROM" +
                    " wlyy_patient_device pd," +
                    " wlyy_sign_family sf" +
                    " device.wlyy_devices dw" +
                    " WHERE" +
                    " pd.user_idcard = sf.idcard" +
                    " AND sf.type = 2" +
                    " pd.device_sn = dw.device_code" +
                    " AND pd.del = 0" +
                    " AND sf. STATUS IN (1, 2)" +
                    " AND pd.czrq < '"+time+"'" +
                    " AND sf.sign_year = '"+year+"'";
                    " AND pd.category_code IN (1, 2)" +
                    " AND pd.czrq>='2018-06-30 17:00:00'"+
                    " AND pd.czrq < '"+time+" 17:00:00'" +
                    " AND LEFT(pd.czrq,4)= '"+year+"'";
            if(level==3){
                sql +=" AND LEFT(sf.hospital,6)= '"+area+"'";
                sql +=" AND LEFT(dw.grant_org_code,6)= '"+area+"'";
            }else if (level==4){
                sql +=" AND sf.hospital = '"+area+"'";
                sql +=" AND dw.grant_org_code = '"+area+"'";
            }
            sql +=" GROUP BY team,teamName";
            sql +=" GROUP BY team";
            esModelList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SaveModel.class));
        }else {
            esModelList = (List<SaveModel>) elasticsearchUtil.findListDateQuotaLevel0(date, area, level, index, SaveModel.timeLevel_DDL, low_level);

+ 16 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/guahao/ImmuneService.java

@ -760,4 +760,20 @@ public class ImmuneService {
			throw new Exception("获取免疫接种机构列表息失败!");
		}
	}
	/**
	 * 计免:获取计划免疫接种记录
	 * @param barcode 新生儿条码
	 * @return
	 * @throws Exception
	 */
	public String findWzymBymykh(String barcode) throws Exception{
		String url = jwUrl + "/third/jm/imm/findWzymBymykh";
		List<NameValuePair> params = new ArrayList<>();
		params.add(new BasicNameValuePair("barCode", barcode));
		String response = httpClientUtil.post(url, params, "UTF-8");
		return response;
	}
}

+ 11 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/device/DoctorDeviceController.java

@ -122,8 +122,19 @@ public class DoctorDeviceController extends BaseController {
			PatientDevice device = objectMapper.readValue(data,PatientDevice.class);
			// 设置操作医生标识
			device.setDoctor(getUID());
			Doctor doctor = doctorService.findDoctorByCode(getUID());
			if (doctor!=null){
				device.setDoctorName(doctor.getName());
			}
			//首绑和设备类型判断  判断是否可以增加积分
			Map<String,Object> checkMap = patientDeviceService.checkBindingFirstAndType(device);
			boolean flag = (Boolean)checkMap.get("flag");
			//绑定
			patientDeviceService.saveDevice(device);
			patientDeviceLogService.savePatientDeviceLog(device,device.getDeviceSn(),1,1);
			//修改设备表中{"1":"0", "2":"0"}绑定次数 和其他绑定信息,
			deviceDetailService.updateAfterBinding(device,new Date(),flag);
			return success("设备保存成功!");
		}

+ 21 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/imm/DoctorImmController.java

@ -1,9 +1,11 @@
package com.yihu.wlyy.web.doctor.imm;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.imm.ChildImmuneVaccin;
import com.yihu.wlyy.entity.imm.ChildInfoVO;
import com.yihu.wlyy.service.imm.ChildFamilyImmuneService;
import com.yihu.wlyy.service.imm.ChildInfoService;
import com.yihu.wlyy.service.third.guahao.ImmuneService;
import com.yihu.wlyy.util.IdCardUtil;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
@ -14,10 +16,7 @@ import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
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;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@ -35,6 +34,8 @@ public class DoctorImmController extends BaseController {
	private ChildFamilyImmuneService childFamilyImmuneService;
	@Autowired
	private ChildInfoService childInfoService;
	@Autowired
	private ImmuneService immuneService;
	
	/**
	 * 家庭免疫成员查询
@ -160,6 +161,21 @@ public class DoctorImmController extends BaseController {
			return error(-1, "查询失败");
		}
	}
	
	@RequestMapping(value = "/imm/findWzymBymykh", method = RequestMethod.GET)
	@ResponseBody
	@ObserverRequired
	@ApiOperation("计免:获取计划免疫接种记录")
	public String findWzymBymykh (@ApiParam(name = "barCode", value = "条形编码", defaultValue = "0052248552")
								  @RequestParam(value = "barCode", required = true) String barCode){
		try{
			String re = immuneService.findWzymBymykh(barCode);
			return write(200, "查询成功","data",re);
		}catch (Exception e){
			error(e);
			return error(-1, e.getMessage());
		}
	}
	
}

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

@ -612,6 +612,22 @@ public class PatientBookingController extends WeixinBaseController{
        }
        return json;
    }
    @RequestMapping(value = "/imm/findWzymBymykh", method = RequestMethod.GET)
    @ResponseBody
    @ObserverRequired
    @ApiOperation("计免:获取计划免疫接种记录")
    public String findWzymBymykh (@ApiParam(name = "barCode", value = "条形编码", defaultValue = "0052248552")
                                   @RequestParam(value = "barCode", required = true) String barCode){
        try{
            String re = immuneService.findWzymBymykh(barCode);
            return write(200, "查询成功","data",re);
        }catch (Exception e){
            error(e);
            return error(-1, e.getMessage());
        }
    }
    
    /**
     *-----------------计划免疫预约相关接口--------------END

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java

@ -591,7 +591,7 @@ public class EsStatisticsController extends BaseController {
                        result.put("index_" + idx, statisticsESService.getLowLevelTotalTeamLeader(date, area, level, idx, sort, lowLevel, year));
                    } else if (idx.equals("72")) {
                        result.put("index_" + idx, statisticsESService.getLowLevelTotalOnlineTeamLeader(date, area, level, idx, sort, lowLevel, year, ""));
                    }else if (idx.equals("20")){
                    }else if (idx.equals("20") && Integer.valueOf(year)>=2018){
                        result.put("index_" + idx, statisticsESService.getDeviceLowLevelTotal(date, area, level, idx, sort, lowLevel, year));
                    }else {
                        result.put("index_" + idx, statisticsESService.getLowLevelTotal(date, area, level, idx, sort, lowLevel, year));