Prechádzať zdrojové kódy

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

# Conflicts:
#	svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doorCoach/PatientDoorCoachOrderService.java
#	svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/lifeCare/LifeCareOrderService.java
yeshijie 3 rokov pred
rodič
commit
02f890057b
22 zmenil súbory, kde vykonal 671 pridanie a 117 odobranie
  1. 4 0
      business/base-service/src/main/java/com/yihu/jw/complaint/BaseComplaintDao.java
  2. 2 2
      business/base-service/src/main/java/com/yihu/jw/complaint/BaseComplaintDictDao.java
  3. 1 1
      business/base-service/src/main/java/com/yihu/jw/complaint/BaseComplaintOperateDao.java
  4. 169 29
      business/base-service/src/main/java/com/yihu/jw/complaint/BaseComplaintService.java
  5. 14 14
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  6. 13 0
      business/base-service/src/main/java/com/yihu/jw/monitor/dao/BaseInterfaceDictDao.java
  7. 9 0
      business/base-service/src/main/java/com/yihu/jw/monitor/dao/BaseInterfaceMonitorDao.java
  8. 12 0
      business/base-service/src/main/java/com/yihu/jw/monitor/dao/BaseSourceDictDao.java
  9. 49 0
      business/base-service/src/main/java/com/yihu/jw/monitor/service/BaseInterfaceMonitorService.java
  10. 28 18
      business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java
  11. 1 1
      common/common-entity/src/main/java/com/yihu/jw/entity/base/complaint/BaseComplaintDO.java
  12. 29 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/complaint/BaseComplaintOperateLogDO.java
  13. 0 18
      common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientDO.java
  14. 49 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/system/BaseInterfaceDictDO.java
  15. 77 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/system/BaseInterfaceMonitorDO.java
  16. 40 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/system/BaseSourceDictDO.java
  17. 1 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/doorCoach/BaseDoorCoachOrderDO.java
  18. 2 2
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/dict/PrivateDictEndpoint.java
  19. 4 2
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doorCoach/DoctorDoorCoachOrderService.java
  20. 89 21
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doorCoach/PatientDoorCoachOrderService.java
  21. 26 6
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/lifeCare/LifeCareOrderService.java
  22. 52 3
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/complaint/BaseComplaintEndPoint.java

+ 4 - 0
business/base-service/src/main/java/com/yihu/jw/complaint/BaseComplaintDao.java

@ -14,4 +14,8 @@ public interface BaseComplaintDao extends PagingAndSortingRepository<BaseComplai
    @Query("select count(1) from BaseComplaintDO t where t.isDel='1' and t.status=?1 ")
    Integer getCountByStatus(String status);
    @Query("select count(1) from BaseComplaintDO t where t.isDel='1' and t.status=?1  and t.patient=?2")
    Integer getCountByStatusByPatient(String status,String patient);
}

+ 2 - 2
business/base-service/src/main/java/com/yihu/jw/complaint/BaseComplaintDictDao.java

@ -11,8 +11,8 @@ import java.util.List;
public interface BaseComplaintDictDao extends PagingAndSortingRepository<BaseComplaintDictDO, String>, JpaSpecificationExecutor<BaseComplaintDictDO> {
    @Query("from BaseComplaintDictDO t where t.isDel='1' and t.id=?1")
    BaseComplaintDictDO findById(String id);
    @Query("from BaseComplaintDictDO t where t.isDel='1' and t.name like %?1%")
    @Query("from BaseComplaintDictDO t where t.isDel='1' and t.name like %?1% order by t.createTime desc")
    List<BaseComplaintDictDO> findByName(String name);
    @Query("from BaseComplaintDictDO t where t.isDel='1'")
    @Query("from BaseComplaintDictDO t where t.isDel='1' order by t.createTime desc")
    List<BaseComplaintDictDO> findByAll();
}

+ 1 - 1
business/base-service/src/main/java/com/yihu/jw/complaint/BaseComplaintOperateDao.java

@ -9,6 +9,6 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
public interface BaseComplaintOperateDao  extends PagingAndSortingRepository<BaseComplaintOperateLogDO, String>, JpaSpecificationExecutor<BaseComplaintOperateLogDO> {
    @Query("from BaseComplaintOperateLogDO t where t.operateFrom=?1")
    @Query("from BaseComplaintOperateLogDO t where t.operateFrom=?1 and t.status='3'")
    List<BaseComplaintOperateLogDO> findbyOperateFrom(String doctor);
}

+ 169 - 29
business/base-service/src/main/java/com/yihu/jw/complaint/BaseComplaintService.java

@ -17,6 +17,8 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.MixEnvelop;
@ -57,6 +59,8 @@ public class BaseComplaintService {
    private BasePatientDao basePatientDao;
    @Autowired
    private EnterpriseService enterpriseService;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Value("${wechat.id}")
    private String wxId;
    @Value("${wechat.flag}")
@ -196,6 +200,14 @@ public class BaseComplaintService {
     * 患者举报接口
     * */
    public BaseComplaintDO patiemtComplaint(String json) throws Exception{
        WlyyHospitalSysDictDO wlyyHospitalSysDictDO= wlyyHospitalSysDictDao.findById("complaintOpenControl");
        if (wlyyHospitalSysDictDO!=null){
            if (!"1".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                throw new Exception("投诉通道已关闭");
            }
        }else {
            throw new Exception("投诉通道已关闭");
        }
        BaseComplaintDO baseComplaintDO =objectMapper.readValue(json,BaseComplaintDO.class);
        BaseComplaintDictDO baseComplaintDictDO = baseComplaintDictDao.findById(baseComplaintDO.getComplaintId());
        if (baseComplaintDictDO!=null){
@ -207,7 +219,7 @@ public class BaseComplaintService {
                baseComplaintDO.setVisitDeptName(dictHospitalDeptDO.getName());
            }
        }
        if(StringUtils.isNoneBlank(baseComplaintDO.getPatient())){
        /*if(StringUtils.isNoneBlank(baseComplaintDO.getPatient())){
            BasePatientDO basePatientDO= basePatientDao.findById(baseComplaintDO.getPatient());
            if (basePatientDO!=null){
                basePatientDO.setIdcardFront(baseComplaintDO.getIdcardFront());
@ -215,15 +227,22 @@ public class BaseComplaintService {
                basePatientDao.save(basePatientDO);
            }
        }
        }*/
        baseComplaintDO.setIsDel("1");
        baseComplaintDO.setStatus("0");
        baseComplaintDO.setCreateTime(new Date());
        baseComplaintDO=  baseComplaintDao.save(baseComplaintDO);
        BaseComplaintOperateLogDO baseComplaintOperateLogDO = new BaseComplaintOperateLogDO();
        baseComplaintOperateLogDO.setOperateFrom(baseComplaintDO.getPatient());
        baseComplaintOperateLogDO.setStatus("0");
        baseComplaintOperateLogDO.setOperateType("投诉提交");
        baseComplaintOperateLogDO.setRelationCode(baseComplaintDO.getId());
        baseComplaintOperateLogDO.setCreateTime(new Date());
        baseComplaintOperateDao.save(baseComplaintOperateLogDO);
        try {
            List<BaseComplaintDoctorDO> doctorList=baseComplaintDoctorDao.findbyComplaintId(baseComplaintDO.getComplaintId());
            for (BaseComplaintDoctorDO baseComplaintDoctorDO:doctorList){
                String url="";
                String url="https://hlwyy.xmzsh.com/hlwyy/ims-app-web/#/complaint/detail?id="+baseComplaintDO.getId();
                enterpriseService.sendTWMesByDoctor("zsyy",baseComplaintDoctorDO.getDoctor(),"投诉反馈","您收到一条投诉反馈,点击查看。",url);
            }
        }catch (Exception e){
@ -244,17 +263,19 @@ public class BaseComplaintService {
            baseComplaintOperateLogDO.setOperateTo(doctor);
            baseComplaintOperateLogDO.setComplaintTo(complaintId);
            baseComplaintOperateLogDO.setComplaintFrom(baseComplaintDO.getComplaintId());
            baseComplaintOperateLogDO.setStatus("3");
            baseComplaintOperateLogDO.setOperateType("转交");
            baseComplaintOperateLogDO.setRelationCode(id);
            baseComplaintOperateLogDO.setCreateTime(new Date());
            baseComplaintOperateDao.save(baseComplaintOperateLogDO);
            BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doctor);
            /*BaseDoctorDO baseDoctorDO = baseDoctorDao.findById(doctor);
            if (null != baseDoctorDO) {
                doctorName=baseDoctorDO.getName();
                baseComplaintDO.setAcceptorName(doctorName);
            }
            baseComplaintDO.setAcceptor(doctor);
            baseComplaintDO.setAcceptor(doctor);*/
            baseComplaintDO.setComplaintId(complaintId);
            BaseComplaintDictDO baseComplaintDictDO = baseComplaintDictDao.findById(id);
            BaseComplaintDictDO baseComplaintDictDO = baseComplaintDictDao.findById(complaintId);
            if (baseComplaintDictDO!=null){
                complaitTypeName=baseComplaintDictDO.getName();
                baseComplaintDO.setComplaintName(complaitTypeName);
@ -263,7 +284,7 @@ public class BaseComplaintService {
            try {
                List<BaseComplaintDoctorDO> doctorList=baseComplaintDoctorDao.findbyComplaintId(baseComplaintDO.getComplaintId());
                for (BaseComplaintDoctorDO baseComplaintDoctorDO:doctorList){
                    String url="";
                    String url="https://hlwyy.xmzsh.com/hlwyy/ims-app-web/#/complaint/detail?id="+baseComplaintDO.getId();
                    enterpriseService.sendTWMesByDoctor("zsyy",baseComplaintDoctorDO.getDoctor(),"投诉反馈","您收到一条投诉反馈,点击查看。",url);
                }
            }catch (Exception e){
@ -285,6 +306,13 @@ public class BaseComplaintService {
            baseComplaintDO.setAcceptor(doctor);
            baseComplaintDO.setAcceptTime(new Date());
            baseComplaintDao.save(baseComplaintDO);
            BaseComplaintOperateLogDO baseComplaintOperateLogDO = new BaseComplaintOperateLogDO();
            baseComplaintOperateLogDO.setOperateFrom(doctor);
            baseComplaintOperateLogDO.setStatus("1");
            baseComplaintOperateLogDO.setOperateType("接受");
            baseComplaintOperateLogDO.setRelationCode(id);
            baseComplaintOperateLogDO.setCreateTime(new Date());
            baseComplaintOperateDao.save(baseComplaintOperateLogDO);
        }else if ("1".equalsIgnoreCase(baseComplaintDO.getStatus())){
            throw new Exception("该工单已被接受");
        }else {
@ -311,6 +339,13 @@ public class BaseComplaintService {
                baseComplaintDO.setOperatorDeptName(baseDoctorHospitalDO.get(0).getDeptName());
            }
            baseComplaintDao.save(baseComplaintDO);
            BaseComplaintOperateLogDO baseComplaintOperateLogDO = new BaseComplaintOperateLogDO();
            baseComplaintOperateLogDO.setOperateFrom(operator);
            baseComplaintOperateLogDO.setStatus("2");
            baseComplaintOperateLogDO.setOperateType("反馈");
            baseComplaintOperateLogDO.setRelationCode(id);
            baseComplaintOperateLogDO.setCreateTime(new Date());
            baseComplaintOperateDao.save(baseComplaintOperateLogDO);
        }else if ("2".equalsIgnoreCase(baseComplaintDO.getStatus())){
            throw new Exception("该工单已被处理完成");
        }else if ("0".equalsIgnoreCase(baseComplaintDO.getStatus())){
@ -320,16 +355,12 @@ public class BaseComplaintService {
    }
    //查询投诉列表
    public MixEnvelop findComplaintList(String doctor,String status,String patientName,String patientId,String keyWord,String complaintId,
    public MixEnvelop findComplaintList(String role,String doctor,String status,String patientName,String patientId,String keyWord,String complaintId,
                                  String startTime,String endTime,Integer page ,Integer pageSize){
        MixEnvelop mixEnvelop = new MixEnvelop();
        List<BaseDoctorRoleDO>  rolelist= baseDoctorRoleDao.findByDoctorCode(doctor);
        Boolean queryAll=false;
        for (BaseDoctorRoleDO baseDoctorRoleDO:rolelist){
            if ("admin".equalsIgnoreCase(baseDoctorRoleDO.getRoleCode())){
                queryAll=true;
                break;
            }
        if ("admin".equalsIgnoreCase(role)){
            queryAll=true;
        }
        String sql="select t.id as \"id\"," +
                " t.complaint_id as \"complaintId\"," +
@ -389,6 +420,9 @@ public class BaseComplaintService {
            }else {
                return null;
            }
            if (!StringUtils.isNoneBlank(status)){
                sql+=" and t.status !='-1'";
            }
        }else {
            if (StringUtils.isNoneBlank(complaintId)){
                //sql+=" and t.complaint_id in ('"+complaint.replace(",","','")+"')";
@ -546,35 +580,141 @@ public class BaseComplaintService {
    }
    /*
    * 查询投诉数量*/
    public Map<String,Object> findComplaintCount(String doctor){
    public Map<String,Object> findComplaintCount(String doctor,String role){
        BaseComplaintDoctorDO baseComplaintDoctorDO=baseComplaintDoctorDao.findbyDoctorAndDel(doctor);
        List<BaseDoctorRoleDO>  rolelist= baseDoctorRoleDao.findByDoctorCode(doctor);
        Boolean queryAll=false;
        if (rolelist!=null&&rolelist.contains("admin")){
            queryAll=true;
        }
        Integer complaints=0;
        Integer recieve=0;
        Integer deal=0;
        if (!queryAll){
             complaints=baseComplaintDao.getCountByStatusAndComplaintId("0",baseComplaintDoctorDO.getComplaintId());
             recieve=baseComplaintDao.getCountByStatusAndComplaintId("1",baseComplaintDoctorDO.getComplaintId());
             deal=baseComplaintDao.getCountByStatusAndComplaintId("2",baseComplaintDoctorDO.getComplaintId());
        }else {
            complaints=baseComplaintDao.getCountByStatus("0");
            recieve=baseComplaintDao.getCountByStatus("1");
            deal=baseComplaintDao.getCountByStatus("2");
        Integer cacel=0;
        if (baseComplaintDoctorDO!=null){
            Boolean queryAll=false;
            if ("admin".equalsIgnoreCase(role)){
                queryAll=true;
            }
            if (!queryAll){
                complaints=baseComplaintDao.getCountByStatusAndComplaintId("0",baseComplaintDoctorDO.getComplaintId());
                recieve=baseComplaintDao.getCountByStatusAndComplaintId("1",baseComplaintDoctorDO.getComplaintId());
                deal=baseComplaintDao.getCountByStatusAndComplaintId("2",baseComplaintDoctorDO.getComplaintId());
                //cacel=baseComplaintDao.getCountByStatusAndComplaintId("-1",baseComplaintDoctorDO.getComplaintId());
            }else {
                complaints=baseComplaintDao.getCountByStatus("0");
                recieve=baseComplaintDao.getCountByStatus("1");
                deal=baseComplaintDao.getCountByStatus("2");
                cacel=baseComplaintDao.getCountByStatus("-1");
            }
        }
        Integer total = complaints+recieve+deal+cacel;
        Map map=new HashMap();
        map.put("complaints",complaints);
        map.put("recieve",recieve);
        map.put("deal",deal);
        map.put("cacel",cacel);
        map.put("total",total);
        return map;
    }
    /*
     * 查询投诉数量*/
    public Map<String,Object> findComplaintCountPatient(String patient){
        Integer complaints=0;
        Integer recieve=0;
        Integer deal=0;
        Integer cacel=0;
        complaints=baseComplaintDao.getCountByStatusByPatient("0",patient);
        recieve=baseComplaintDao.getCountByStatusByPatient("1",patient);
        deal=baseComplaintDao.getCountByStatusByPatient("2",patient);
        cacel=baseComplaintDao.getCountByStatusByPatient("-1",patient);
        Integer total = complaints+recieve+deal;
        Integer total = complaints+recieve+deal+cacel;
        Map map=new HashMap();
        map.put("complaints",complaints);
        map.put("recieve",recieve);
        map.put("deal",deal);
        map.put("cacel",cacel);
        map.put("total",total);
        return map;
    }
    public BaseComplaintDO  cancelPaitentComplaint(String id,String patient) throws  Exception{
        BaseComplaintDO baseComplaintDO = baseComplaintDao.findOne(id);
       if (baseComplaintDO!=null){
           if ("0".equalsIgnoreCase(baseComplaintDO.getStatus())){
               baseComplaintDO.setStatus("-1");
               baseComplaintDO=baseComplaintDao.save(baseComplaintDO);
               BaseComplaintOperateLogDO baseComplaintOperateLogDO = new BaseComplaintOperateLogDO();
               baseComplaintOperateLogDO.setOperateFrom(patient);
               baseComplaintOperateLogDO.setStatus("-1");
               baseComplaintOperateLogDO.setOperateType("居民撤销投诉");
               baseComplaintOperateLogDO.setRelationCode(baseComplaintDO.getId());
               baseComplaintOperateLogDO.setCreateTime(new Date());
               baseComplaintOperateDao.save(baseComplaintOperateLogDO);
           }else {
               throw new Exception("不允许撤销");
           }
       }
       return baseComplaintDO;
    }
    public List<Map<String,Object>> findComplaintOperateLog(String complaintId){
        String sql ="select t.id as \"id\"," +
                " p.name as \"complaintNameFrom\" ," +
                " n.name as \"complaintNameto\", " +
                " t.operate_from as \"operateFrom\" ," +
                " t.operate_to as \"operateTo\" ," +
                " t.cancel_by as \"cancelBy\", " +
                " t.operate_type as \"operateType\", " +
                " t.status as \"status\", " +
                " t.create_time as \"createTime\" ," +
                " t.relation_code as \"relationCode\" " +
                " from base_complaint_operate_log t left join base_complaint c" +
                " on t.relation_code=c.id" +
                " left join base_complaint_dict p on t.complaint_from= p.id" +
                " left join base_complaint_dict n on t.complaint_to=n.id where 1=1 " ;
        if (StringUtils.isNoneBlank(complaintId)){
            sql+=" and t.relation_code='"+complaintId+"'";
        }
        sql+=" order by t.create_time desc";
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
        List<WlyyHospitalSysDictDO> typeList=wlyyHospitalSysDictDao.findByDictName("complaintStatus");
        for (Map<String,Object> map:list){
            if (map.get("operateFrom")!=null){
                if (map.get("status")!=null){
                    for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:typeList){
                        if (map.get("status").toString().equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                            map.put("operateType",wlyyHospitalSysDictDO.getDictValue());
                        }
                    }
                    if ("0".equalsIgnoreCase(map.get("status").toString())||"-1".equalsIgnoreCase(map.get("status").toString())){
                        BasePatientDO basePatientDO = basePatientDao.findById(map.get("operateFrom").toString());
                        if (basePatientDO!=null){
                            map.put("operateFromName",basePatientDO.getName());
                        }
                    }else {
                        BaseDoctorDO baseDoctorDO= baseDoctorDao.findById(map.get("operateFrom").toString());
                        if (baseDoctorDO!=null){
                            map.put("operateFromName",baseDoctorDO.getName());
                        }
                        List<BaseDoctorHospitalDO> baseDoctorHospitalDO= baseDoctorHospitalDao.findByDoctorCode(map.get("operateFrom").toString());
                        if (baseDoctorHospitalDO!=null&&baseDoctorHospitalDO.size()>0){
                            map.put("operateFromDeptName",baseDoctorHospitalDO.get(0).getDeptName());
                        }
                    }
                }
            }
            if (map.get("operateTo")!=null){
                BaseDoctorDO baseDoctorDO= baseDoctorDao.findById(map.get("operateTo").toString());
                if (baseDoctorDO!=null){
                    map.put("operateToName",baseDoctorDO.getName());
                }
                List<BaseDoctorHospitalDO> baseDoctorHospitalDO= baseDoctorHospitalDao.findByDoctorCode(map.get("operateTo").toString());
                if (baseDoctorHospitalDO!=null&&baseDoctorHospitalDO.size()>0){
                    map.put("operateToDeptName",baseDoctorHospitalDO.get(0).getDeptName());
                }
            }
        }
    return list;
    }
}

+ 14 - 14
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -4383,20 +4383,20 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
        } else if("doctorRefund".equalsIgnoreCase(titelType)) {
            if ("9".equals(type)) {
                contentMsg = "您的图文复诊订单已退号。由于订单退号,诊察费将退回本院就诊卡内。";
                first = outpatientDO.getConsumerName() + ",您好!您的图文复诊已退号";
                contentMsg = "金额已退到门诊预交金。如需退款(15元)请到门诊收费处退款。";
                first = outpatientDO.getConsumerName() + ",您好!您发起的图文复诊已退号";
            }
            if ("16".equals(type)) {
                contentMsg =  "您的视频复诊订单已退号。由于订单退号,诊察费将退回本院就诊卡内。";
                first = outpatientDO.getConsumerName() + ",您好!您的视频复诊已退号";
                contentMsg =  "金额已退到门诊预交金。如需退款(15元)请到门诊收费处退款。";
                first = outpatientDO.getConsumerName() + ",您好!您发起的视频复诊已退号";
            }
            if ("1".equals(type)) {
                contentMsg =  "您的图文咨询订单已退号。由于订单退号,诊察费将退回本院就诊卡内。";
                first = outpatientDO.getConsumerName() + ",您好!您的图文咨询已退号";
                contentMsg =  "金额已退到门诊预交金。如需退款(15元)请到门诊收费处退款。";
                first = outpatientDO.getConsumerName() + ",您好!您发起的图文咨询已退号";
            }
            if ("17".equals(type)) {
                contentMsg = "您的视频咨询订单已退号。由于订单退号,诊察费将退回本院就诊卡内。";
                first = outpatientDO.getConsumerName() + ",您好!您的视频咨询已退号";
                contentMsg = "金额已退到门诊预交金。如需退款(15元)请到门诊收费处退款。";
                first = outpatientDO.getConsumerName() + ",您好!您发起的视频咨询已退号";
            }
            logger.info("doctorRefund:outpatientId="+outpatientId);
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
@ -4425,12 +4425,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }else if("systemCancelRemind".equalsIgnoreCase(titelType)){
            //超过24小时未接诊,系统取消
            if ("9".equals(type)) {
                contentMsg = "图文咨询因超时自动取消。您可重新发起。由于订单取消将不做扣费处理。";
                first = outpatientDO.getConsumerName() + ",您好!您的图文复诊因超时未接诊已取消";
                contentMsg = "由于订单取消将不做扣费处理。如需退款(15元)请到门诊收费处退款。";
                first = outpatientDO.getConsumerName() + ",您好!您的图文复诊因超过24小时未接诊已自动取消图文咨询。";
            }
            if ("16".equals(type)) {
                contentMsg = "视频咨询因超时自动取消。您可重新发起。由于订单取消将不做扣费处理。";
                first = outpatientDO.getConsumerName() + ",您好!您的视频复诊因超时未接诊已取消";
                contentMsg = "由于订单取消将不做扣费处理。如需退款(15元)请到门诊收费处退款。";
                first = outpatientDO.getConsumerName() + ",您好!您的视频复诊因超过24小时未接诊已自动取消视频咨询。";
            }
            logger.info("系统取消接诊入参:outpatientId="+outpatientId);
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;
@ -7056,8 +7056,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                String idcard = (String) outpatient.get("idcard");
                String patient_id = (String) outpatient.get("patient_id");
                outpatient.put("age", DateUtil.getAgeForIdcard(idcard));
                int patientAge = 0;
                int patientSex = 3;
                Integer patientAge = 0;
                Integer patientSex = 3;
                if (null!=outpatient.get("outPatient")){
                    BasePatientDO basePatientDO = basePatientDao.findById(outpatient.get("outPatient").toString());
                    if (null!=basePatientDO){

+ 13 - 0
business/base-service/src/main/java/com/yihu/jw/monitor/dao/BaseInterfaceDictDao.java

@ -0,0 +1,13 @@
package com.yihu.jw.monitor.dao;
import com.yihu.jw.entity.base.system.BaseInterfaceDictDO;
import com.yihu.jw.entity.base.system.BaseInterfaceMonitorDO;
import com.yihu.jw.entity.base.system.BaseSourceDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface BaseInterfaceDictDao  extends PagingAndSortingRepository<BaseInterfaceDictDO, String>, JpaSpecificationExecutor<BaseInterfaceDictDO> {
    @Query("from BaseInterfaceDictDO t where t.isDel='1' and t.interfaceName=?1")
    BaseInterfaceDictDO findByinterfaceName(String source);
}

+ 9 - 0
business/base-service/src/main/java/com/yihu/jw/monitor/dao/BaseInterfaceMonitorDao.java

@ -0,0 +1,9 @@
package com.yihu.jw.monitor.dao;
import com.yihu.jw.entity.base.message.BaseMessageDO;
import com.yihu.jw.entity.base.system.BaseInterfaceMonitorDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface BaseInterfaceMonitorDao extends PagingAndSortingRepository<BaseInterfaceMonitorDO, String>, JpaSpecificationExecutor<BaseInterfaceMonitorDO> {
}

+ 12 - 0
business/base-service/src/main/java/com/yihu/jw/monitor/dao/BaseSourceDictDao.java

@ -0,0 +1,12 @@
package com.yihu.jw.monitor.dao;
import com.yihu.jw.entity.base.system.BaseInterfaceDictDO;
import com.yihu.jw.entity.base.system.BaseSourceDictDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface BaseSourceDictDao extends PagingAndSortingRepository<BaseSourceDictDO, String>, JpaSpecificationExecutor<BaseSourceDictDO> {
    @Query("from BaseSourceDictDO t where t.isDel='1' and t.source=?1")
    BaseSourceDictDO findSourceBySource(String source);
}

+ 49 - 0
business/base-service/src/main/java/com/yihu/jw/monitor/service/BaseInterfaceMonitorService.java

@ -0,0 +1,49 @@
package com.yihu.jw.monitor.service;
import com.yihu.jw.entity.base.message.BaseMessageDO;
import com.yihu.jw.entity.base.system.BaseInterfaceDictDO;
import com.yihu.jw.entity.base.system.BaseInterfaceMonitorDO;
import com.yihu.jw.entity.base.system.BaseSourceDictDO;
import com.yihu.jw.message.dao.MessageDao;
import com.yihu.jw.monitor.dao.BaseInterfaceDictDao;
import com.yihu.jw.monitor.dao.BaseInterfaceMonitorDao;
import com.yihu.jw.monitor.dao.BaseSourceDictDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class BaseInterfaceMonitorService extends BaseJpaService<BaseInterfaceMonitorDO, BaseInterfaceMonitorDao> {
    @Autowired
    private BaseInterfaceMonitorDao baseInterfaceMonitorDao;
    @Autowired
    private BaseSourceDictDao baseSourceDictDao;
    @Autowired
    private BaseInterfaceDictDao baseInterfaceDictDao;
    public void saveInterfaceMonitor(String source ,String functionName,Integer time ,String startTime,String endTime){
        BaseInterfaceMonitorDO baseInterfaceMonitorDO = new BaseInterfaceMonitorDO();
        baseInterfaceMonitorDO.setSource(source);
        BaseSourceDictDO baseSourceDictDO=baseSourceDictDao.findSourceBySource(source);
        if (null!=baseSourceDictDO){
            baseInterfaceMonitorDO.setSourceName(baseSourceDictDO.getSourceName());
        }
        BaseInterfaceDictDO baseInterfaceDictDO=baseInterfaceDictDao.findByinterfaceName(functionName);
        if (null!=baseInterfaceDictDO){
            baseInterfaceMonitorDO.setTypeName(baseInterfaceDictDO.getInterfaceTypeName());
            baseInterfaceMonitorDO.setType(Integer.valueOf(baseInterfaceDictDO.getInterfaceType()));
        }
        baseInterfaceMonitorDO.setTime(time);
        if (StringUtils.isNotBlank(startTime)){
            baseInterfaceMonitorDO.setStartTime(DateUtil.strToDate(startTime));
        }
        if (StringUtils.isNotBlank(startTime)){
            baseInterfaceMonitorDO.setEndTime(DateUtil.strToDate(endTime));
        }
        baseInterfaceMonitorDao.save(baseInterfaceMonitorDO);
    }
}

+ 28 - 18
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -1423,7 +1423,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                }
            }
        }else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("2")||businessOrderDO.getOrderCategory().equalsIgnoreCase("3")){
        }else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("2")||businessOrderDO.getOrderCategory().equalsIgnoreCase("3")||businessOrderDO.getOrderCategory().equalsIgnoreCase("5")){
           WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode());
           wlyyOutpatientDO.setPayStatus(1);
           WlyyOutpatientDO outpatientDO = outpatientDao.save(wlyyOutpatientDO);
@ -1451,15 +1451,20 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                   age = IdCardUtil.getAgeForIdcard(patientDO.getIdcard())+"";
               }
               if (outpatientDO!=null){
                   if (outpatientDO.getType().equalsIgnoreCase("1")){
                       title = "图文复诊";
                       type="9";
                       msg = name+"("+sex+" "+age+"岁)向您发起了图文复诊,点击查看";
                   }else if (outpatientDO.getType().equalsIgnoreCase("2")){
                       title = "视频复诊";
                       type="16";
                       date = DateUtil.dateToStrLong(outpatientDO.getRegisterDate());
                       msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,点击查看";
                   if (outpatientDO.getOutpatientType().equalsIgnoreCase("2")){
                       title = "协同复诊";
                       msg = name+"("+sex+" "+age+"岁)向您发起了协同复诊,点击查看";
                   }else {
                       if (outpatientDO.getType().equalsIgnoreCase("1")){
                           title = "图文复诊";
                           type="9";
                           msg = name+"("+sex+" "+age+"岁)向您发起了图文复诊,点击查看";
                       }else if (outpatientDO.getType().equalsIgnoreCase("2")){
                           title = "视频复诊";
                           type="16";
                           date = DateUtil.dateToStrLong(outpatientDO.getRegisterDate());
                           msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,点击查看";
                       }
                   }
               }
               if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
@ -1565,7 +1570,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                    System.out.println("发送企业模板消息成功");
                }
            }
        }else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("2")||businessOrderDO.getOrderCategory().equalsIgnoreCase("3")&&0==businessOrderDO.getStatus()){
        }else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("2")||businessOrderDO.getOrderCategory().equalsIgnoreCase("3")||businessOrderDO.getOrderCategory().equalsIgnoreCase("5")&&0==businessOrderDO.getStatus()){
            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode());
            wlyyOutpatientDO.setPayStatus(1);
            WlyyOutpatientDO outpatientDO = outpatientDao.save(wlyyOutpatientDO);
@ -1585,13 +1590,18 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                    age = IdCardUtil.getAgeForIdcard(patientDO.getIdcard())+"";
                }
                if (outpatientDO!=null){
                    if (outpatientDO.getType().equalsIgnoreCase("1")){
                        title = "图文复诊";
                        msg = name+"("+sex+" "+age+"岁)向您发起了图文复诊,点击查看";
                    }else if (outpatientDO.getType().equalsIgnoreCase("2")){
                        title = "视频复诊";
                        date = DateUtil.dateToStrLong(outpatientDO.getRegisterDate());
                        msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,点击查看";
                    if (outpatientDO.getOutpatientType().equalsIgnoreCase("2")){
                        title = "协同复诊";
                        msg = name+"("+sex+" "+age+"岁)向您发起了协同复诊,点击查看";
                    }else {
                        if (outpatientDO.getType().equalsIgnoreCase("1")){
                            title = "图文复诊";
                            msg = name+"("+sex+" "+age+"岁)向您发起了图文复诊,点击查看";
                        }else if (outpatientDO.getType().equalsIgnoreCase("2")){
                            title = "视频复诊";
                            date = DateUtil.dateToStrLong(outpatientDO.getRegisterDate());
                            msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,点击查看";
                        }
                    }
                }
                if (wxId.equalsIgnoreCase("xm_zsyy_wx")){

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/base/complaint/BaseComplaintDO.java

@ -253,7 +253,7 @@ public class BaseComplaintDO  extends UuidIdentityEntity {
    }
    @Column(name = "accept_time")
    public Date getAcceptTime() {
        return acceptTime;
            return acceptTime;
    }
    public void setAcceptTime(Date acceptTime) {

+ 29 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/complaint/BaseComplaintOperateLogDO.java

@ -16,6 +16,35 @@ public class BaseComplaintOperateLogDO extends UuidIdentityEntity {
    private Date createTime;
    private String  complaintFrom;
    private String  complaintTo;
    private String  status;
    private String  operateType;
    private String  cancelBy;
    @Column(name = "cancel_by")
    public String getCancelBy() {
        return cancelBy;
    }
    public void setCancelBy(String cancelBy) {
        this.cancelBy = cancelBy;
    }
    @Column(name = "status")
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    @Column(name = "operate_type")
    public String getOperateType() {
        return operateType;
    }
    public void setOperateType(String operateType) {
        this.operateType = operateType;
    }
    @Column(name = "relation_code")
    public String getRelationCode() {
        return relationCode;

+ 0 - 18
common/common-entity/src/main/java/com/yihu/jw/entity/base/patient/BasePatientDO.java

@ -279,24 +279,6 @@ public class BasePatientDO extends UuidIdentityEntityWithOperator {
    private String bloodName;
    private String marriageName;
    private String idcardFront;
    private String idcardBack;
    @Column(name = "idcard_front")
    public String getIdcardFront() {
        return idcardFront;
    }
    public void setIdcardFront(String idcardFront) {
        this.idcardFront = idcardFront;
    }
    @Column(name = "idcard_back")
    public String getIdcardBack() {
        return idcardBack;
    }
    public void setIdcardBack(String idcardBack) {
        this.idcardBack = idcardBack;
    }
    private String latLon;//定位经纬度
    public String getCardType() {

+ 49 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/system/BaseInterfaceDictDO.java

@ -0,0 +1,49 @@
package com.yihu.jw.entity.base.system;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name = "base_interface_monitor")
public class BaseInterfaceDictDO extends UuidIdentityEntityWithCreateTime {
    private String interfaceType;
    private String interfaceTypeName;
    private String isDel;
    private String interfaceName;
    @Column(name = "interface_type")
    public String getInterfaceType() {
        return interfaceType;
    }
    public void setInterfaceType(String interfaceType) {
        this.interfaceType = interfaceType;
    }
    @Column(name = "interface_type_name")
    public String getInterfaceTypeName() {
        return interfaceTypeName;
    }
    public void setInterfaceTypeName(String interfaceTypeName) {
        this.interfaceTypeName = interfaceTypeName;
    }
    @Column(name = "is_del")
    public String getIsDel() {
        return isDel;
    }
    public void setIsDel(String isDel) {
        this.isDel = isDel;
    }
    @Column(name = "interface_name")
    public String getInterfaceName() {
        return interfaceName;
    }
    public void setInterfaceName(String interfaceName) {
        this.interfaceName = interfaceName;
    }
}

+ 77 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/system/BaseInterfaceMonitorDO.java

@ -0,0 +1,77 @@
package com.yihu.jw.entity.base.system;
import com.yihu.jw.entity.UuidIdentityEntity;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
@Entity
@Table(name = "base_interface_monitor")
public class BaseInterfaceMonitorDO extends UuidIdentityEntityWithOperator {
    private String source;
    private String sourceName;
    private Integer type;
    private String typeName;
    private Integer time;
    private Date startTime;
    private Date endTime;
    @Column(name = "source")
    public String getSource() {
        return source;
    }
    public void setSource(String source) {
        this.source = source;
    }
    @Column(name = "source_name")
    public String getSourceName() {
        return sourceName;
    }
    public void setSourceName(String sourceName) {
        this.sourceName = sourceName;
    }
    @Column(name = "type")
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
    @Column(name = "type_name")
    public String getTypeName() {
        return typeName;
    }
    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }
    @Column(name = "time")
    public Integer getTime() {
        return time;
    }
    public void setTime(Integer time) {
        this.time = time;
    }
    @Column(name = "start_time")
    public Date getStartTime() {
        return startTime;
    }
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }
    @Column(name = "end_time")
    public Date getEndTime() {
        return endTime;
    }
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
}

+ 40 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/system/BaseSourceDictDO.java

@ -0,0 +1,40 @@
package com.yihu.jw.entity.base.system;
import com.yihu.jw.entity.UuidIdentityEntityWithCreateTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
@Entity
@Table(name = "base_source_dict")
public class BaseSourceDictDO extends UuidIdentityEntityWithCreateTime {
    private String source;
    private String sourceName;
    private String isDel;
    @Column(name = "source")
    public String getSource() {
        return source;
    }
    public void setSource(String source) {
        this.source = source;
    }
    @Column(name = "source_name")
    public String getSourceName() {
        return sourceName;
    }
    public void setSourceName(String sourceName) {
        this.sourceName = sourceName;
    }
    @Column(name = "is_del")
    public String getIsDel() {
        return isDel;
    }
    public void setIsDel(String isDel) {
        this.isDel = isDel;
    }
}

+ 1 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/doorCoach/BaseDoorCoachOrderDO.java

@ -33,6 +33,7 @@ public class BaseDoorCoachOrderDO extends UuidIdentityEntityWithOperator {
     * 工单状态
     */
    public enum Status {
        //待付款 status==(1 or 2) and payWay为空
        cancel(-1, "已取消"),
        waitForSend(1, "待(调度员)派单"),

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/dict/PrivateDictEndpoint.java

@ -1,4 +1,4 @@
package com.yihu.jw.care.endpoint.dict;
package com.yihu.jw.care.endpoint.third;
import com.yihu.jw.dict.service.PrivateDictService;
import com.yihu.jw.restmodel.web.Envelop;
@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.*;
 * @Date: 2021/6/23 14:40
 */
@RestController
@RequestMapping("/endpointEy" )
@RequestMapping("/cloudCare/noLogin/endpointEy" )
@Api(tags = "关于我们-隐私策略管理", description = "关于我们-隐私策略管理")
public class PrivateDictEndpoint extends EnvelopRestEndpoint {
    @Autowired

+ 4 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doorCoach/DoctorDoorCoachOrderService.java

@ -811,7 +811,8 @@ public class DoctorDoorCoachOrderService {
                " LEFT JOIN base_patient p ON o.patient = p.id ) LEFT JOIN wlyy_consult c on o.id = c.relation_code"+
                applicationSql+" WHERE " +
                "  o.hospital = '{hospital}' and o.type != 3 " +buffer+
                " AND ( o.`status` = {status} OR -100 = {status} ) " +
                " AND ( o.`status` = {status} OR -100 = {status} ) and  not EXISTS (select id from base_door_coach_order " +
                " tt where tt.id = o.id and tt.`status` BETWEEN 1 and 2 and ISNULL(tt.pay_way) )  " +//自主预约、医生代预约未付款不展示
                " ORDER BY o.create_time desc " +
                " LIMIT {start},{end};";
@ -829,7 +830,8 @@ public class DoctorDoorCoachOrderService {
                applicationSql +
                " WHERE  " +
                "  o.hospital = '{hospital}' and o.type != 3 " +buffer+
                " AND (o.`status` = {status} or -100 = {status})";
                " AND (o.`status` = {status} or -100 = {status})  not EXISTS (select id from base_door_coach_order " +
                " tt where tt.id = o.id and tt.`status` BETWEEN 1 and 2 and ISNULL(tt.pay_way) )  " ;
        String finqlCountSql = countSql.replace("{hospital}", hospital)
                .replace("{status}", String.valueOf(status));

+ 89 - 21
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doorCoach/PatientDoorCoachOrderService.java

@ -129,6 +129,9 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
            logger.error(failMsg);
            return result;
        }
        JSONObject dispatcherJson = queryDispatcherInfoByPatient(jsonObjectParam.getJSONObject("hospital").get("code").toString());
        String hospital = jsonObjectParam.getJSONObject("hospital").get("code").toString();
        orderDO.setHospital(hospital);
        orderDO.setNumber(getRandomIntStr());
        orderDO.setCreateTime(new Date());
        orderDO.setCreateUser(orderDO.getProxyPatient());
@ -180,22 +183,8 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
        orderDO.setServiceStatus("1");
        this.save(orderDO);
        result.put("orderId",orderDO.getId());
        //创建咨询
        JSONObject successOrNot = null;
        try {
            successOrNot = consultTeamService.addDoorCoachServiceConsult(orderDO.getId());
        } catch (Exception e) {
            e.printStackTrace();
            String failMsg = "创建咨询时异常: " + e.getMessage();
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultMsg, failMsg);
            logger.error(failMsg);
            return result;
        }
        if (Integer.parseInt(successOrNot.get(ResponseContant.resultFlag).toString()) == ResponseContant.fail) {
            return JSONObject.parseObject(successOrNot.toString());
        }
        ConsultTeamDo consultTeam = (ConsultTeamDo)successOrNot.get(ResponseContant.resultMsg);
        result.put(ResponseContant.resultFlag, ResponseContant.success);
        result.put(ResponseContant.resultMsg, orderDO);
        //新增工单与服务项费用关联关系
        if (orderWithPackageItemFeeAdd(result, jsonObjectParam, orderDO,null)) {return result;}
@ -249,8 +238,6 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
            return result;
        }
        BaseDoorCoachOrderDO orderDO = null;
        try {
            orderDO = EntityUtils.jsonToEntity(jsonObjectParam.get("order").toString(), BaseDoorCoachOrderDO.class);
@ -331,11 +318,84 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
        //发起支付订单
        payService.submitOrder(orderDO.getPatient(),"3",orderDO.getId(),orderDO.getTotalFee().doubleValue());
        result.put(ResponseContant.resultFlag, ResponseContant.success);
        return result;
    }
    //支付完成后开始上门辅导订单
    public JSONObject payOrderAfter(String orderId) {
        JSONObject result = new JSONObject();
        BaseDoorCoachOrderDO orderDO= baseDoorCoachOrderDao.findOne(orderId);
        if (orderDO!=null){
            if (orderDO.getPayWay()!=null){
                if (orderDO.getType()==3){//医生代预约
                    // 给服务医生发接单消息
                    this.createMessage("服务工单待接单","707",orderDO.getProxyPatient(),orderDO.getProxyPatientName(), orderDO.getId(),orderDO.getDoctor(),orderDO.getDoctorName(), null,"您有新的服务工单,请前往处理");
                    //发送智能助手消息
                    sendWeixinMessage(4,orderDO.getDoctor(),orderDO.getPatient());
                }else {
                    //创建咨询
                    JSONObject successOrNot = null;
                    try {
                        successOrNot = consultTeamService.addDoorCoachServiceConsult(orderDO.getId());
                    } catch (Exception e) {
                        e.printStackTrace();
                        String failMsg = "创建咨询时异常: " + e.getMessage();
                        result.put(ResponseContant.resultFlag, ResponseContant.fail);
                        result.put(ResponseContant.resultMsg, failMsg);
                        logger.error(failMsg);
                        return result;
                    }
                    if (Integer.parseInt(successOrNot.get(ResponseContant.resultFlag).toString()) == ResponseContant.fail) {
                        return JSONObject.parseObject(successOrNot.toString());
                    }
                    ConsultTeamDo consultTeam = (ConsultTeamDo)successOrNot.get(ResponseContant.resultMsg);
                    //发送智能助手消息
                    sendWeixinMessage(4,orderDO.getDoctor(),orderDO.getPatient());
                    //发送 预约卡片信息(2201类型)
                    JSONObject orderInfoContent = this.queryOrderCardInfo(orderDO);
                    orderInfoContent.put("re_msg_type",0);//居民预约
                    this.qucikSendIM(orderDO.getId(), "system", "智能助手", "2201", orderInfoContent.toJSONString());
                    if(StringUtils.isNoneBlank(orderDO.getDoctor())){
                        //期望服务医生存在,直接转派
                        BaseDoctorDO transDoctor = doctorDao.findById(orderDO.getDoctor());
                        sendOrderToDoctor(orderDO.getId(),null,"system","系统",transDoctor.getId(),transDoctor.getName(),transDoctor.getJobTitleName());
                    }else {
                        JSONObject dispatcherJson = queryDispatcherInfoByPatient(orderDO.getHospital());
                        if (dispatcherJson.getInteger("resultFlag")==1){
                            List<Map<String,Object>> dispatcherInfoList = (List<Map<String, Object>>) dispatcherJson.get(ResponseContant.resultMsg);
                            for(Map<String,Object> map: dispatcherInfoList){
                                String dispatcher = map.get("code").toString();
                                BaseDoctorDO doctorVO = doctorDao.findById(dispatcher);
                                // 派单消息-首页
                                this.createMessage("新增居民预约服务申请","702","system","system", orderDO.getId(), dispatcher,doctorVO.getName() ,doctorVO.getIdcard(), orderDO.getPatientName() + "提交了服务预约申请,请您前往处理");
                                // 派单-实时工单消息  430 居民提交工单申请-- 张三提交了服务工单12345678申请
                                this.createMessage("居民提交工单申请","730","system","system", orderDO.getId(), dispatcher,doctorVO.getName() ,doctorVO.getIdcard(), orderDO.getPatientName() + "提交了服务工单"+orderDO.getNumber()+"申请");
                            }
                        }
                    }
                    serviceNewsService.addServiceNews(orderDO.getPatientName(),orderDO.getPatient(),"1",null);
                    String failMsg = "success";
                    result.put(ResponseContant.resultFlag, ResponseContant.success);
                    result.put(ResponseContant.resultMsg, failMsg);
                }
            }else {
                String failMsg = "订单未支付";
                result.put(ResponseContant.resultFlag, ResponseContant.fail);
                result.put(ResponseContant.resultMsg, failMsg);
            }
        }
        else {
            String failMsg = "工单不存在";
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultMsg, failMsg);
        }
        return result;
    }
    /**
     * 根据接单医生code获取最近一次服务orderId
     * @return
@ -782,6 +842,15 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
            logger.error(failMsg);
            return result;
        }
        //触发退款流程,退款失败时无法取消工单
        try {
        }catch (Exception e){
            String failMsg = "退款失败,无法取消工单:," + orderId;
            result.put(ResponseContant.resultMsg, failMsg);
            return result;
        }
        orderDO.setCancelType(type);
        orderDO.setCancelTime(new Date());
        orderDO.setCancelReason(reason);
@ -1091,8 +1160,7 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
                return true;
            }
        }
        order.setTotalFee(totalFee);
        baseDoorCoachOrderDao.save(order);
        return false;
    }

+ 26 - 6
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/lifeCare/LifeCareOrderService.java

@ -80,8 +80,6 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
    private OrderNoService orderNoService;
    @Autowired
    private BaseServiceNewsService serviceNewsService;
    @Autowired
    private PayService payService;
    /**
@ -517,13 +515,35 @@ public class LifeCareOrderService extends BaseJpaService<LifeCareOrderDO, LifeCa
        result.put(ResponseContant.resultFlag, ResponseContant.success);
        result.put(ResponseContant.resultMsg, orderDO);
        if(orderDO.getType() == 3){
            serviceNewsService.addServiceNews(orderDO.getProxyPatientName(),orderDO.getProxyPatient(),"4",orderDO.getPatientName());
        }else {
            serviceNewsService.addServiceNews(orderDO.getPatientName(),orderDO.getPatient(),"3",null);
        return result;
    }
    //支付完成后开始上门辅导订单
    public JSONObject payOrderAfter(String orderId) {
        JSONObject result = new JSONObject();
        LifeCareOrderDO orderDO = lifeCareOrderDao.findOne(orderId);
        if (orderDO!=null) {
            if (orderDO.getPayWay() != null) {
                if(orderDO.getType() == 3){
                    serviceNewsService.addServiceNews(orderDO.getProxyPatientName(),orderDO.getProxyPatient(),"4",orderDO.getPatientName());
                }else {
                    serviceNewsService.addServiceNews(orderDO.getPatientName(),orderDO.getPatient(),"3",null);
                }
            }else {
                String failMsg = "订单未支付";
                result.put(ResponseContant.resultFlag, ResponseContant.fail);
                result.put(ResponseContant.resultMsg, failMsg);
            }
        }
        //发起支付订单
        payService.submitOrder(orderDO.getPatient(),"4",orderDO.getId(),orderDO.getTotalFee().doubleValue());
        else {
            String failMsg = "工单不存在";
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultMsg, failMsg);
        }
        result.put(ResponseContant.resultFlag, ResponseContant.success);
        result.put(ResponseContant.resultMsg, "success");
        return result;
    }

+ 52 - 3
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/complaint/BaseComplaintEndPoint.java

@ -241,6 +241,8 @@ public class BaseComplaintEndPoint  extends EnvelopRestEndpoint {
                                 @RequestParam(value = "doctor", required = false) String doctor,
                                 @ApiParam(name = "status", value = "status", required = false)
                                 @RequestParam(value = "status", required = false) String status,
                                     @ApiParam(name = "role", value = "role", required = false)
                                         @RequestParam(value = "role", required = false) String role,
                                 @ApiParam(name = "patientName", value = "patientName", required = false)
                                 @RequestParam(value = "patientName", required = false) String patientName,
                                 @ApiParam(name = "patientId", value = "patientId", required = false)
@ -258,7 +260,7 @@ public class BaseComplaintEndPoint  extends EnvelopRestEndpoint {
                                 @ApiParam(name = "startTime", value = "startTime", required = false)
                                 @RequestParam(value = "startTime", required = false) String startTime) throws Exception {
        try {
            return success(baseComplaintService.findComplaintList( doctor, status, patientName, patientId, keyWord,complaintId,
            return success(baseComplaintService.findComplaintList(role, doctor, status, patientName, patientId, keyWord,complaintId,
                     startTime, endTime, page , pageSize)) ;
        }catch (Exception e){
            return failedException(e);
@ -318,12 +320,59 @@ public class BaseComplaintEndPoint  extends EnvelopRestEndpoint {
    @GetMapping(value = "/findComplaintCount")
    @ApiOperation(value = "查询投诉建议数量", notes = "查询投诉建议单挑")
    public Envelop findComplaintCount(@ApiParam(name = "doctor", value = "doctor", required = false)
                                          @RequestParam(value = "doctor", required = false) String doctor) throws Exception {
                                      @RequestParam(value = "doctor", required = false) String doctor,
                                      @ApiParam(name = "role", value = "role", required = false)
                                      @RequestParam(value = "role", required = false) String role) throws Exception {
        try {
            return success(baseComplaintService.findComplaintCount(doctor)) ;
            return success(baseComplaintService.findComplaintCount(doctor,role)) ;
        }catch (Exception e){
            return failedException(e);
        }
    }
    /**
     * 查询投诉建议单挑
     * @return
     */
    @GetMapping(value = "/findComplaintCountByPatient")
    @ApiOperation(value = "患者查询投诉建议数量", notes = "患者查询投诉建议数量")
    public Envelop findComplaintCountByPatient(@ApiParam(name = "patient", value = "patient", required = false)
                                      @RequestParam(value = "patient", required = false) String patient) throws Exception {
        try {
            return success(baseComplaintService.findComplaintCountPatient(patient)) ;
        }catch (Exception e){
            return failedException(e);
        }
    }
    /**
     * 居民撤销反馈
     * @return
     */
    @GetMapping(value = "/cancelPatientComplaint")
    @ApiOperation(value = "居民撤销反馈", notes = "居民撤销反馈")
    public Envelop cancelPatientComplaint(@ApiParam(name = "id", value = "id", required = false)
                                               @RequestParam(value = "id", required = false) String id,
                                          @ApiParam(name = "patient", value = "patient", required = false)
                                          @RequestParam(value = "patient", required = false) String patient) throws Exception {
        try {
            return success(baseComplaintService.cancelPaitentComplaint(id,patient)) ;
        }catch (Exception e){
            return failedException(e);
        }
    }
    /**
     * 查询进度
     * @return
     */
    @GetMapping(value = "/findComplaintOperateLog")
    @ApiOperation(value = "查询反馈进度", notes = "查询反馈进度")
    public Envelop findComplaintOperateLog(@ApiParam(name = "id", value = "id", required = false)
                                          @RequestParam(value = "id", required = false) String id) throws Exception {
        try {
            return success(baseComplaintService.findComplaintOperateLog(id)) ;
        }catch (Exception e){
            return failedException(e);
        }
    }
}