Explorar el Código

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

liuwenbin hace 7 años
padre
commit
786244d1db
Se han modificado 33 ficheros con 678 adiciones y 91 borrados
  1. 100 0
      common/common-entity/src/main/java/com/yihu/es/entity/PatientRemindRecordESDO.java
  2. 10 1
      common/common-entity/src/main/java/com/yihu/wlyy/entity/imm/ChildImmuneVaccin.java
  3. 1 1
      common/common-entity/src/main/java/com/yihu/wlyy/entity/message/Message.java
  4. 12 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/customer/CustomerScreenResultController.java
  5. 27 2
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/customer/CustomerSynergyManageController.java
  6. 9 9
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/synergy/ManageSynergyWorkorderDO.java
  7. 4 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/synergy/ManageSynergyWorkorderServicerDao.java
  8. 6 5
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/QuestionnaireManageService.java
  9. 25 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/ScreenResultManageService.java
  10. 93 14
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/SynergyManageService.java
  11. 7 3
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/imm/ChildVaccinImmuneService.java
  12. 43 0
      patient-co/patient-co-wlyy/doc/技术文档/es/可预约疫苗提醒日志新增索引
  13. 2 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/imm/ChildFamilyImmuneDao.java
  14. 3 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/imm/ChildImmuneVaccinDao.java
  15. 13 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java
  16. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/family/FamilyMemberService.java
  17. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/CreditLogService.java
  18. 44 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java
  19. 10 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/survey/SurveyScreenResultService.java
  20. 152 31
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/imm/ChildFamilyImmuneService.java
  21. 23 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistEvaluateSevice.java
  22. 3 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/rehabilitation/RehabilitationManageService.java
  23. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/rehabilitation/RehabilitationPlanService.java
  24. 7 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/survey/ManagerQuestionnaireService.java
  25. 14 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/imm/DoctorImmController.java
  26. 53 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java
  27. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/survey/ManagerQuestionnaireController.java
  28. 1 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/family/FamilyMemberController.java
  29. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-dev.yml
  30. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml
  31. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-local.yml
  32. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-localtest.yml
  33. 2 0
      patient-co/patient-co-wlyy/src/main/resources/application-test.yml

+ 100 - 0
common/common-entity/src/main/java/com/yihu/es/entity/PatientRemindRecordESDO.java

@ -0,0 +1,100 @@
package com.yihu.es.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import org.springframework.data.annotation.CreatedDate;
import java.util.Date;
/**
 * 疫苗提醒记录
 * @author zhangdan
 * @date 2018/09/27 20:51
 */
public class PatientRemindRecordESDO {
	
	@JestId
	private String id;
	// 业务主键
	private String code;
	private String patient;
	private String patientName;
	private String doctor;
	private String doctorName;
	private Integer remindType;//1计免提醒
	private Integer status;//0未发送 1已发送
	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
	private Date createDate;
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getPatient() {
		return patient;
	}
	public void setPatient(String patient) {
		this.patient = patient;
	}
	public String getPatientName() {
		return patientName;
	}
	public void setPatientName(String patientName) {
		this.patientName = patientName;
	}
	public String getDoctor() {
		return doctor;
	}
	public void setDoctor(String doctor) {
		this.doctor = doctor;
	}
	public String getDoctorName() {
		return doctorName;
	}
	public void setDoctorName(String doctorName) {
		this.doctorName = doctorName;
	}
	public Integer getRemindType() {
		return remindType;
	}
	public void setRemindType(Integer remindType) {
		this.remindType = remindType;
	}
	public Integer getStatus() {
		return status;
	}
	public void setStatus(Integer status) {
		this.status = status;
	}
	public Date getCreateDate() {
		return createDate;
	}
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
}

+ 10 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/imm/ChildImmuneVaccin.java

@ -20,6 +20,7 @@ public class ChildImmuneVaccin extends IdEntity {
	private String idcard;                  //儿童身份证号
	private String ssc;                     //儿童社保卡号
	private String barcode;                 //儿童免疫条码
	private String childInfoCode;			  //child_info主键code
	private String ymkc;                    //true:可约,false:不可约
	private String ymmc;                    //疫苗名称
	private String ymkcsm;                  //疫苗库存说明(库存充足,可以预约/库存不足,不能预约)
@ -72,7 +73,15 @@ public class ChildImmuneVaccin extends IdEntity {
	public void setBarcode(String barcode) {
		this.barcode = barcode;
	}
	
	public String getChildInfoCode() {
		return childInfoCode;
	}
	public void setChildInfoCode(String childInfoCode) {
		this.childInfoCode = childInfoCode;
	}
	public String getYmkc() {
		return ymkc;
	}

+ 1 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/message/Message.java

@ -30,7 +30,7 @@ public class Message extends IdEntity {
	/** type
	 *  消息类型(1.是家庭签约信息  2.体征消息  3分配健管师 4.随访提醒 5.咨询回复提醒,6.续方咨询待审核提醒,7.续方消息待取药
	 *  8.续方支付成功后团队长分配健管师,9线下调整完成,10意见反馈 11账号申诉,12.协同服务 13.孕检提醒 14.文章提交审核消息  15、健康文章审核结果
	 *  16.专科医生申请签约消息,17、家庭医生转诊预约消息,18、专科医生共管通知,:19 受理提醒,20 待办工作提醒 21 服务进展提醒-已完成 22 服务进展提醒-未完成 23 服务进展提醒-待完成 24、协同服务消息
	 *  16.专科医生申请签约消息,17、家庭医生转诊预约消息,18、专科医生共管通知,:19 受理提醒,20 待办工作提醒 21 服务进展提醒-已完成 22 服务进展提醒-未完成 23 服务进展提醒-待完成 24 收到协同任务 25 在线助手已接收 26 在线助手已退回 27 协同服务已完成
	 *  101患者申请取消签约、102患者同意取消签约、103患者拒绝取消签约、104患者填写了血糖记录、105患者填写了血压记录、106患者填写了体重记录、
	 *  107患者填写了腰围记录、108患者填写了运动记录、109患者填写了用药记录、110患者填写了饮食记录、111患者提交了问卷随访、112请求添加好友消息、
	 *  113入群消息、114群解散消息、115踢出群消息、116新的网络咨询、117网络咨询追问、

+ 12 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/customer/CustomerScreenResultController.java

@ -24,7 +24,7 @@ public class CustomerScreenResultController extends BaseController {
    private ScreenResultManageService screenResultService;
    @RequestMapping(value = "getScreenResultDetail", method = RequestMethod.GET)
    @ApiOperation(value = "查看筛查结果记录详情")
    @ApiOperation(value = "获取筛查结果记录详情")
    public String getScreenResultDetail(@ApiParam(value = "筛查结果唯一code")@RequestParam(value = "code") String code) {
        try {
            return write(200, "获取成功!", "data", screenResultService.getScreenResultDetail(code));
@ -33,4 +33,15 @@ public class CustomerScreenResultController extends BaseController {
            return write(-1, "获取失败!");
        }
    }
    @RequestMapping(value = "getQuestions", method = RequestMethod.GET)
    @ApiOperation(value = "获取筛查问卷详情")
    public String getScreenDetail(@ApiParam(value = "筛查问卷code")@RequestParam(value = "code") String templateCode) {
        try {
            return write(200, "获取成功!", "data", screenResultService.getScreenDetail(templateCode));
        } catch (Exception e) {
            e.printStackTrace();
            return write(-1, "获取失败!");
        }
    }
}

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

@ -1,11 +1,12 @@
package com.yihu.wlyy.controller.synergy.customer;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.entity.User;
import com.yihu.wlyy.service.manager.user.UserService;
import com.yihu.wlyy.service.synergy.SynergyManageService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@ -21,16 +22,40 @@ public class CustomerSynergyManageController extends BaseController {
    @Autowired
    private SynergyManageService synergyManageService;
    @Autowired
    private UserService userService;
    @RequestMapping(value = "/getWorkOrderInfo", method = {RequestMethod.GET, RequestMethod.POST})
    @ApiOperation(value = "获取协同服务工单信息")
    public String addCallRecord(@ApiParam(name="workorderCode",value="协同服务工单code")
                                @RequestParam(required = true)String workorderCode,
                                @ApiParam(name="patient",value="居民code")
                                @RequestParam(required = false)String patient,
                                @ApiParam(name="role",value="1医生,2客服管理员,3普通客服")
                                @RequestParam(required = true)Integer role){
        try {
            return write(200,"保存成功","data", synergyManageService.getWorkOrderInfo(workorderCode, role));
            return write(200,"保存成功","data", synergyManageService.getWorkOrderInfo(workorderCode, patient, role));
        }catch (Exception e){
            error(e);
            return error(-1,"保存失败");
        }
    }
    @RequestMapping(value = "/dealWorkOrder",method = RequestMethod.POST)
    @ApiOperation(value = "处理协同服务")
    public String dealWorkOrder(@ApiParam(name="code",value="协同服务工单code")
                                    @RequestParam(required = true)String code,
                                @ApiParam(name="jsonData",value="接收负责人或者退回理由")
                                    @RequestParam(required = true)String jsonData,
                                @ApiParam(name="receiverCode",value="处理者code")
                                    @RequestParam(required = true)String receiverCode,
                                @ApiParam(name="status",value="2、接收,4、退回)")
                                    @RequestParam(required = true)Integer status){
        try {
            User user = userService.getUserByCode(receiverCode);
            synergyManageService.dealWorkOrder(code, user, jsonData, status);
            return write(200,"保存成功");
        }catch (Exception e){
            error(e);
            return error(-1,"保存失败");

+ 9 - 9
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/synergy/ManageSynergyWorkorderDO.java

@ -35,10 +35,10 @@ public class ManageSynergyWorkorderDO extends IdEntity {
    private String servicerKey;//服务对象其中五个人
    private String receiverCode;//接收人code
    private String receiverName;//接收人名称
    private String receiverType;//接收人类型(1、医生,2、客服)
    private Integer receiverType;//接收人类型(1、医生,2、客服)
    private String hospital;//创建人所属机构code;
    private String hospitalName;//创建人所属机构名称
    private Date receiveTime;//工单(客服管理员)接收时间
    private Date receiverTime;//工单(客服管理员)接收时间
    @Column(name = "code")
    public String getCode() {
@ -221,11 +221,11 @@ public class ManageSynergyWorkorderDO extends IdEntity {
    }
    @Column(name = "receiver_type")
    public String getReceiverType() {
    public Integer getReceiverType() {
        return receiverType;
    }
    public void setReceiverType(String receiverType) {
    public void setReceiverType(Integer receiverType) {
        this.receiverType = receiverType;
    }
@ -256,12 +256,12 @@ public class ManageSynergyWorkorderDO extends IdEntity {
        this.hospitalName = hospitalName;
    }
    @Column(name = "receive_time")
    public Date getReceiveTime() {
        return receiveTime;
    @Column(name = "receiver_time")
    public Date getReceiverTime() {
        return receiverTime;
    }
    public void setReceiveTime(Date receiveTime) {
        this.receiveTime = receiveTime;
    public void setReceiverTime(Date receiverTime) {
        this.receiverTime = receiverTime;
    }
}

+ 4 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/synergy/ManageSynergyWorkorderServicerDao.java

@ -11,8 +11,11 @@ public interface ManageSynergyWorkorderServicerDao extends PagingAndSortingRepos
    @Query(" select count(1) from ManageSynergyWorkorderServicerDO s where s.workorderCode=?1 and s.status=?2 ")
    Integer findByWorkorderCodeCount(String workorderCode,Integer status);
    @Transactional
    @Modifying
    @Query("update ManageSynergyWorkorderServicerDO s set s.relationCode = ?2 where s.code = ?1")
    void updateRelationCodeByCode(String serviceCode, String questionResultCode);
    //根据工单code和居民code获取处理完成的服务对象信息
    @Query("select s from ManageSynergyWorkorderServicerDO s where s.workorderCode = ?1 and s.servicePatientCode = ?2 and s.status = 3")
    ManageSynergyWorkorderServicerDO findByWorkOrderCodeAndPatientCode(String workorderCode, String patient);
}

+ 6 - 5
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/QuestionnaireManageService.java

@ -16,16 +16,15 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
 * Created by humingfen on 2018/09/27.
 */
@Service
@Transactional
public class QuestionnaireManageService extends BaseJpaService {
    @Value("${wlyy.url}")
@ -74,14 +73,16 @@ public class QuestionnaireManageService extends BaseJpaService {
        workOrderDao.save(workorderDO);
        //保存协同服务工单的服务对象
        List<ManageSynergyWorkorderServicerDO> list = new ArrayList<>();
        for(ManageSynergyWorkorderServicerDO servicerDO : workorderServicerDOS){
            servicerDO.setCode(getCode());
            servicerDO.setWorkorderType(workorderDO.getType());
            servicerDO.setWorkorderCode(workorderDO.getCode());
            servicerDO.setStatus(1);
            servicerDO.setCreateTime(new Date());
            workorderServicerDao.save(servicerDO);
            list.add(servicerDO);
        }
        workorderServicerDao.save(list);
        return true;
    }

+ 25 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/ScreenResultManageService.java

@ -5,6 +5,7 @@ import com.yihu.wlyy.util.HttpClientUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.Map;
@ -13,6 +14,7 @@ import java.util.Map;
 * Created by humingfen on 2018/09/29.
 */
@Service
@Transactional
public class ScreenResultManageService {
    @Value("${wlyy.url}")
@ -20,6 +22,11 @@ public class ScreenResultManageService {
    @Autowired
    private HttpClientUtil httpClientUtil;
    /**
     * 获取筛查结果详情
     * @param code
     * @return
     */
    public JSONObject getScreenResultDetail(String code) {
        String url = wlyyUrl + "doctor/screen/getScreenResultDetail";
        String response = "";
@ -32,4 +39,22 @@ public class ScreenResultManageService {
        }
        return JSONObject.parseObject(response);
    }
    /**
     * 获取筛查问卷详情
     * @param templateCode
     * @return
     */
    public JSONObject getScreenDetail(String templateCode) {
        String url = wlyyUrl + "/doctor/questionnaire/getAllQuestions";
        String response = "";
        Map<String, String> params = new HashMap<>();
        params.put("surveyTemplateCode", templateCode);
        try {
            response = httpClientUtil.httpPost(url, params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return JSONObject.parseObject(response);
    }
}

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

@ -1,12 +1,17 @@
package com.yihu.wlyy.service.synergy;
import com.yihu.wlyy.entity.User;
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderDO;
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderExecutorDO;
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderServicerDO;
import com.yihu.wlyy.repository.UserDao;
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkOrderDao;
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkorderExecutorDao;
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkorderServicerDao;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -20,7 +25,7 @@ import java.util.*;
 */
@Service
@Transactional
public class SynergyManageService {
public class SynergyManageService extends BaseJpaService {
    @Autowired
    JdbcTemplate jdbcTemplate;
@ -30,6 +35,8 @@ public class SynergyManageService {
    private ManageSynergyWorkorderServicerDao workorderServicerDao;
    @Autowired
    private ManageSynergyWorkorderExecutorDao workorderExecutorDao;
    @Autowired
    private UserDao userDao;
    /**
     * 根据服务编码获取工单
@ -239,8 +246,14 @@ public class SynergyManageService {
        return serviceStatus;
    }
    //获取系统服务详情
    public Map<String, Object> getWorkOrderInfo(String workorderCode, Integer role) {
    /**
     * 获取系统服务详情
     * @param workorderCode
     * @param patient
     * @param role
     * @return
     */
    public Map<String, Object> getWorkOrderInfo(String workorderCode, String patient, Integer role) {
        Map<String, Object> map = new HashMap<>();
        ManageSynergyWorkorderDO workorderDO = workOrderDao.findByCode(workorderCode);
        //存入协同服务工单信息
@ -251,18 +264,30 @@ public class SynergyManageService {
        map.put("status", workorderDO.getStatus());
        map.put("title", workorderDO.getRelationCodeName());
        map.put("remark", workorderDO.getRemark());
        map.put("servicerKey", workorderDO.getServicerKey());
        map.put("servicerCount", workorderDO.getServicerCount());
        map.put("createTime", workorderDO.getCreateTime());
        map.put("createUserName", workorderDO.getCreateUserName());
        //判断是否超时
        Date now = new Date();
        long hour = (now.getTime() - workorderDO.getServiceTime().getTime())/60*60*1000;
        if(hour <= 4){
            map.put("delay", "red");
        }else if(hour <= 24){
            map.put("delay", "yellow");
        map.put("hospitalName", workorderDO.getHospitalName());
        //获取服务对象
        if(StringUtils.isNotBlank(patient)){
            //获取单个居民处理完成的工单信息
            ManageSynergyWorkorderServicerDO workorderServicerDO = workorderServicerDao.findByWorkOrderCodeAndPatientCode(workorderCode, patient);
            map.put("servicerKey", workorderServicerDO.getServicePatientName());
            map.put("idcard", workorderServicerDO.getIdcard());
            map.put("ssc", workorderServicerDO.getSsc());
            map.put("completeTime", workorderServicerDO.getCompleteTime());
        }else {
            if(role == 3){
                //获取工单完成人数
                int count = workorderServicerDao.findByWorkorderCodeCount(workorderCode, 3);
                map.put("count", count);
            }
            map.put("servicerKey", workorderDO.getServicerKey());
            map.put("servicerCount", workorderDO.getServicerCount());
        }
        //超时标签
        map.put("delayStatus", this.isServiceOverTime(workorderDO.getServiceTime()));
        //根据角色显示对应工单状态
        if(workorderDO.getCreateUserType() == 1 && role == 2){
            map.put("status", "待接收");
@ -270,8 +295,11 @@ public class SynergyManageService {
            map.put("status", "未接收");
        }
        //获取负责人信息
        if(role == 3){
            //普通客服显示接收者
            map.put("receiverName", workorderDO.getReceiverName());
            map.put("receiverTime", workorderDO.getReceiverTime());
            //获取负责人信息
            List<ManageSynergyWorkorderExecutorDO> managerList = workorderExecutorDao.findByWorkorderCode(workorderCode,1);
            List<ManageSynergyWorkorderExecutorDO> collaboratorList = workorderExecutorDao.findByWorkorderCode(workorderCode,2);
            String manager = managerList.size()>0 ? managerList.get(0).getExecutorName() : "";
@ -288,7 +316,6 @@ public class SynergyManageService {
            map.put("remark", workorderDO.getDealResultRemark());
            map.put("accessory", workorderDO.getDealResultAccessory());
        }
        return map;
    }
@ -340,4 +367,56 @@ public class SynergyManageService {
        }
    }
    /**
     * 将管理员接收或者退回操作存入数据库
     * @param code
     * @param user
     * @param jsonData
     * @param status
     */
    public void dealWorkOrder(String code, User user, String jsonData, Integer status) {
        ManageSynergyWorkorderDO workorderDO = workOrderDao.findByCode(code);
        workorderDO.setStatus(status);
        workorderDO.setReceiverType(user.getType());
        workorderDO.setReceiverCode(user.getCode());
        workorderDO.setReceiverName(user.getName());
        JSONObject jsonObject = new JSONObject(jsonData);
        if(status == 4){
            workorderDO.setReturnedRemark(jsonObject.getString("returnedRemark"));
        }else if(status == 2){
            //创建负责人信息
            List<ManageSynergyWorkorderExecutorDO> list = new ArrayList<>();
            String manager = jsonObject.getString("manager");
            String[] managers = manager.split(",");
            for(String m : managers){
                ManageSynergyWorkorderExecutorDO executorDO = new ManageSynergyWorkorderExecutorDO();
                User u = userDao.findByCode(m);
                executorDO.setCode(getCode());
                executorDO.setWorkorderCode(code);
                executorDO.setExecutorType(1);
                executorDO.setExecutorCode(m);
                executorDO.setExecutorName(u.getName());
                executorDO.setDel(1);
                list.add(executorDO);
            }
            //保存协作者信息
            String collaborator = jsonObject.getString("collaborator");
            String[] collaborators = manager.split(",");
            for(String c : collaborators){
                ManageSynergyWorkorderExecutorDO executorDO = new ManageSynergyWorkorderExecutorDO();
                User u = userDao.findByCode(c);
                executorDO.setCode(getCode());
                executorDO.setWorkorderCode(code);
                executorDO.setExecutorType(1);
                executorDO.setExecutorCode(c);
                executorDO.setExecutorName(u.getName());
                executorDO.setDel(1);
                list.add(executorDO);
            }
            workorderExecutorDao.save(list);
        }
        workOrderDao.save(workorderDO);
    }
}

+ 7 - 3
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/imm/ChildVaccinImmuneService.java

@ -81,11 +81,14 @@ public class ChildVaccinImmuneService extends BaseService {
									if (count>0 && childImmuneVaccin.getIsOut()==1){
										if (DateUtil.getPreDays(childImmuneVaccin.getJzrq(),7).before(new Date())){
											//过了预约时间7天,更新为isOut=0,则不能预约了
											childImmuneVaccinDao.updateIsOutByCode(childImmuneVaccin.getCode());
											//childImmuneVaccinDao.updateIsOutByCode(childImmuneVaccin.getCode());
											String uSql ="UPDATE wlyy_child_immune_vaccin SET is_out=0  AND `code`='"+childImmuneVaccin.getCode()+"'";
											jdbcTemplate.update(uSql);
										}else {
											//判断是否过了7天提醒时间
											if (childImmuneVaccin.getAlert_tag()==1 && DateUtil.getPreDays(childImmuneVaccin.getAlert_time(),7).before(new Date())){
												childImmuneVaccinDao.updateAlertTagByCode(childImmuneVaccin.getCode());
											if (childImmuneVaccin.getAlert_tag()==1 && DateUtil.getPreDays(childImmuneVaccin.getAlert_time(),7).before(new Date())) {
												String updateSql = "UPDATE wlyy_child_immune_vaccin SET alert_tag=0  AND `code`='" + childImmuneVaccin.getCode() + "'";
												jdbcTemplate.update(updateSql);
											}
										}
									}
@ -111,6 +114,7 @@ public class ChildVaccinImmuneService extends BaseService {
										childImmuneVaccin.setIdcard(String.valueOf(map.get("idcard")));
										childImmuneVaccin.setSsc(String.valueOf(map.get("ssc")));
										childImmuneVaccin.setBarcode(barcode);
										childImmuneVaccin.setChildInfoCode(String.valueOf(map.get("code")));
										childImmuneVaccin.setYmkc(vaccinJsonJSONArray.getJSONObject(j).getString("ymkc"));
										childImmuneVaccin.setYmmc(vaccinJsonJSONArray.getJSONObject(j).getString("ymmc"));
										childImmuneVaccin.setYmkcsm(vaccinJsonJSONArray.getJSONObject(j).getString("ymkcsm"));

+ 43 - 0
patient-co/patient-co-wlyy/doc/技术文档/es/可预约疫苗提醒日志新增索引

@ -0,0 +1,43 @@
创建索引
POST  http://172.19.103.68:9200/wlyy_patient_remind_record
查询索引
GET http://172.19.103.68:9200/wlyy_patient_remind_record/
给索引加mapping
POST http://172.19.103.68:9200/wlyy_patient_remind_record/wlyy_patient_remind_record/_mapping
{
    "wlyy_patient_remind_record": {
            "properties": {
				"code": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "patient": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "patientName": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "doctor": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "doctorName": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "remindType": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "status": {
                    "type": "string",
                    "index": "not_analyzed"
                },
                "createTime": {
                    "type": "date"
                }
            }
        }
  }

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/imm/ChildFamilyImmuneDao.java

@ -19,4 +19,6 @@ public interface ChildFamilyImmuneDao extends PagingAndSortingRepository<ChildFa
	
	@Query("select p from ChildFamilyImmune p where p.childCode = ?1 and p.familyCode = ?2 and p.del = 0")
	ChildFamilyImmune findByfaAndChildCodeAndFamilyCode(String childcode,String familycode);
	List<ChildFamilyImmune> findByChildCode(String childCode);
}

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/imm/ChildImmuneVaccinDao.java

@ -15,7 +15,7 @@ import java.util.List;
public interface ChildImmuneVaccinDao extends PagingAndSortingRepository<ChildImmuneVaccin, Long>,
		JpaSpecificationExecutor<ChildImmuneVaccin> {
	@Query("select p from ChildImmuneVaccin p where p.barcode=?1")
	ChildImmuneVaccin getChildImmuneVaccinByBarcode(String barcode);
	List<ChildImmuneVaccin> getChildImmuneVaccinByBarcode(String barcode);
	List<ChildImmuneVaccin> findByBarcodeAndYmbmAndJzzc(String barcode,String ymbm,String jzzc);
@ -30,6 +30,6 @@ public interface ChildImmuneVaccinDao extends PagingAndSortingRepository<ChildIm
	int updateIsOutByCode(String code);
	@Modifying
	@Query("update ChildImmuneVaccin  c set c.alert_tag=0 where c.code=?1")
	int updateAlertTagByCode(String code);
	@Query("update ChildImmuneVaccin  c set c.alert_tag=?2 where c.code=?1")
	int updateAlertTagByCode(String code,int tag);
}

+ 13 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java

@ -60,13 +60,13 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("update Message a set a.read = 0 where a.receiver = ?1 and a.sender=?2 and a.tzType=?3")
    int updateHealthIndexMessageByPatient(String doctor, String patient, String type);
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2,6,7,12,101,14,15,16,17,18,19,20,21,22,23,24) order by a.czrq desc")
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2,6,7,12,101,14,15,16,17,18,19,20,21,22,23,24,25,26,27) order by a.czrq desc")
    List<Message> getSystemMessageUnread(String doctor);
    @Query("select a from Message a where a.receiver = ?1 and a.prescriptionStatus=?2 and a.type in (6,7) order by a.createTime desc")
    List<Message> getSysTemMessageByPrescription(String doctor, String prescriptionStatus);
    @Query("select a from Message a where a.receiver = ?1 and a.type not in (1,2,6,7,12,101,14,15,301,16,17,18,19,20,21,22,23,24) and (a.del = '1' or a.del is null) ")
    @Query("select a from Message a where a.receiver = ?1 and a.type not in (1,2,6,7,12,101,14,15,301,16,17,18,19,20,21,22,23,24,25,26,27) and (a.del = '1' or a.del is null) ")
    List<Message> getSystemMessage(String doctor, Pageable pageRequest);
    @Query("select a from Message a where a.receiver = ?1 and a.type=?2 and a.prescriptionStatus='0' ")
@ -170,4 +170,15 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Modifying
    int setSpecialistReadById(Long id);
    @Query("select a from Message a where a.read = 1 and a.receiver = ?1 and a.state = 1 and a.type in (24,25,26,27) order by a.czrq desc")
    List<Message> getSynergyService(String receiver);
    @Query("select a from Message a where  a.receiver = ?1 and a.state = 1 and a.type in (24,25,26,27) order by a.czrq desc")
    List<Message> getSynergyMessages(String receiver,Pageable pageable);
    @Query("update Message a set a.read = 0 where a.receiver = ?1 and a.type in (24,25,26,27)")
    @Modifying
    int setSynergyMessagesByRead(String doctor);
}

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/family/FamilyMemberService.java

@ -1150,7 +1150,7 @@ public class FamilyMemberService extends BaseService {
        }
        fm.setFamilyRelation(relation);
        fm.setCzrq(new Date());
        fm.setIsAuthorize(1);//默认授权
        fm.setIsAuthorize(0);//默认授权
        // 添加对方与自己的关系
        PatientFamilyMember fmt = memberDao.findByPatientAndFamilyMember(member, patient);
@ -1166,7 +1166,7 @@ public class FamilyMemberService extends BaseService {
        int relationTrans = familyRelationTrans(p, relation);
        fmt.setFamilyRelation(relationTrans);
        fmt.setCzrq(new Date());
        fmt.setIsAuthorize(1);//默认授权
        fmt.setIsAuthorize(0);//默认授权
        memberDao.save(fm);
        memberDao.save(fmt);

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/CreditLogService.java

@ -119,7 +119,7 @@ public class CreditLogService {
        object.put("filter",patientIds.toArray());
        object.put("page",page);
        object.put("size",size);
        String url = getBaseUrl() + "selectByRanking";
        String url = /*getBaseUrl()*/"http://localhost:10051/svr-health-bank/" + "selectByRanking";
        String response = null;
        JSONArray data =null;
        JSONObject object1 = null;
@ -288,7 +288,7 @@ public class CreditLogService {
        object.put("name",patient.getName());
        object.put("idCard",patient.getIdcard());
        String response = null;
        String url =getBaseUrl() + "selectAccount";
        String url =/*getBaseUrl()*/"http://localhost:10051/svr-health-bank/" + "selectAccount";
        Map<String,String> params = new HashMap<>();
        params.put("creditsDetail",object.toJSONString());
        try {

+ 44 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java

@ -279,6 +279,20 @@ public class MessageService extends BaseService {
            specialistMesJson.put("amount", 0);
        }
        List<Message> synergyList = new ArrayList<>();
        synergyList = messageDao.getSynergyService(doctor);
        JSONObject synergyMesJson = new JSONObject();
        if (synergyList != null && synergyList.size() > 0) {
            synergyMesJson.put("amount", synergyList.size());
            JSONObject  synergyJson = new JSONObject();
            synergyJson.put("title", synergyList.get(0).getTitle());
            synergyJson.put("type", synergyList.get(0).getType());
            synergyJson.put("msg", "您有"+synergyList.size()+"个专科服务消息,请查看!");
            synergyJson.put("msgTime", DateUtil.dateToStrLong(synergyList.get(0).getCreateTime()));
            synergyMesJson.put("lastMessage", synergyJson);
        }else{
            synergyMesJson.put("amount", 0);
        }
        JSONObject json = new JSONObject();
        json.put("imMsgCount", getImMsgAmount(doctor));//IM消息数量
@ -291,6 +305,7 @@ public class MessageService extends BaseService {
        json.put("deviceUnbind",deviceMesJson);//设备解绑消息
        json.put("familyList",familyMesJson);//居民签约申请
        json.put("specialistList",specialistMesJson);//专科服务消息
        json.put("synergyList",synergyMesJson);//协同服务消息
        return json;
    }
@ -1055,4 +1070,33 @@ public class MessageService extends BaseService {
        }
    }
    /**
     * 获取协同服务消息
     *
     * @param message
     * @param page
     * @param size
     * @return
     * @throws Exception
     */
    public List<Message> getSynergyMessages(Message message, Integer page, Integer size) throws Exception{
        // 排序
        Sort sort = new Sort(Sort.Direction.DESC,"createTime");
        // 分页信息
        Pageable pageRequest = new PageRequest(page - 1, size, sort);
        return messageDao.getSynergyMessages(message.getReceiver(),pageRequest);
    }
    /**
     * 设置协同消息一键已读
     *
     * @param doctor
     * @return
     */
    public Integer setSynergyMessagesByRead(String doctor) {
      return   messageDao.setSynergyMessagesByRead(doctor);
    }
}

+ 10 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/survey/SurveyScreenResultService.java

@ -1123,7 +1123,17 @@ public class SurveyScreenResultService extends BaseService {
     */
    public String createWorkOrder(String jsonData, List<Map<String, Object>> patientInfo, String doctor) throws Exception {
        JSONObject object = new JSONObject(jsonData);
        //获取关联业务名称
        if(object.getInt("type") == 4){
            Survey survey = surveyDao.findById(object.getString("relationCode"));
            object.put("relationCodeName", survey.getTitle());
        }else if(object.getInt("type") == 5){
            SurveyTemplates templates = surveyTemplatesDao.findById(object.getString("relationCode"));
            object.put("relationCodeName", templates.getTitle());
        }
        Doctor d = doctorService.findDoctorByCode(doctor);
        object.put("hospital", d.getHospital());
        object.put("hospitalName", d.getHospitalName());
        object.put("createUser", d.getCode());
        object.put("createUserName", d.getName());
        object.put("createUserType", 1);

+ 152 - 31
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/imm/ChildFamilyImmuneService.java

@ -1,22 +1,35 @@
package com.yihu.wlyy.service.imm;
import com.yihu.es.entity.PatientRemindRecordESDO;
import com.yihu.wlyy.config.es.ElasticFactory;
import com.yihu.wlyy.config.es.ElastricSearchSave;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.imm.ChildFamilyImmune;
import com.yihu.wlyy.entity.imm.ChildImmuneVaccin;
import com.yihu.wlyy.entity.imm.ChildInfo;
import com.yihu.wlyy.entity.wechat.WechatTemplateConfig;
import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.imm.ChildFamilyImmuneDao;
import com.yihu.wlyy.repository.imm.ChildImmuneVaccinDao;
import com.yihu.wlyy.repository.imm.ChildInfoDao;
import com.yihu.wlyy.repository.wechat.WechatTemplateConfigDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.third.guahao.ImmuneService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
import io.searchbox.client.JestClient;
import org.apache.commons.lang.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.sql.Array;
import java.util.*;
/**
@ -26,7 +39,9 @@ import java.util.*;
 */
@Service
public class ChildFamilyImmuneService extends BaseService {
	
	private static org.slf4j.Logger logger = LoggerFactory.getLogger(ChildFamilyImmuneService.class);
	@Autowired
	private ChildFamilyImmuneDao childFamilyImmuneDao;
	@Autowired
@ -37,7 +52,23 @@ public class ChildFamilyImmuneService extends BaseService {
	private ChildImmuneVaccinDao childImmuneVaccinDao;
	@Autowired
	private ImmuneService immuneService;
	
	@Autowired
	private ElasticFactory elasticFactory;
	@Autowired
	private ElastricSearchSave elastricSearchSave;
	@Value("${es.type.patientRemindRecord}")
	private String esType;
	@Value("${es.index.patientRemindRecord}")
	private String esIndex;
	@Autowired
	private WechatTemplateConfigDao templateConfigDao;
	@Autowired
	private DoctorDao doctorDao;
	@Autowired
	private PushMsgTask pushMsgTask;
	@Autowired
	private WeiXinAccessTokenUtils weiXinAccessTokenUtils;
	/**
	 * 绑定家庭成员免疫关系
	 * @param childInfo
@ -48,30 +79,30 @@ public class ChildFamilyImmuneService extends BaseService {
	 */
	@Transactional
	public void addFamilyMembers(ChildInfo childInfo, String uid, String idcard, String ssc,Integer relation) throws Exception {
		
		ChildFamilyImmune childFamilyImmune = new ChildFamilyImmune();
		if(childInfo.getId() == null){
			childInfoDao.save(childInfo);
		}else{
			childFamilyImmune = childFamilyImmuneDao.findByfaAndChildCodeAndFamilyCode(childInfo.getCode(),uid);
			
			if(childFamilyImmune == null){
				childFamilyImmune = new ChildFamilyImmune();
			}else{
				throw new Exception("您已绑定过该新生儿,无法重复绑定");
			}
		}
		
		childFamilyImmune.setCode(UUID.randomUUID().toString());
		childFamilyImmune.setChildCode(childInfo.getCode());
		childFamilyImmune.setFamilyCode(uid);
		childFamilyImmune.setDel(0);
		childFamilyImmune.setCreate_time(new Date());
		childFamilyImmune.setRelation(relation);
		
		childFamilyImmuneDao.save(childFamilyImmune);
	}
	
	/**
	 * 获取家人免疫关系成员列表
	 * @param repUID
@ -90,11 +121,11 @@ public class ChildFamilyImmuneService extends BaseService {
				"from wlyy_child_family_immune a " +
				"join wlyy_child_info b on b.code = a.child_code and b.del = 0 " +
				"where a.del = 0 and a.family_code = '"+repUID+"'";
		
		List<Map<String, Object>> rs = jdbcTemplate.queryForList(sql);
		return rs;
	}
	
	/**
	 * 获取签约居民待接种疫苗列表
	 * @param doctorcode
@ -114,16 +145,124 @@ public class ChildFamilyImmuneService extends BaseService {
		List<Map<String, Object>> rs = jdbcTemplate.queryForList(sql);
		return rs;
	}
	
	/**
	 * 根据免疫条码获取待接种免疫记录
	 * @param barcode
	 * @return
	 */
	public ChildImmuneVaccin getChildImmuneVaccinByBarcode(String barcode){
	public List<ChildImmuneVaccin> getChildImmuneVaccinByBarcode(String barcode){
		return childImmuneVaccinDao.getChildImmuneVaccinByBarcode(barcode);
	}
	public boolean alertImmVacclinByChildInfoCodes(String alertDataJsonStr, String doctor)throws Exception{
		if (StringUtils.isEmpty(alertDataJsonStr)){
			return false;
		}
		Doctor doctorObj = doctorDao.findByCode(doctor);
		String doctorName = "";
		String doctorLevel = "";
		if (doctorObj!=null){
			doctorName = doctorObj.getName();
			if (doctorObj.getLevel()==1) {
				doctorLevel="专科";
			}
			if (doctorObj.getLevel()==2) {
				doctorLevel="全科";
			}
			if (doctorObj.getLevel()==3){
				doctorLevel="健管";
			}
		}
		List<PatientRemindRecordESDO> patientRemindRecordESDOList = new ArrayList<>();
		JSONArray jsonArray = new JSONArray(alertDataJsonStr);
		for (int i=0;i<jsonArray.length();i++){
			JSONObject jsonObject = jsonArray.getJSONObject(i);
			String childCode = jsonObject.getString("childCode");
			String childName = jsonObject.getString("childName");
			String vaccinName = jsonObject.getString("vaccinName");
			String vaccinCode = jsonObject.getString("vaccinCode");
			String sql ="SELECT" +
					" cfi.relation," +
					" p.`code`," +
					" p.`name`," +
					" p.openid" +
					" FROM" +
					" wlyy_child_family_immune cfi" +
					" LEFT JOIN wlyy_patient p ON cfi.family_code = p.`code`" +
					" WHERE" +
					" cfi.child_code = '"+childCode+"'" +
					" AND cfi.del = 0 and (p.openid is not null or p.openid !='')";
			List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
			List<String> openIdList = new ArrayList<>();
			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")))){
						boolean flag =true;
						try {
							WechatTemplateConfig temp = templateConfigDao.findByScene("template_deal_with", "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("remark", temp.getRemark());
							json.put("first", temp.getFirst().replace("key1",String.valueOf(map.get("name"))).replace("key2", childName).replace("key3",vaccinName));
							logger.info("weiTempJOSN:"+json.toString());
							pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 24,String.valueOf(map.get("openid")) , String.valueOf(map.get("name")), json);
						}catch (Exception e){
							e.printStackTrace();
							flag = false;
						}
						//发送微信消息并且插入一条es提醒数据
						PatientRemindRecordESDO patientRemindRecordESDO =  new PatientRemindRecordESDO();
						patientRemindRecordESDO.setCode(getCode());
						patientRemindRecordESDO.setPatient(String.valueOf(map.get("code")));
						patientRemindRecordESDO.setPatientName(String.valueOf(map.get("name")));
						patientRemindRecordESDO.setDoctor(doctor);
						patientRemindRecordESDO.setDoctorName(doctorName);
						patientRemindRecordESDO.setCreateDate(new Date());
						patientRemindRecordESDO.setRemindType(1);
						if (flag) {
							patientRemindRecordESDO.setStatus(1);
							String update="UPDATE wlyy_child_immune_vaccin SET alert_tag=1,alert_time='"+DateUtil.dateToStr(new Date(),DateUtil.YYYY_MM_DD_HH_MM_SS)+"' where `code`='"+vaccinCode+"'";
							jdbcTemplate.update(update);
						}else {
							patientRemindRecordESDO.setStatus(0);
						}
						patientRemindRecordESDOList.add(patientRemindRecordESDO);
					}
				}
			}
		}
		//保存到es的提醒日志表中
		return esSavePatientRemindRecord(patientRemindRecordESDOList);
	}
	public boolean esSavePatientRemindRecord(List<PatientRemindRecordESDO> patientRemindRecordESDOList)throws Exception{
		JestClient jestClient = null;
		boolean flag = true;
		try {
			jestClient = elasticFactory.getJestClient();
			if(patientRemindRecordESDOList != null && patientRemindRecordESDOList.size()>0){
				flag = elastricSearchSave.save(patientRemindRecordESDOList, esIndex, esType);
			}
		}catch (Exception e){
			e.printStackTrace();
			flag = false;
		} finally{
			if (jestClient != null) {
				jestClient.shutdownClient();
			}
		}
		return  flag;
	}
	@Transactional(rollbackFor = Exception.class)
	public int getChildImmuneVaccinEveryDay()throws Exception{
		int result = 0;
@ -175,7 +314,7 @@ public class ChildFamilyImmuneService extends BaseService {
										}else {
											//判断是否过了7天提醒时间
											if (childImmuneVaccin.getAlert_tag()==1 && DateUtil.getPreDays(childImmuneVaccin.getAlert_time(),7).before(new Date())){
												childImmuneVaccinDao.updateAlertTagByCode(childImmuneVaccin.getCode());
												childImmuneVaccinDao.updateAlertTagByCode(childImmuneVaccin.getCode(),0);
											}
										}
									}
@ -201,6 +340,7 @@ public class ChildFamilyImmuneService extends BaseService {
										childImmuneVaccin.setIdcard(String.valueOf(map.get("idcard")));
										childImmuneVaccin.setSsc(String.valueOf(map.get("ssc")));
										childImmuneVaccin.setBarcode(barcode);
										childImmuneVaccin.setChildInfoCode(String.valueOf(map.get("code")));
										childImmuneVaccin.setYmkc(vaccinJsonJSONArray.getJSONObject(j).getString("ymkc"));
										childImmuneVaccin.setYmmc(vaccinJsonJSONArray.getJSONObject(j).getString("ymmc"));
										childImmuneVaccin.setYmkcsm(vaccinJsonJSONArray.getJSONObject(j).getString("ymkcsm"));
@ -221,25 +361,6 @@ public class ChildFamilyImmuneService extends BaseService {
									}
								}
								childImmuneVaccinDao.save(vaccins);
							/*for (int j=0;j<vaccinJsonJSONArray.length();j++){
								String ymbm = vaccinJsonJSONArray.getJSONObject(j).getString("ymBm");
								String jzzc = vaccinJsonJSONArray.getJSONObject(j).getString("jzZc");
								if (childImmuneVaccinDao.findByBarcodeAndYmbmAndJzzc(barcode,ymbm,jzzc)==null){
									ChildImmuneVaccin childImmuneVaccin = new ChildImmuneVaccin();
									childImmuneVaccin.setCode(getUUID());
									childImmuneVaccin.setName(String.valueOf(map.get("name")));
									childImmuneVaccin.setIdcard(String.valueOf(map.get("idcard")));
									childImmuneVaccin.setSsc(String.valueOf(map.get("ssc")));
									childImmuneVaccin.setBarcode(barcode);
									childImmuneVaccin.setYmkc(vaccinJsonJSONArray.getJSONObject(j).getString("ymkc"));
									childImmuneVaccin.setYmmc(vaccinJsonJSONArray.getJSONObject(j).getString("ymmc"));
									childImmuneVaccin.setYmkcsm(vaccinJsonJSONArray.getJSONObject(j).getString("ymkcsm"));
									childImmuneVaccin.setYmbm(ymbm);
									childImmuneVaccin.setJzzc(jzzc);
									childImmuneVaccin.setAlert_tag(0);
									childImmuneVaccin.setCreate_time(new Date());
								}
							}*/
							}
						}
					}

+ 23 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistEvaluateSevice.java

@ -183,10 +183,10 @@ public class SpecialistEvaluateSevice extends BaseService {
    }
    /**
     * 发送消息 type:19 受理提醒,20 待办工作提醒 21 服务进展提醒-已完成 22 服务进展提醒-未完成 23 服务进展提醒-待完成
     * 发送消息 type:19 受理提醒,20 待办工作提醒 21 服务进展提醒-已完成 22 服务进展提醒-未完成 23 服务进展提醒-待完成 24 收到协同任务 25 在线助手已接收 26 在线助手已退回 27 协同服务已完成
     */
    public JSONObject sendMessage(Message message,String hospitalCode,String patientCode,Integer num){
    public JSONObject sendMessage(Message message,String hospitalCode,String patientCode,Integer num,JSONObject jsonObject){
        JSONObject object = new JSONObject();
        try {
            Hospital hospital = null;
@ -225,6 +225,26 @@ public class SpecialistEvaluateSevice extends BaseService {
                message.setType(23);
                message.setTitle("康复计划-服务进展提醒");
                message.setContent("您的"+patient.getName()+"签约居民今日有"+num+"个康复计划项目待完成,请尽快处理");
            }else if (message.getType() == 24){
                message.setOver("1");
                message.setType(24);
                message.setTitle("收到协同任务");
                message.setContent("您接收到“"+jsonObject.getString("type")+"”协同服务:"+jsonObject.getString("content").substring(0,19));
            }else if (message.getType() == 25){
                message.setOver("1");
                message.setType(25);
                message.setTitle("在线助手已接收");
                message.setContent("您发起的“"+jsonObject.getString("type")+"”协同服务,已被在线助手接收,负责人:"+jsonObject.getString("customerName")+",联系方式:"+jsonObject.getString("phone")+"。");
            }else if (message.getType() == 26){
                message.setOver("1");
                message.setType(26);
                message.setTitle("在线助手已退回");
                message.setContent("您发起的“"+jsonObject.getString("type")+"”协同服务,已被在线助手退回。原因:"+jsonObject.getString("returnedRemark"));
            }else if (message.getType() == 27){
                message.setOver("1");
                message.setType(27);
                message.setTitle("协同服务已完成");
                message.setContent("您发起的“"+jsonObject.getString("type")+"”协同服务,已完成。");
            }
            message.setCode(getCode());
//            message.setSenderName(sendDoctor.getName());
@ -247,4 +267,5 @@ public class SpecialistEvaluateSevice extends BaseService {
        return object;
    }
}

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/rehabilitation/RehabilitationManageService.java

@ -629,7 +629,7 @@ public class RehabilitationManageService extends BaseService {
            message.setSender(patient);
            message.setReceiver(doctor);
            message.setRelationCode(planDetailId);
            specialistEvaluateSevice.sendMessage(message,hospotal,patient,null);
            specialistEvaluateSevice.sendMessage(message,hospotal,patient,null,null);
            //发送微信模板消息
            int evaluation = object.getInt("evaluation");
            if (evaluation == 1){
@ -703,7 +703,7 @@ public class RehabilitationManageService extends BaseService {
            message1.setType(type);
            message1.setReceiver(doctor);
            message1.setRelationCode(planDetailIds);
            specialistEvaluateSevice.sendMessage(message1,null,patient,num);
            specialistEvaluateSevice.sendMessage(message1,null,patient,num,null);
        }
    }
@ -802,7 +802,7 @@ public class RehabilitationManageService extends BaseService {
            message1.setType(type);
            message1.setReceiver(doctor);
            message1.setRelationCode(planDetailIds);
            specialistEvaluateSevice.sendMessage(message1,hospital,patient,num);
            specialistEvaluateSevice.sendMessage(message1,hospital,patient,num,null);
        }
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/rehabilitation/RehabilitationPlanService.java

@ -162,7 +162,7 @@ public class RehabilitationPlanService extends BaseService {
                    message.setType(19);
                    message.setRelationCode(detail.getString("planId"));
                    message.setReceiver(detail.getString("doctor"));
                    specialistEvaluateSevice.sendMessage(message, detail.getString("hospital"), patient, null);
                    specialistEvaluateSevice.sendMessage(message, detail.getString("hospital"), patient, null,null);
                }
            }
            return rs.getString("message");

+ 7 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/survey/ManagerQuestionnaireService.java

@ -113,7 +113,7 @@ public class ManagerQuestionnaireService extends BaseService {
        String surveyComment = jsonStr.getString("comment");
        String templateCode = null;
        String send = jsonStr.get("send").toString();
        String templateLabel = jsonStr.getString("label");
        //String templateLabel = jsonStr.getString("label");
        int status = 1;
//        自主创建
        int useType = 1;
@ -1091,6 +1091,9 @@ public class ManagerQuestionnaireService extends BaseService {
                        case 4:
                            tags[i] = "生活日常";
                            break;
                        case 5:
                            tags[i] = "评分筛查";
                            break;
                    }
                }
@ -1143,6 +1146,9 @@ public class ManagerQuestionnaireService extends BaseService {
                        case 4:
                            tags[i] = "生活日常";
                            break;
                        case 5:
                            tags[i] = "评分筛查";
                            break;
                    }
                }
                map.put("title", title);

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

@ -148,14 +148,26 @@ public class DoctorImmController extends BaseController {
			return error(-1, "查询失败");
		}
	}
	@RequestMapping(value = "/alertImmVacclinByChildInfoCodes", method = RequestMethod.POST)
	@ApiOperation(value = "医生提醒居民疫苗接种")
	public String alertImmVacclinByChildInfoCodes(@ApiParam(name = "alertDataJsonStr", value = "[{\"childCode\":\"123\",\"childName\":\"张三\",\"vaccinCode\":\"asd123\",\"vaccinName\":\"疫苗名称\"}]", defaultValue = "")
										   @RequestParam(value = "alertDataJsonStr", required = true) String alertDataJsonStr){
		try {
			childFamilyImmuneService.alertImmVacclinByChildInfoCodes(alertDataJsonStr,getUID());
			return write(200, "请求成功");
		} catch (Exception e) {
			e.printStackTrace();
			return error(-1, "查询失败");
		}
	}
	
	@RequestMapping(value = "/getPatientImmVacclin", method = RequestMethod.GET)
	@ApiOperation(value = "根据儿童免疫条码获取待接种疫苗")
	public String getPatientImmVacclin(@ApiParam(name = "barcode", value = "儿童免疫编码", defaultValue = "")
	                                       @RequestParam(value = "barcode", required = true) String barcode){
		try {
			ChildImmuneVaccin childImmuneVaccin = childFamilyImmuneService.getChildImmuneVaccinByBarcode(barcode);
			return write(200, "请求成功","data",childImmuneVaccin);
			return write(200, "请求成功","data",childFamilyImmuneService.getChildImmuneVaccinByBarcode(barcode));
		} catch (Exception e) {
			e.printStackTrace();
			return error(-1, "查询失败");

+ 53 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java

@ -692,7 +692,9 @@ public class DoctorMessageController extends BaseController {
                              @ApiParam(name = "patient",value = "居民code",required = true)
                              @RequestParam(value = "patient",required = true)String patient,
                              @ApiParam(name = "time",value = "时间",required = false)
                              @RequestParam(value = "time",required = false)Integer time) {
                              @RequestParam(value = "time",required = false)Integer time,
                              @ApiParam(name = "jsonObject",value = "参数",required = false)
                              @RequestParam(value = "jsonObject",required = false) String jsonObject){
        try {
            com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(message);
            Message message1 = new Message();
@ -700,7 +702,8 @@ public class DoctorMessageController extends BaseController {
            message1.setType(object.getInteger("type"));
            message1.setReceiver(object.getString("receiver"));
            message1.setRelationCode(object.getString("relationCode"));
            return write(200, "获取消息成功!","data",specialistEvaluateSevice.sendMessage(message1,hospital,patient,time));
            com.alibaba.fastjson.JSONObject jsonObject1 = com.alibaba.fastjson.JSONObject.parseObject(jsonObject);
            return write(200, "获取消息成功!","data",specialistEvaluateSevice.sendMessage(message1,hospital,patient,time,jsonObject1));
        } catch (Exception e) {
            error(e);
            return error(-1, "获取消息失败!");
@ -759,5 +762,53 @@ public class DoctorMessageController extends BaseController {
    }
    /**
     * 获取协同服务消息列表
     *
     * @param message
     * @param page
     * @param pageSize
     * @return
     */
    @RequestMapping(value = "getSynergyMessages",method = RequestMethod.GET)
    @ApiOperation("协同服务消息列表")
    @ResponseBody
    public String getSynergyMessage(@ApiParam(name = "message",value = "消息对象")@RequestParam(value = "message")String message,
                                       @ApiParam(name="page",value="第几页",defaultValue = "1") @RequestParam(value="page",required = true) String page,
                                       @ApiParam(name="pageSize",value="",defaultValue = "10") @RequestParam(value="pageSize",required = true) String pageSize){
        if (StringUtils.isBlank(pageSize)) {
            pageSize = "10";
        }
        if (page.equals("0")) {
            page = "1";
        }
        Message message1 = new Message();
        com.alibaba.fastjson.JSONObject object = JSON.parseObject(message);
        message1.setReceiver(getUID());
        try {
            return write(200,"查询成功!","data",messageService.getSynergyMessages(message1,Integer.valueOf(page),Integer.valueOf(pageSize)));
        }catch (Exception e){
            error(e);
            return error( -1, "查询失败!");
        }
    }
    /**
     * 设置协同消息已读
     * @return
     */
    @RequestMapping(value = "setSynergyMessagesByRead",method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("设置协同消息已读" )
    public String setSynergyMessagesByRead() {
        try {
            return write(200, "获取消息总数成功!", "data", messageService.setSynergyMessagesByRead(getUID()));
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/survey/ManagerQuestionnaireController.java

@ -612,7 +612,7 @@ public class ManagerQuestionnaireController extends WeixinBaseController {
    @RequestMapping(value = "/createWorkOrder",method = RequestMethod.POST)
    @ApiOperation(value = "创建协同服务")
    public String getAllQuestions(@ApiParam(name = "jsonData",value = "协同服务json字符串")
    public String createWorkOrder(@ApiParam(name = "jsonData",value = "协同服务json字符串")
                                      @RequestParam(value = "jsonData",required = true)String jsonData,
                                  @ApiParam(name = "labelUnitType", value = "标签类型  1:下属单位,多个用逗号分隔", required = false)
                                      @RequestParam(value = "labelUnitType", required = false, defaultValue = "") String labelUnitType,

+ 1 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/family/FamilyMemberController.java

@ -550,8 +550,7 @@ public class FamilyMemberController extends WeixinBaseController {
    public String getPatientImmVacclin(@ApiParam(name = "barcode", value = "儿童免疫编码", defaultValue = "")
                                       @RequestParam(value = "barcode", required = true) String barcode){
        try {
            ChildImmuneVaccin childImmuneVaccin = childFamilyImmuneService.getChildImmuneVaccinByBarcode(barcode);
            return write(200, "请求成功","data",childImmuneVaccin);
            return write(200, "请求成功","data",childFamilyImmuneService.getChildImmuneVaccinByBarcode(barcode));
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");

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

@ -185,12 +185,14 @@ es:
    FollowUp: wlyy_followup
    QuestionnaireWinning: wlyy_questionnaire_winning
    patientDevice: wlyy_patient_device
    patientRemindRecord: wlyy_patient_remind_record
  type:
    HealthEduArticlePatient: health_edu_article_patient
    Statistics: wlyy_quota_test
    FollowUpContent: wlyy_followup_content
    QuestionnaireWinning: wlyy_questionnaire_winning
    patientDevice: wlyy_patient_device
    patientRemindRecord: wlyy_patient_remind_record
  host:  http://172.19.103.68:9200
  tHost: 172.19.103.68:9300
  clusterName: jkzl

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

@ -183,12 +183,14 @@ es:
    Statistics: wlyy_quota_test
    QuestionnaireWinning: wlyy_questionnaire_winning
    patientDevice: wlyy_patient_device
    patientRemindRecord: wlyy_patient_remind_record
  type:
    HealthEduArticlePatient: health_edu_article_patient
    FollowUpContent: wlyy_followup_content
    Statistics: wlyy_quota_test
    QuestionnaireWinning: wlyy_questionnaire_winning
    patientDevice: wlyy_patient_device
    patientRemindRecord: wlyy_patient_remind_record
  host:  http://172.19.103.68:9200
  tHost: 172.19.103.68:9300
  clusterName: jkzl

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

@ -134,12 +134,14 @@ es:
    FollowUp: wlyy_followup
    QuestionnaireWinning: wlyy_questionnaire_winning
    patientDevice: wlyy_patient_device
    patientRemindRecord: wlyy_patient_remind_record
  type:
    HealthEduArticlePatient: health_edu_article_patient
    Statistics: wlyy_quota_prod
    FollowUpContent: wlyy_followup_content
    QuestionnaireWinning: wlyy_questionnaire_winning
    patientDevice: wlyy_patient_device
    patientRemindRecord: wlyy_patient_remind_record
  host:  http://10.95.22.155:9200,http://10.95.22.156:9200
  tHost: 10.95.22.155:9300,10.95.22.156:9300
  clusterName: jkzl

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

@ -129,12 +129,14 @@ es:
    FollowUp: wlyy_followup
    QuestionnaireWinning: wlyy_questionnaire_winning
    patientDevice: wlyy_patient_device
    patientRemindRecord: wlyy_patient_remind_record
  type:
    HealthEduArticlePatient: health_edu_article_patient
    Statistics: wlyy_quota_test
    FollowUpContent: wlyy_followup_content
    QuestionnaireWinning: wlyy_questionnaire_winning
    patientDevice: wlyy_patient_device
    patientRemindRecord: wlyy_patient_remind_record
  host:  http://172.19.103.68:9200
  tHost: 172.19.103.68:9300
  clusterName: jkzl

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/application-test.yml

@ -170,12 +170,14 @@ es:
    Statistics: wlyy_quota_test
    QuestionnaireWinning: wlyy_questionnaire_winning
    patientDevice: wlyy_patient_device
    patientRemindRecord: wlyy_patient_remind_record
  type:
    HealthEduArticlePatient: health_edu_article_patient
    FollowUpContent: wlyy_followup_content
    Statistics: wlyy_quota_test
    QuestionnaireWinning: wlyy_questionnaire_winning
    patientDevice: wlyy_patient_device
    patientRemindRecord: wlyy_patient_remind_record
  host:  http://172.19.103.68:9200
  tHost: 172.19.103.68:9300
  clusterName: jkzl