Przeglądaj źródła

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

huangwenjie 6 lat temu
rodzic
commit
92d0ea946d
21 zmienionych plików z 612 dodań i 55 usunięć
  1. 18 8
      patient-co-manage/wlyy-manage/pom.xml
  2. 1 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/config/SpringSecurityConfig.java
  3. 37 10
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/customer/CustomerQuestionnaireController.java
  4. 46 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/customer/CustomerSynergyManageController.java
  5. 5 2
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/doctor/DoctorQuestionnaireController.java
  6. 23 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/doctor/DoctorSynergyManageController.java
  7. 196 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/synergy/ManageSynergyWorkordeReminderDO.java
  8. 10 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/synergy/ManageSynergyWorkorderServicerDO.java
  9. 3 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/synergy/ManageSynergyWorkorderCustomerLogDao.java
  10. 16 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/synergy/ManageSynergyWorkorderReminderDao.java
  11. 5 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/synergy/ManageSynergyWorkorderServicerDao.java
  12. 14 0
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/synergy/ManageSynergyWorkorderServicerLogDao.java
  13. 2 3
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/QuestionnaireManageService.java
  14. 200 16
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/synergy/SynergyManageService.java
  15. 17 4
      patient-co-manage/wlyy-manage/src/main/resources/application.yml
  16. 4 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/activemq/HealthArtListener.java
  17. 8 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/survey/SurveyScreenResultService.java
  18. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java
  19. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/survey/ManagerQuestionnaireService.java
  20. 3 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/survey/DoctorSurveyScreenResultController.java
  21. 1 1
      patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

+ 18 - 8
patient-co-manage/wlyy-manage/pom.xml

@ -204,18 +204,28 @@
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.4.0</version>
            <exclusions>
                <exclusion>
                    <artifactId>classmate</artifactId>
                    <groupId>com.fasterxml</groupId>
                </exclusion>
            </exclusions>
            <version>2.7.0</version>
            <!--<exclusions>-->
                <!--<exclusion>-->
                    <!--<artifactId>classmate</artifactId>-->
                    <!--<groupId>com.fasterxml</groupId>-->
                <!--</exclusion>-->
            <!--</exclusions>-->
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>2.4.0</version>
            <version>2.7.0</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-staticdocs</artifactId>
            <version>2.6.1</version>
        </dependency>
        <dependency>
            <groupId>io.github.swagger2markup</groupId>
            <artifactId>swagger2markup</artifactId>
            <version>1.3.2</version>
        </dependency>
        <dependency>

+ 1 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/config/SpringSecurityConfig.java

@ -31,6 +31,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter {
                "/yueren/**",
                "/svr-iot/**",
                "/customer/**",
                "/doctor/**",
                "/third/**",
                "/admin/hos/doctor/importFromExcel",
                "/admin/hos/doctor/importData",

+ 37 - 10
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/customer/CustomerQuestionnaireController.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.controller.synergy.customer;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.service.synergy.QuestionnaireManageService;
import com.yihu.wlyy.service.synergy.SynergyManageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -22,19 +23,19 @@ public class CustomerQuestionnaireController extends BaseController {
    @Autowired
    private QuestionnaireManageService questionnaireService;
    @Autowired
    private SynergyManageService synergyManageService;
    @RequestMapping(value = "saveAnswer", method = RequestMethod.POST)
    @ApiOperation(value = "保存用户答案")
    public String saveAnswer( @ApiParam(value = "问卷题目及选项")@RequestParam String jsonData,
                              @ApiParam(value = "客服code")@RequestParam(value = "customerCode")String customerCode,
                              @ApiParam(value = "居民code")@RequestParam(value = "patientCode")String patientCode,
                              @ApiParam(value = "问卷标签")@RequestParam(value = "labelType")Integer labelType,
                              @ApiParam(value = "筛查入口(labelType=5时要填),0是第一次筛查 1是再次评估", defaultValue = "1")@RequestParam(value = "isAgain")int isAgain,
                              @ApiParam(value = "来源(1医生发放 2居民自我评估)")@RequestParam(value = "source")int source,
                              @ApiParam(value = "协同工单服务对象表code")@RequestParam(value = "source")String serviceCode) {
    public String saveAnswer( @ApiParam(value = "问卷题目及选项", required = true)@RequestParam String jsonData,
                              @ApiParam(value = "客服code", required = true)@RequestParam(value = "customerCode")String customerCode,
                              @ApiParam(value = "居民code", required = true)@RequestParam(value = "patientCode")String patientCode,
                              @ApiParam(value = "问卷标签", required = false)@RequestParam(value = "labelType")Integer labelType,
                              @ApiParam(value = "来源(1医生发放 2居民自我评估)", required = false, defaultValue = "1")@RequestParam(value = "source")Integer source,
                              @ApiParam(value = "协同工单服务对象表code", required = true)@RequestParam(value = "serviceCode")String serviceCode) {
        try {
            return  write(200, "保存成功!", "data", questionnaireService.saveResultAndAnswer(patientCode, labelType, customerCode, isAgain, source,jsonData, serviceCode));
            return  write(200, "保存成功!", "data", questionnaireService.saveResultAndAnswer(patientCode, labelType, customerCode, source,jsonData, serviceCode));
        } catch (Exception e) {
            e.printStackTrace();
            return write(-1, "保存失败!");
@ -43,7 +44,7 @@ public class CustomerQuestionnaireController extends BaseController {
    @RequestMapping(value = "getAnswers", method = RequestMethod.GET)
    @ApiOperation(value = "查看调查统计结果")
    public String getAnswers(@ApiParam(value = "问卷code") @RequestParam String templateCode) {
    public String getAnswers(@ApiParam(value = "问卷code", required = true) @RequestParam String templateCode) {
        try {
            return write(200, "查询成功!", "data", questionnaireService.getAnswers(templateCode));
        } catch (Exception e) {
@ -73,4 +74,30 @@ public class CustomerQuestionnaireController extends BaseController {
            return write(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "isNotException", method = RequestMethod.POST)
    @ApiOperation(value = "判断是否异常通话")
    public String isNotException(@ApiParam(value = "协同服务工单code") @RequestParam String workorderCode,
                                 @ApiParam(value = "客服code") @RequestParam String customerCode) {
        try {
            //判断是否有异常中断
            Integer count = synergyManageService.findExceptionCount(workorderCode, customerCode);
            return write(200, "查询成功!", "data", count);
        } catch (Exception e) {
            e.printStackTrace();
            return write(-1, "查询失败!");
        }
    }
    @RequestMapping(value = "loadingInfo", method = RequestMethod.GET)
    @ApiOperation(value = "载入异常工单信息")
    public String loadingInfo(@ApiParam(value = "协同服务工单code") @RequestParam String workorderCode,
                                 @ApiParam(value = "客服code") @RequestParam String customerCode) {
        try {
            return write(200, "查询成功!", "data", synergyManageService.loadingInfo(workorderCode, customerCode));
        } catch (Exception e) {
            e.printStackTrace();
            return write(-1, "查询失败!");
        }
    }
}

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

@ -4,10 +4,12 @@ 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.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@ -18,6 +20,9 @@ import java.util.Map;
/**
 * Created by 刘文彬 on 2018/9/27.
 */
@Controller
@RequestMapping(value = "/customer")
@Api(description = "集美客服系统")
public class CustomerSynergyManageController extends BaseController {
    @Autowired
@ -27,7 +32,7 @@ public class CustomerSynergyManageController extends BaseController {
    @RequestMapping(value = "/getWorkOrderInfo", method = {RequestMethod.GET, RequestMethod.POST})
    @ApiOperation(value = "获取协同服务工单信息")
    public String addCallRecord(@ApiParam(name="workorderCode",value="协同服务工单code")
    public String getWorkOrderInfo(@ApiParam(name="workorderCode",value="协同服务工单code")
                                @RequestParam(required = true)String workorderCode,
                                @ApiParam(name="patient",value="居民code")
                                @RequestParam(required = false)String patient,
@ -138,4 +143,44 @@ public class CustomerSynergyManageController extends BaseController {
            return error(-1,"取号失败");
        }
    }
    @RequestMapping(value = "/reminderList", method = RequestMethod.GET)
    @ApiOperation(value = "获取催单列表")
    public String reminderList(@ApiParam(name="userCode",value="客服code",required = false)
                               @RequestParam(required = false)String userCode,
                               @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){
        try{
            if(!StringUtils.isNotEmpty(userCode)){
                userCode = getUID();
            }
            List<Map<String,Object>> resultList = synergyManageService.reminderList(userCode,receiveType,sortType);
            return write(200,"获取成功","data", resultList);
        }catch (Exception e){
            error(e);
            return error(-1,"获取失败");
        }
    }
    @RequestMapping(value = "/workorderRate", method = RequestMethod.GET)
    @ApiOperation(value = "任务进度")
    public String workorderRate(@ApiParam(name="userCode",value="客服code",required = false)
                                @RequestParam(required = false)String userCode,
                                @ApiParam(name="workorderCode",value="协同服务工单code",required = true)
                                @RequestParam(required = true)String workorderCode){
        try{
            if(!StringUtils.isNotEmpty(userCode)){
                userCode = getUID();
            }
            Map<String,Object> resultMap = synergyManageService.workorderRate(workorderCode,userCode);
            return write(200,"获取成功","data", resultMap);
        }catch (Exception e){
            error(e);
            return error(-1,"获取失败");
        }
    }
}

+ 5 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/doctor/DoctorQuestionnaireController.java

@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import java.text.SimpleDateFormat;
import java.util.List;
/**
@ -41,8 +42,10 @@ public class DoctorQuestionnaireController extends BaseController {
                                @ApiParam(name="patientInfo",value="居民信息json字符串")
                                    @RequestParam(required = true)String patientInfo){
        try {
            ManageSynergyWorkorderDO manageSynergyWorkorderDO = objectMapper.readValue(jsonData, ManageSynergyWorkorderDO.class);
            List<ManageSynergyWorkorderServicerDO>  manageSynergyWorkorderServicerDOS = objectMapper.readValue(patientInfo, new TypeReference<List<ManageSynergyWorkorderServicerDO>>(){});
            ObjectMapper object = new ObjectMapper();
            object.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm"));
            ManageSynergyWorkorderDO manageSynergyWorkorderDO = object.readValue(jsonData, ManageSynergyWorkorderDO.class);
            List<ManageSynergyWorkorderServicerDO>  manageSynergyWorkorderServicerDOS = object.readValue(patientInfo, new TypeReference<List<ManageSynergyWorkorderServicerDO>>(){});
            return write(200,"保存成功","data",questionnaireService.createWorkOrder(manageSynergyWorkorderDO, manageSynergyWorkorderServicerDOS));
        }catch (Exception e){
            error(e);

+ 23 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/synergy/doctor/DoctorSynergyManageController.java

@ -2,10 +2,12 @@ package com.yihu.wlyy.controller.synergy.doctor;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.service.synergy.SynergyManageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@ -16,6 +18,9 @@ import java.util.Map;
/**
 * Created by 刘文彬 on 2018/9/27.
 */
@Controller
@RequestMapping(value = "/doctor/synergy")
@Api(description = "医生端-协同服务")
public class DoctorSynergyManageController extends BaseController {
    @Autowired
@ -51,4 +56,22 @@ public class DoctorSynergyManageController extends BaseController {
            return error(-1, "请求失败");
        }
    }
    @RequestMapping(value = "reminder", method = RequestMethod.POST)
    @ApiOperation("医生端-催单")
    public String reminder(@ApiParam(name = "userCode", value = "医生code", required = false)
                           @RequestParam(value = "userCode", required = false)String userCode,
                           @ApiParam(name = "workorderCode", value = "协同服务工单code", required = true)
                           @RequestParam(value = "workorderCode", required = true)String workorderCode){
        try {
            if(!StringUtils.isNotEmpty(userCode)){
                userCode = getUID();
            }
            synergyManageService.reminder(workorderCode,userCode,1);
            return write(200, "请求成功");
        }catch (Exception e){
            error(e);
            return error(-1, "请求失败");
        }
    }
}

+ 196 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/synergy/ManageSynergyWorkordeReminderDO.java

@ -0,0 +1,196 @@
package com.yihu.wlyy.entity.synergy;
import com.yihu.wlyy.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * Created by 刘文彬 on 2018/10/8.
 * 催单记录表
 */
@Entity
@Table(name = "manage_synergy_workorder_reminder")
public class ManageSynergyWorkordeReminderDO extends IdEntity {
    private String code;
    private String workorderCode;//协同服务工单code
    private String createUser;//创建人code
    private String createUserName;//创建者姓名
    private Integer createUserType;//创建人类型(1、医生,2、客服,3、客服负责人)
    private String hospital;//创建人所属机构code
    private String hospitalName;//创建人所属机构的名称
    private Date createTime;//催单时间
    private String principalCode;//负责人code
    private String principalName;//负责人姓名
    private Integer workorderType;//服务类型(0、咨询,1、健康教育,2、预约,3、随访,4、问卷调查,5、疾病筛查)
    private String relationCode;//根据workorder_type关联业务code
    private String relationCodeName;//关联业务名称
    private Date serviceTime;//服务时间
    private String servicerKey;//服务对象其中五个人
    private String workorderRemark;//备注
    private Integer dealWith;//0、未处理,1、已处理
    private Integer priority;//工单优先级(0、普通,1、加急)
    @Column(name = "code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Column(name = "workorder_code")
    public String getWorkorderCode() {
        return workorderCode;
    }
    public void setWorkorderCode(String workorderCode) {
        this.workorderCode = workorderCode;
    }
    @Column(name = "create_user")
    public String getCreateUser() {
        return createUser;
    }
    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }
    @Column(name = "create_user_name")
    public String getCreateUserName() {
        return createUserName;
    }
    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }
    @Column(name = "create_user_type")
    public Integer getCreateUserType() {
        return createUserType;
    }
    public void setCreateUserType(Integer createUserType) {
        this.createUserType = createUserType;
    }
    @Column(name = "hospital")
    public String getHospital() {
        return hospital;
    }
    public void setHospital(String hospital) {
        this.hospital = hospital;
    }
    @Column(name = "hospital_name")
    public String getHospitalName() {
        return hospitalName;
    }
    public void setHospitalName(String hospitalName) {
        this.hospitalName = hospitalName;
    }
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @Column(name = "principal_code")
    public String getPrincipalCode() {
        return principalCode;
    }
    public void setPrincipalCode(String principalCode) {
        this.principalCode = principalCode;
    }
    @Column(name = "principal_name")
    public String getPrincipalName() {
        return principalName;
    }
    public void setPrincipalName(String principalName) {
        this.principalName = principalName;
    }
    @Column(name = "workorder_type")
    public Integer getWorkorderType() {
        return workorderType;
    }
    public void setWorkorderType(Integer workorderType) {
        this.workorderType = workorderType;
    }
    @Column(name = "relation_code")
    public String getRelationCode() {
        return relationCode;
    }
    public void setRelationCode(String relationCode) {
        this.relationCode = relationCode;
    }
    @Column(name = "relation_code_name")
    public String getRelationCodeName() {
        return relationCodeName;
    }
    public void setRelationCodeName(String relationCodeName) {
        this.relationCodeName = relationCodeName;
    }
    @Column(name = "service_time")
    public Date getServiceTime() {
        return serviceTime;
    }
    public void setServiceTime(Date serviceTime) {
        this.serviceTime = serviceTime;
    }
    @Column(name = "servicer_key")
    public String getServicerKey() {
        return servicerKey;
    }
    public void setServicerKey(String servicerKey) {
        this.servicerKey = servicerKey;
    }
    @Column(name = "workorder_remark")
    public String getWorkorderRemark() {
        return workorderRemark;
    }
    public void setWorkorderRemark(String workorderRemark) {
        this.workorderRemark = workorderRemark;
    }
    @Column(name = "deal_with")
    public Integer getDealWith() {
        return dealWith;
    }
    public void setDealWith(Integer dealWith) {
        this.dealWith = dealWith;
    }
    @Column(name = "priority")
    public Integer getPriority() {
        return priority;
    }
    public void setPriority(Integer priority) {
        this.priority = priority;
    }
}

+ 10 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/entity/synergy/ManageSynergyWorkorderServicerDO.java

@ -33,6 +33,7 @@ public class ManageSynergyWorkorderServicerDO extends IdEntity {
    private String town;//区县编码
    private String townName;//区县名称
    private String relationCode;//工单类型所关联的业务code
    private String relationCodeName;//关联业务名称
    private String callCode;//通话记录code
    @Column(name = "code")
@ -214,4 +215,13 @@ public class ManageSynergyWorkorderServicerDO extends IdEntity {
    public void setWorkorderType(Integer workorderType) {
        this.workorderType = workorderType;
    }
    @Column(name = "relation_code_name")
    public String getRelationCodeName() {
        return relationCodeName;
    }
    public void setRelationCodeName(String relationCodeName) {
        this.relationCodeName = relationCodeName;
    }
}

+ 3 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/synergy/ManageSynergyWorkorderCustomerLogDao.java

@ -11,4 +11,7 @@ public interface ManageSynergyWorkorderCustomerLogDao extends PagingAndSortingRe
    @Query("select count(distinct l.callCode) from ManageSynergyWorkorderCustomerLogDO l where l.servicePatientCode=?1 ")
    Integer callNumByWorkorder(String servicePatientCode);
    @Query("select count(1) from ManageSynergyWorkorderCustomerLogDO cl where cl.workorderCode = ?1 and cl.createUserCode = ?2 and cl.status = 0")
    Integer findExceptionCount(String workorderCode, String customerCode);
}

+ 16 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/synergy/ManageSynergyWorkorderReminderDao.java

@ -0,0 +1,16 @@
package com.yihu.wlyy.repository.synergy;
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkordeReminderDO;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderExecutorDO;
import java.util.List;
/**
 * Created by 刘文彬 on 2018/10/8.
 */
public interface ManageSynergyWorkorderReminderDao extends PagingAndSortingRepository<ManageSynergyWorkordeReminderDO, Long> {
    List<ManageSynergyWorkordeReminderDO> findByPrincipalCodeAndDealWith(String principalCode,Integer dealWith);
}

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

@ -18,4 +18,9 @@ public interface ManageSynergyWorkorderServicerDao extends PagingAndSortingRepos
    //根据工单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);
    @Query("select count(1) from ManageSynergyWorkorderServicerDO s where s.workorderCode=?1 and s.executorCode=?2 and s.status=?3")
    Integer countByWorkorderCodeAndExecutorCodeAndStatus(String workorderCode,String executorCode,Integer status);
    ManageSynergyWorkorderServicerDO findByCode(String code);
}

+ 14 - 0
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/repository/synergy/ManageSynergyWorkorderServicerLogDao.java

@ -0,0 +1,14 @@
package com.yihu.wlyy.repository.synergy;
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkorderServicerLogDO;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by 刘文彬 on 2018/9/30.
 */
public interface ManageSynergyWorkorderServicerLogDao extends PagingAndSortingRepository<ManageSynergyWorkorderServicerLogDO, Long> {
    @Query("select count(distinct l.servicePatientCode) from ManageSynergyWorkorderServicerLogDO l where l.workorderCode=?1 and l.followUp=2 ")
    Integer findByWorkorderCode(String workorderCode);
}

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

@ -50,7 +50,7 @@ public class QuestionnaireManageService extends BaseJpaService {
     * @return
     */
    public boolean createWorkOrder(ManageSynergyWorkorderDO workorderDO, List<ManageSynergyWorkorderServicerDO> workorderServicerDOS) {
        String servicer = null;
        String servicer = "";
        int size = workorderServicerDOS.size();
        int len = 0;
        if(size > 5){
@ -91,12 +91,11 @@ public class QuestionnaireManageService extends BaseJpaService {
     * @param patientCode
     * @param labelType
     * @param customerCode
     * @param isAgain
     * @param source
     * @param jsonData
     * @param serviceCode
     */
    public String saveResultAndAnswer(String patientCode, Integer labelType, String customerCode, int isAgain, int source, String jsonData, String serviceCode) {
    public String saveResultAndAnswer(String patientCode, Integer labelType, String customerCode, Integer source, String jsonData, String serviceCode) {
        String url = wlyyUrl + "doctor/questionnaire/saveResultAndAnswer";
        String response = "";
        Map<String, Object> params = new HashMap<>();

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

@ -1,20 +1,12 @@
package com.yihu.wlyy.service.synergy;
import com.yihu.wlyy.entity.Patient;
import com.yihu.wlyy.entity.SignFamily;
import com.yihu.wlyy.entity.SignPatientLabelInfo;
import com.yihu.wlyy.entity.User;
import com.yihu.wlyy.entity.*;
import com.yihu.wlyy.entity.synergy.ManageSynergyWorkordeReminderDO;
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.PatientDao;
import com.yihu.wlyy.repository.SignFamilyDao;
import com.yihu.wlyy.repository.SignPatientLabelInfoDao;
import com.yihu.wlyy.repository.UserDao;
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkOrderDao;
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkorderCustomerLogDao;
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkorderExecutorDao;
import com.yihu.wlyy.repository.synergy.ManageSynergyWorkorderServicerDao;
import com.yihu.wlyy.repository.*;
import com.yihu.wlyy.repository.synergy.*;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.IdCardUtil;
@ -52,13 +44,19 @@ public class SynergyManageService extends BaseJpaService {
    @Autowired
    private UserDao userDao;
    @Autowired
    private ManageSynergyWorkorderCustomerLogDao manageSynergyWorkorderCustomerLogDao;
    @Autowired
    private PatientDao patientDao;
    @Autowired
    private SignFamilyDao signFamilyDao;
    @Autowired
    private SignPatientLabelInfoDao signPatientLabelInfoDao;
    @Autowired
    private ManageSynergyWorkorderCustomerLogDao customerLogDao;
    @Autowired
    private DoctorDao doctorDao;
    @Autowired
    private ManageSynergyWorkorderReminderDao manageSynergyWorkorderReminderDao;
    @Autowired
    private ManageSynergyWorkorderServicerLogDao manageSynergyWorkorderServicerLogDao;
    /**
     * 根据服务编码获取工单
@ -392,8 +390,8 @@ public class SynergyManageService extends BaseJpaService {
            Map<String,Object> workorderMap = resultWorkorderList.get(0);
            //居民信息
            resultMap.put("mobile",workorderMap.get("mobile"));//电话号码
            resultMap.put("mobile",workorderMap.get("mobile"));//居民姓名
            Integer callNum = manageSynergyWorkorderCustomerLogDao.callNumByWorkorder(workorderMap.get("servicerCode")+"");
            resultMap.put("patientName",workorderMap.get("service_patient_name"));//居民姓名
            Integer callNum = customerLogDao.callNumByWorkorder(workorderMap.get("servicerCode")+"");
            resultMap.put("callNum",callNum);//已呼叫次数
            Patient patient =patientDao.findByCode(workorderMap.get("service_patient_code")+"");
            Integer sex = patient.getSex();
@ -531,4 +529,190 @@ public class SynergyManageService extends BaseJpaService {
            e.printStackTrace();
        }
    }
    /**
     * 查找该客服该工单是否有异常工单
     * @param workorderCode
     * @param customerCode
     * @return
     */
    public Integer findExceptionCount(String workorderCode, String customerCode) {
        return customerLogDao.findExceptionCount(workorderCode, customerCode);
    }
    public Map<String, Object> loadingInfo(String workorderCode, String customerCode) {
        Map<String,Object> resultMap = new HashMap<>();
        String sql = "SELECT s.service_patient_name, s.service_patient_code, s.`code`, s.s.hospital_name,s.town_name " +
                "from (SELECT DISTINCT r.patient,cl.workorder_code from manage_synergy_workorder_customer_log cl " +
                "LEFT JOIN manage_call_record r on cl.call_code = r.`code` " +
                "where cl.workorder_code = " + workorderCode + " and cl.create_user_code = " + customerCode + " and cl.`status` = 0 ORDER BY cl.create_time LIMIT 0,1) p " +
                "LEFT JOIN manage_synergy_workorder_servicer s on p.workorder_code = s.workorder_code and s.service_patient_code = p.patient and s.`status`=1";
        Map<String, Object> result = (Map<String, Object>) jdbcTemplate.queryForList(sql);
        String patientCode = (String) result.get("service_patient_name");
        resultMap.put("patientName", patientCode);
        resultMap.put("townName", result.get("town_name"));//所属区县
        resultMap.put("hospitalName", result.get("hospital_name"));//所属社区
        Integer callNum = customerLogDao.callNumByWorkorder((String) result.get("code"));
        resultMap.put("callNum",callNum);//已呼叫次数
        Patient patient = patientDao.findByCode(patientCode);
        Integer sex = patient.getSex();
        String sexName = "";
        if(sex==1){
            sexName="男";
        }else if(sex==2){
            sexName="女";
        }else{
            sexName="未知";
        }
        resultMap.put("sex",sexName);//性别
        Integer age = IdCardUtil.getAgeForIdcard(patient.getIdcard());
        resultMap.put("age",age);//年龄
        SignFamily signFamily = signFamilyDao.findSignByPatient(patientCode);
        resultMap.put("signDoctor", signFamily.getDoctor());//签约医生(即:工单创建医生)
        resultMap.put("healthDoctor", signFamily.getDoctorHealthName());//健管师
        List<SignPatientLabelInfo> labelDiseaseType = signPatientLabelInfoDao.findByPatientAndLabelTypeAndStatus(patientCode,  "3", 1);
        String diseaseType="";
        for(SignPatientLabelInfo one:labelDiseaseType){
            diseaseType+=","+one.getLabelName();
        }
        resultMap.put("diseaseType", StringUtils.isNotEmpty(diseaseType) ? diseaseType.substring(1) : "");//疾病类型
        List<SignPatientLabelInfo> labelHealthType = signPatientLabelInfoDao.findByPatientAndLabelTypeAndStatus(patientCode,  "2", 1);
        String healthType="";
        for(SignPatientLabelInfo one:labelHealthType){
            healthType+=","+one.getLabelName();
        }
        resultMap.put("healthType", StringUtils.isNotEmpty(healthType) ? healthType.substring(1) : "");//健康情况
        List<SignPatientLabelInfo> labelServeType = signPatientLabelInfoDao.findByPatientAndLabelTypeAndStatus(patientCode,  "2", 1);
        String serveType="";
        for(SignPatientLabelInfo one:labelServeType){
            serveType+=","+one.getLabelName();
        }
        resultMap.put("serveType", StringUtils.isNotEmpty(serveType)?serveType.substring(1) : "");//服务类型
        return resultMap;
    }
    /**
     * 任务进度
     * @param workorderCode
     * @param userCode
     */
    public Map<String,Object> workorderRate(String workorderCode,String userCode){
        Map<String,Object> resultMap = new HashMap<>();
        //完成情况
        //1、有效
        Integer validCount = workorderServicerDao.findByWorkorderCodeCount(workorderCode,3);
        resultMap.put("validCount",validCount);
        //2、无效
        resultMap.put("invalidCount",0);
        //3、总数
        ManageSynergyWorkorderDO manageSynergyWorkorder = workOrderDao.findByCode(workorderCode);
        resultMap.put("allCount",manageSynergyWorkorder.getServicerCount());
        //我已完成
        Integer myFinishedCount = workorderServicerDao.countByWorkorderCodeAndExecutorCodeAndStatus(workorderCode,userCode,3);
        resultMap.put("myFinishedCount",myFinishedCount);
        //待跟进
        Integer followCount = manageSynergyWorkorderServicerLogDao.findByWorkorderCode(workorderCode);
        resultMap.put("followCount",followCount);
        return resultMap;
    }
    /**
     * 催单
     * @param workorderCode
     * @param userCode
     * @param userType
     * @throws Exception
     */
    @Transactional
    public void reminder(String workorderCode,String userCode,Integer userType) throws Exception{
        ManageSynergyWorkorderDO manageSynergyWorkorderDO = workOrderDao.findByCode(workorderCode);
        if(manageSynergyWorkorderDO==null){
            throw new Exception();
        }
        ManageSynergyWorkordeReminderDO workordeReminderDO = new ManageSynergyWorkordeReminderDO();
        workordeReminderDO.setCode(getCode());
        workordeReminderDO.setWorkorderCode(workorderCode);
        workordeReminderDO.setCreateUser(userCode);
        //创建人类型(1、医生,2、客服,3、客服负责人)
        if(userType==1){
            Doctor doctor = doctorDao.findByCode(userCode);
            workordeReminderDO.setCreateUserName(doctor.getName());
        }else if(userType==2||userType==3){
            User user = userDao.findByCode(userCode);
            workordeReminderDO.setCreateUserName(user.getName());
        }
        workordeReminderDO.setCreateUserType(userType);
        workordeReminderDO.setHospital(manageSynergyWorkorderDO.getHospital());
        workordeReminderDO.setHospitalName(manageSynergyWorkorderDO.getHospitalName());
        workordeReminderDO.setCreateTime(new Date());
        List<ManageSynergyWorkorderExecutorDO> list = workorderExecutorDao.findByWorkorderCode(workorderCode,1);
        if(list!=null&&list.size()>0){
            workordeReminderDO.setPrincipalCode(list.get(0).getExecutorCode());
            workordeReminderDO.setPrincipalName(list.get(0).getExecutorName());
        }
        workordeReminderDO.setWorkorderType(manageSynergyWorkorderDO.getType());
        workordeReminderDO.setRelationCode(manageSynergyWorkorderDO.getRelationCode());
        workordeReminderDO.setRelationCodeName(manageSynergyWorkorderDO.getRelationCodeName());
        workordeReminderDO.setServiceTime(manageSynergyWorkorderDO!=null?manageSynergyWorkorderDO.getServiceTime():null);
        workordeReminderDO.setServicerKey(manageSynergyWorkorderDO!=null?manageSynergyWorkorderDO.getServicerKey():null);
        workordeReminderDO.setWorkorderRemark(manageSynergyWorkorderDO!=null?manageSynergyWorkorderDO.getRemark():null);
        workordeReminderDO.setDealWith(0);
        workordeReminderDO.setPriority(manageSynergyWorkorderDO.getPriority());
        manageSynergyWorkorderReminderDao.save(workordeReminderDO);
    }
    /**
     * 催单列表
     * @param userCode
     * @param receiveType 1、客服,2、客服负责人
     * @param sortType 1、升序,2、降序
     */
    public List<Map<String,Object>> reminderList(String userCode,Integer receiveType,Integer sortType){
        String sql ="";
        String sort ="";
        if(sortType==1){
            sort=" order by r.create_time asc ";
        }else if(sortType==2){
            sort=" order by r.create_time desc ";
        }
        if(receiveType==1){
            sql =" select DISTINCT r.* from manage_synergy_workorder_reminder r " +
                 " LEFT JOIN manage_synergy_workorder_executor e on r.workorder_code=e.workorder_code " +
                 " where e.executor_code='' and e.del=1 and r.deal_with=0 " +sort;
        }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>> resultList = new ArrayList<>();
        for(Map<String,Object> one:List){
            Map<String,Object> resultMap = new HashMap<>();
            resultMap.put("workorderCode",one.get("workorder_code"));
            resultMap.put("title","来自"+one.get("create_user_name")+"医生("+one.get("hospital_name")+")催单,请尽快处理(服务编号:)"+one.get("workorder_code"));//标题
            String workorderTypeName ="";
            Integer workorderType = (Integer) one.get("workorder_type");
            switch (workorderType){
                case 0: workorderTypeName="咨询";break;
                case 1: workorderTypeName="健康教育";break;
                case 2: workorderTypeName="预约";break;
                case 3: workorderTypeName="随访";break;
                case 4: workorderTypeName="问卷调查";break;
                case 5: workorderTypeName="疾病筛查";break;
            }
            resultMap.put("workorderTypeName",workorderTypeName);
            resultMap.put("workorderType",one.get("workorder_type"));
            resultMap.put("priority",one.get("priority"));
            resultMap.put("relationCodeName",one.get("relation_code_name"));
            resultMap.put("serviceTime",DateUtil.dateToStr((Date)one.get("service_time"),"yyyy-MM-dd HH:mm:ss"));
            resultMap.put("reminderTime",DateUtil.dateToStr((Date)one.get("create_time"),"yyyy-MM-dd HH:mm:ss"));
            resultMap.put("servicerKey",one.get("servicer_key"));
            resultMap.put("workorderRemark",one.get("workorder_remark"));
            Integer overTimeFlag = isServiceOverTime((Date)one.get("service_time"));
            resultMap.put("overTimeFlag",overTimeFlag);
            resultList.add(resultMap);
        }
        return resultList;
    }
}

+ 17 - 4
patient-co-manage/wlyy-manage/src/main/resources/application.yml

@ -106,7 +106,7 @@ healthbank:
#  url: http://192.168.131.133:10051/svr-health-bank/
#i健康1.0接口
wlyy:
  url: http://localhost:8080/wlyy/
  url: http://localhost:8080/
wechat:
  appId: wxd03f859efdf0873d
  appSecret: 2935b54b53a957d9516c920a544f2537
@ -165,7 +165,11 @@ es:
  host:  http://172.19.103.68:9200
  tHost: 172.19.103.68:9300
  clusterName: jkzl
pushMes:
  # 1为推送redis,0为推送消息队列
  method: 0
  # redis队列名称
  redis_prescription_title: redisPrescription
---
spring:
@ -217,7 +221,7 @@ healthbank:
  url: http://172.19.103.33:8660/svr-wlyy-health-bank/svr-health-bank/
#i健康1.0接口
wlyy:
  url: http://localhost:8080/wlyy/
  url: http://localhost:8080/
wechat:
  appId: wx1f129f7b51701428
  appSecret: 988f005d8309ed1795939e0f042431fb
@ -276,7 +280,11 @@ es:
  host:  http://172.19.103.68:9200
  tHost: 172.19.103.68:9300
  clusterName: jkzl
pushMes:
  # 1为推送redis,0为推送消息队列
  method: 0
  # redis队列名称
  redis_prescription_title: redisPrescription
---
spring:
  profiles: prod
@ -383,3 +391,8 @@ es:
  host:  http://59.61.92.90:9065,http://59.61.92.90:9067
  tHost: 59.61.92.90:9066,59.61.92.90:9068
  clusterName: jkzl
pushMes:
  # 1为推送redis,0为推送消息队列
  method: 0
  # redis队列名称
  redis_prescription_title: redisPrescription

+ 4 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/activemq/HealthArtListener.java

@ -22,6 +22,10 @@ import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
 * Created by chenweida on 2017/9/9.

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

@ -1100,13 +1100,16 @@ public class SurveyScreenResultService extends BaseService {
    //获取筛查居民信息
    public List<Map<String, Object>> initPatient(String doctor, String labelType, String serverType, Long teamCode) {
        String sql = "SELECT DISTINCT p.`code` as service_patient_code, p.`name` as service_patient_name, t1.ssc,t1.idcard,t1.mobile,t1.hospital,t1.hospital_name,h.town,h.town_name " +
        String sql = "SELECT DISTINCT p.`code` as servicePatientCode, p.`name` as servicePatientName, t1.ssc,t1.idcard,t1.mobile,t1.hospital,t1.hospital_name as hospitalName, h.town,h.town_name as townName " +
                "FROM  wlyy_sign_family t1  LEFT JOIN wlyy_patient p on p. CODE = t1.patient   " +
                "LEFT JOIN wlyy_sign_patient_label_info t2 on t2.patient = t1.patient and t2.label_type = " + labelType + " and t2.status=1 " +
                "RIGHT JOIN wlyy_sign_family_server s on s.sign_code = t1.code and s.server_type in (" + serverType + ") " +
                "RIGHT JOIN wlyy_sign_family_server s on s.sign_code = t1.code" +
                "LEFT JOIN dm_hospital h on t1.hospital = h.`code` " +
                "WHERE ( t1.doctor = ? OR t1.doctor_health = ?) AND t1. STATUS > 0  and t1.expenses_status = 1 AND t1.admin_team_code = ? " +
                "AND p.openid IS NOT NULL AND p.openid <>'' ";
        if(StringUtils.isNotBlank(serverType)){
            sql = sql.replace("on s.sign_code = t1.code", "on s.sign_code = t1.code and s.server_type in (" + serverType + ") ");
        }
        Object[] args = new Object[]{doctor, doctor, teamCode};
        List<Map<String, Object>> patientInfo = jdbcTemplate.queryForList(sql, args);
        return patientInfo;
@ -1123,6 +1126,7 @@ public class SurveyScreenResultService extends BaseService {
     */
    public String createWorkOrder(String jsonData, List<Map<String, Object>> patientInfo, String doctor) throws Exception {
        JSONObject object = new JSONObject(jsonData);
        JSONArray patientInfos = new JSONArray(patientInfo);
        //获取关联业务名称
        if(object.getInt("type") == 4){
            Survey survey = surveyDao.findById(object.getString("relationCode"));
@ -1138,10 +1142,10 @@ public class SurveyScreenResultService extends BaseService {
        object.put("createUserName", d.getName());
        object.put("createUserType", 1);
        Map<String, Object> param = new HashedMap();
        param.put("patientInfo", patientInfo.toString());
        param.put("patientInfo", patientInfos.toString());
        param.put("jsonData", object.toString());
        HttpResponse response = null;
        response = HttpUtils.doPost(customerUrl + "wlyy-manage/createWorkOrder", param);
        response = HttpUtils.doPost(customerUrl + "doctor/createWorkOrder", param);
        JSONObject rs = new JSONObject(response.getContent());
        return rs.getString("message");
    }

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -1496,7 +1496,7 @@ public class JMJkEduArticleService extends BaseService {
//    }
    public Set<String> getOpenid(Set<String> patientSet){
        Set<String> openidSet = new HashSet<>(patientSet);
        Set<String> openidSet = new HashSet<>();
        Patient one = null;
        for (String patient : patientSet) {
            one = patientDao.findByCode(patient);

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

@ -1831,7 +1831,7 @@ public class ManagerQuestionnaireService extends BaseService {
    //查询出推送居民
    public List<Map<String, Object>> initPatient(String labelUnitType, String labelSexType, String labelServerType, String labelDiseaseType, String labelHealthType, String currentUserRole, String currentUserRoleLevel) {
        String tableSql = " select p.code as service_patient_code ,w.`name` as service_patient_name,w.ssc,w.idcard,w.mobile,w.hospital,w.hospital_name,h.town,h.town_name from wlyy_sign_family w ,wlyy_admin_team t, dm_hospital h  ";
        String tableSql = " select p.code as servicePatientCode ,w.`name` as servicePatientName,w.ssc,w.idcard,w.mobile,w.hospital,w.hospital_name as hospitalName, h.town,h.town_name as townName from wlyy_sign_family w ,wlyy_admin_team t, dm_hospital h  ";
        String whereSql = " where w.status>0 and w.expenses_status=1 and w.admin_team_code=t.id and t.org_code=h.code ";
        //通过登录的角色区域权限 限制所属患者条件
@ -1928,7 +1928,7 @@ public class ManagerQuestionnaireService extends BaseService {
        param.put("patientInfo", patientInfo.toString());
        param.put("jsonData", object.toString());
        HttpResponse response = null;
        response = HttpUtils.doPost(customerUrl + "wlyy-manage/createWorkOrder", param);
        response = HttpUtils.doPost(customerUrl + "doctor/createWorkOrder", param);
        JSONObject rs = new JSONObject(response.getContent());
        return rs.getString("message");
    }

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/survey/DoctorSurveyScreenResultController.java

@ -235,9 +235,9 @@ public class DoctorSurveyScreenResultController extends WeixinBaseController {
    public String getAllQuestions(@ApiParam(name = "jsonData",value = "协同服务json字符串")
                                  @RequestParam(value = "jsonData",required = true)String jsonData,
                                  @ApiParam(name = "labelType", value = "疾病类型", defaultValue = "3")
                                  @RequestParam(value = "labelType", required = true) String labelType,
                                  @ApiParam(name = "serverType",value = "多个条件以逗号分割")
                                  @RequestParam(value = "serverType", required = true) String serverType,
                                  @RequestParam(value = "labelType", required = false) String labelType,
                                  @ApiParam(name = "serverType",value = "服务类型,多个条件以逗号分割")
                                  @RequestParam(value = "serverType", required = false) String serverType,
                                  @ApiParam(name = "teamCode",value = "行政团队id")
                                  @RequestParam(value = "teamCode", required = true) Long teamCode){
        try {

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

@ -52,7 +52,7 @@ rehabilitation:
  url: http://localhost:10055/svr-wlyy-rehabilitation/
#集美客服配置
customerService:
  url: http://172.19.103.72:8080/customer-service/
  url: http://localhost:8180/
#小程序
applets: