Ver código fonte

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

wangzhinan 6 anos atrás
pai
commit
5ae8249e63

+ 6 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/customer/CustomerSynergyManageController.java

@ -213,13 +213,17 @@ public class CustomerSynergyManageController extends BaseController {
                               @ApiParam(name="receiveType",value="客服角色(1、客服,2、客服负责人)",required = false)
                               @RequestParam(required = false)Integer receiveType,
                               @ApiParam(name="sortType",value="排序(1、升序,2、降序)",required = false,defaultValue = "1")
                               @RequestParam(required = false,defaultValue = "1")Integer sortType){
                               @RequestParam(required = false,defaultValue = "1")Integer sortType,
                               @ApiParam(name = "page", value = "第几页,从1开始", required = true)
                               @RequestParam(value = "page", required = true,defaultValue = "1")Integer page,
                               @ApiParam(name = "pageSize", value = "每页分页大小", required = true)
                               @RequestParam(value = "pageSize", required = true,defaultValue = "10")Integer pageSize){
        try{
            if(!StringUtils.isNotEmpty(userCode)){
                userCode = getUID();
            }
            List<Map<String,Object>> resultList = synergyManageService.reminderList(userCode,receiveType,sortType);
            Map<String,Object> resultList = synergyManageService.reminderList(userCode,receiveType,sortType,page,pageSize);
            return write(200,"获取成功","data", resultList);
        }catch (Exception e){
            error(e);

+ 14 - 3
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/SynergyManageService.java

@ -874,7 +874,7 @@ public class SynergyManageService extends BaseJpaService {
     * @param receiveType 1、客服,2、客服负责人
     * @param sortType 1、升序,2、降序
     */
    public List<Map<String,Object>> reminderList(String userCode,Integer receiveType,Integer sortType){
    public Map<String,Object> reminderList(String userCode,Integer receiveType,Integer sortType,Integer page,Integer pageSize){
        String sql ="";
        String sort ="";
        if(sortType==1){
@ -889,7 +889,13 @@ public class SynergyManageService extends BaseJpaService {
        }else if(receiveType==2){
            sql =" select r.* from manage_synergy_workorder_reminder r where r.principal_code='"+userCode+"' and r.deal_with=0 "+sort;
        }
        List<Map<String,Object>> List = jdbcTemplate.queryForList(sql);
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sql);
        int count = 0;
        if(rstotal!=null&&rstotal.size()>0&&rstotal.get(0).get("id")!=null){
            count = rstotal.size();
        }
        String finalSql = sql+" LIMIT "+(page-1)*pageSize+","+pageSize;
        List<Map<String,Object>> List = jdbcTemplate.queryForList(finalSql);
        List<Map<String,Object>> resultList = new ArrayList<>();
        for(Map<String,Object> one:List){
            Map<String,Object> resultMap = new HashMap<>();
@ -917,7 +923,12 @@ public class SynergyManageService extends BaseJpaService {
            resultMap.put("overTimeFlag",overTimeFlag);
            resultList.add(resultMap);
        }
        return resultList;
        Map<String,Object> resultMap = new HashMap<>();
        resultMap.put("currPage",page);
        resultMap.put("pageSize",pageSize);
        resultMap.put("totalCount",count);
        resultMap.put("detailModelList",resultList);
        return resultMap;
    }
    /**

+ 51 - 8
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/imm/ChildFamilyImmuneService.java

@ -139,7 +139,7 @@ public class ChildFamilyImmuneService extends BaseService {
				" inner join (select patient,name from wlyy_sign_family where type in (1,2) and `status` = 1 and expenses_status = 1 and doctor = '"+doctorcode+"' or doctor_health='"+doctorcode+"') b " +
				" on a.family_code = b.patient " +
				" left join wlyy_child_info c on c.`code` = a.child_code " +
				") m on m.barcode = t.barcode ";
				") m on m.barcode = t.barcode where t.ymsx=1";
		if (limitType==1){
			int start = (pageNo-1)*pageSize;
			sql +=" limit "+start+","+pageSize;
@ -166,7 +166,7 @@ public class ChildFamilyImmuneService extends BaseService {
					" type IN (1, 2)" +
					" AND `status` = 1" +
					" AND expenses_status = 1" +
					" AND doctor = '"+doctorcode+"'" +
					" AND (doctor = '"+doctorcode+"' or doctor_health='"+doctorcode+"')" +
					" ) b ON a.family_code = b.patient" +
					" LEFT JOIN wlyy_child_info c ON c.`code` = a.child_code where  a.child_code='"+childCode+"'";
			List<Map<String,Object>> familyList = jdbcTemplate.queryForList(familySql);
@ -241,18 +241,19 @@ public class ChildFamilyImmuneService extends BaseService {
			for (Map<String,Object> map : list){
				//如果父母亲都在就都发
				if (!openIdList.contains(String.valueOf(map.get("openid")))){
					if (("1".equals(String.valueOf(map.get("relation"))) || "2".equals(String.valueOf(map.get("relation")))) && StringUtils.isNotBlank(String.valueOf(map.get("openid")))){
					if ( StringUtils.isNotBlank(String.valueOf(map.get("openid")))){
						boolean flag =true;
						try {
							WechatTemplateConfig temp = templateConfigDao.findByScene("template_deal_with", "ymjztx");
							WechatTemplateConfig temp = templateConfigDao.findByScene("template_doctor_survey", "ymjztx");
							JSONObject json = new JSONObject();
							json.put("toUser",String.valueOf(map.get("code")));
							json.put("keyword1", temp.getKeyword1().replace("key1",DateUtil.dateToStr(new Date(), "yyyy-MM-dd")));
							json.put("keyword2", temp.getKeyword2().replace("key1", doctorName+"("+doctorLevel+")"));
							json.put("keyword1", temp.getKeyword1());
							json.put("keyword2", temp.getKeyword2().replace("key1",DateUtil.dateToStr(new Date(), "yyyy-MM-dd")));
							json.put("remark", temp.getRemark());
							json.put("first", temp.getFirst().replace("key1",String.valueOf(map.get("name"))).replace("key2", childName).replace("key3",vaccinName));
							json.put("first", temp.getFirst().replace("key1",String.valueOf(map.get("name"))).replace("key2", childName));
							json.put("url",temp.getUrl().replace("key1",childCode));
							logger.info("weiTempJOSN:"+json.toString());
							pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 24,String.valueOf(map.get("openid")) , String.valueOf(map.get("name")), json);
							pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 11,String.valueOf(map.get("openid")) , String.valueOf(map.get("name")), json);
						}catch (Exception e){
							e.printStackTrace();
							flag = false;
@ -515,4 +516,46 @@ public class ChildFamilyImmuneService extends BaseService {
		alertJsonStr = jsonArray.toString();
		return alertImmVacclinByChildInfoCodes(alertJsonStr,doctor);
	}
    public int alertBefore()throws Exception{
        JSONArray jsonArray =  new JSONArray();
        String sql ="SELECT" +
                " v.*, i.birthday" +
                " FROM" +
                " wlyy_child_immune_vaccin v" +
                " LEFT JOIN wlyy_child_info i ON v.child_info_code = i.`code`" +
                " WHERE" +
                " v.del = 0" +
                " AND ymkc = 'true'";
        List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
        String nowDate = DateUtil.dateToStrShort(new Date());
        for (Map<String,Object> map : mapList){
            Calendar calendar=Calendar.getInstance();
            String birthDayStr = String.valueOf(map.get("birthday"));
            if (StringUtils.isNotBlank(birthDayStr)){
                String[] biStr = birthDayStr.split("-");
                int birthdayDate = Integer.valueOf(biStr[biStr.length-1]);
                int nowDayDate = calendar.get(GregorianCalendar.DAY_OF_MONTH);
                int nowMonthDate = calendar.get(GregorianCalendar.MONTH)+1;
                int nowYearDate = calendar.get(GregorianCalendar.YEAR);
                //如果生日在今天的日期之前,则取下个月生日的日期的15天的是否是今天.
                if (birthdayDate<nowDayDate){
                    calendar.set(nowYearDate,nowMonthDate+1,birthdayDate);
                }else {
                    //如果生日在今天之前后,则看生日的15天之前是否是今天
                    calendar.set(nowYearDate,nowMonthDate,birthdayDate);
                }
                String needAlertDate = DateUtil.dateToStrShort(DateUtil.getPreDays(calendar.getTime(),-15));
                if (needAlertDate.equals(nowDate)){
                    JSONObject jsonObject = new JSONObject();
                    jsonObject.put("vaccinCode",map.get("code"));//待接种疫苗记录code
                    jsonObject.put("childName", map.get("name"));//儿童姓名
                    jsonObject.put("childCode", map.get("child_info_code"));//儿童code
                    jsonObject.put("vaccinName", map.get("ymmc"));//疫苗名称
                    jsonArray.put(jsonObject);
                }
            }
        }
        return alertImmVacclinByChildInfoCodes(jsonArray.toString(),"rll201703150222");
    }
}

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

@ -136,8 +136,9 @@ public class DoctorImmController extends BaseController {
			}
			if (result==-10000){
				return error(-1, "该儿童父母数据为空,请联系管理员!");
			}else {
				return write(200, "请求成功");
			}
			return write(200, "请求成功");
		} catch (Exception e) {
			e.printStackTrace();
			return error(-1, "查询失败");
@ -225,4 +226,19 @@ public class DoctorImmController extends BaseController {
			return error(-1, e.getMessage());
		}
	}
	@RequestMapping(value = "/imm/alertJobTest", method = RequestMethod.GET)
	@ResponseBody
	@ObserverRequired
	@ApiOperation("job提醒居民预约测试")
	public String alertJobTest (){
		try{
			int res = childFamilyImmuneService.alertBefore();
			return write(200,"获取成功!","data",res);
		}catch (Exception e){
			error(e);
			return error(-1, e.getMessage());
		}
	}
}

+ 2 - 1
patient-co/patient-co-wlyy/src/main/resources/application-dev.yml

@ -95,7 +95,8 @@ wechat:
   #体检报告提醒
   template_physical_examination:  jTsvKU3iFw0yiJi5ESyFGDTmFSVcWlMot3yHier39Vc
   #处理结果通知
   template_deal_with:  VagkqFW_LFqLKE3gP2wmPtUfDWQOah40XMloipfi1do
   #template_deal_with:  VagkqFW_LFqLKE3gP2wmPtUfDWQOah40XMloipfi1do
   template_deal_with:  q9AiUpG7h2_4MUVE7iIKLV8lVwVaytTrHozqnkPGSes
    #设备绑定结果通知
   template_patient_bind_device: 1GWPw6LFcSuz2LFTo6LhE-YY8abtmcKRvor1fUzfxBE
    #积分到账通知

+ 4 - 2
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -91,7 +91,8 @@ wechat:
    #医生变更
    template_doctor_change:  V5h0F84t972kUzQvWy8qYrgdaYGJVj10pFeFVl19Nb8
    #问卷调查
    template_doctor_survey:  OqQXrb-e43_TJpq_70_K_y6vYJgY5mpjFYY4c5RWFP4
    #template_doctor_survey:  OqQXrb-e43_TJpq_70_K_y6vYJgY5mpjFYY4c5RWFP4
    template_doctor_survey:  q9AiUpG7h2_4MUVE7iIKLV8lVwVaytTrHozqnkPGSes
    #审核结果通知
    template_doctor_audit:  lCtOgJgL1tBJbAytqN7cn-FgCH_Usg99FENEy2TrC08
    #服务结果通知
@ -99,7 +100,8 @@ wechat:
    #体检报告提醒
    template_physical_examination:  tlsPJlgA90-I73j2QudyMG7C-LmrMn1lC4_UnJPyWSM
    #处理结果通知
    template_deal_with:  VagkqFW_LFqLKE3gP2wmPtUfDWQOah40XMloipfi1do
    #template_deal_with:  VagkqFW_LFqLKE3gP2wmPtUfDWQOah40XMloipfi1do
    template_deal_with:  q9AiUpG7h2_4MUVE7iIKLV8lVwVaytTrHozqnkPGSes
    #设备绑定结果通知
    template_patient_bind_device: 1GWPw6LFcSuz2LFTo6LhE-YY8abtmcKRvor1fUzfxBE
    #积分到账通知

+ 2 - 1
patient-co/patient-co-wlyy/src/main/resources/application-local.yml

@ -92,7 +92,8 @@ wechat:
   #体检报告提醒
   template_physical_examination:  jTsvKU3iFw0yiJi5ESyFGDTmFSVcWlMot3yHier39Vc
   #处理结果通知
   template_deal_with:  GyXCmXVYCD7PXi0IbHdPOD8apa-RQoSrSw-4-0pj9Go
   #template_deal_with:  GyXCmXVYCD7PXi0IbHdPOD8apa-RQoSrSw-4-0pj9Go
   template_deal_with:  q9AiUpG7h2_4MUVE7iIKLV8lVwVaytTrHozqnkPGSes
   #设备绑定结果通知
   template_patient_bind_device: 1GWPw6LFcSuz2LFTo6LhE-YY8abtmcKRvor1fUzfxBE
   #积分到账通知

+ 2 - 1
patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml

@ -87,7 +87,8 @@ wechat:
    #体检报告提醒
    template_physical_examination:  tlsPJlgA90-I73j2QudyMG7C-LmrMn1lC4_UnJPyWSM
    #处理结果通知
    template_deal_with:  VagkqFW_LFqLKE3gP2wmPtUfDWQOah40XMloipfi1do
    #template_deal_with:  VagkqFW_LFqLKE3gP2wmPtUfDWQOah40XMloipfi1do
    template_deal_with:  q9AiUpG7h2_4MUVE7iIKLV8lVwVaytTrHozqnkPGSes
    #支付提醒
    template_to_be_pay: Y5d-V3qW78ThFEi_DuepFdZ3dn1FpHeL2NzH0ilw-qM
    #支付成功通知

+ 3 - 1
patient-co/patient-co-wlyy/src/main/resources/application-test.yml

@ -82,7 +82,8 @@ wechat:
   #医生变更
   template_doctor_change:  RMKwJ-PLHP-uBwjJlHDgPaVFZhjuXvhSO7V8Dwh7vPc
   #问卷调查
   template_doctor_survey:  OqQXrb-e43_TJpq_70_K_y6vYJgY5mpjFYY4c5RWFP4
   #template_doctor_survey:  OqQXrb-e43_TJpq_70_K_y6vYJgY5mpjFYY4c5RWFP4
   template_doctor_survey :  q9AiUpG7h2_4MUVE7iIKLV8lVwVaytTrHozqnkPGSes
   #审核结果通知
   template_doctor_audit:  kyrkan8cWQ22J_NC01e8yGwsn75MeUtfgdCrZKkwSLQ
   #服务结果通知
@ -90,6 +91,7 @@ wechat:
   #体检报告提醒
   template_physical_examination:  tlsPJlgA90-I73j2QudyMG7C-LmrMn1lC4_UnJPyWSM
   #处理结果通知
   #template_deal_with:  q9AiUpG7h2_4MUVE7iIKLV8lVwVaytTrHozqnkPGSes
   template_deal_with:  q9AiUpG7h2_4MUVE7iIKLV8lVwVaytTrHozqnkPGSes
   #设备绑定结果通知
   template_patient_bind_device: GJD0OC5HnmFOyj9Bcn_LQEYxwIg2t2jAdOX3jKoqaC8