ソースを参照

中山需求修改

wangjun 3 年 前
コミット
eae2a783df

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

@ -0,0 +1,9 @@
package com.yihu.jw.doctor.dao;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorSuggestDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
public interface BaseDoctorSuggestDao  extends PagingAndSortingRepository<BaseDoctorSuggestDO, String>, JpaSpecificationExecutor<BaseDoctorSuggestDO> {
}

+ 148 - 0
business/base-service/src/main/java/com/yihu/jw/doctor/service/BaseDoctorSuggestService.java

@ -0,0 +1,148 @@
package com.yihu.jw.doctor.service;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorSuggestDao;
import com.yihu.jw.doctor.dao.DoctorSpecialDiseaseDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorSuggestDO;
import com.yihu.jw.entity.base.doctor.DoctorSpecialDiseaseDo;
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.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service
public class BaseDoctorSuggestService  extends BaseJpaService<BaseDoctorSuggestDO, BaseDoctorSuggestDao> {
    @Autowired
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Autowired
    private BasePatientDao basePatientDao;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Autowired
    private ObjectMapper objectMapper;
    @Autowired
    private BaseDoctorSuggestDao baseDoctorSuggestDao;
    @Value("${wechat.id}")
    private String wxId;
    @Value("${wechat.flag}")
    private boolean flag;
    public void saveDoctorSuggest(String json) throws  Exception{
        BaseDoctorSuggestDO baseDoctorSuggestDO=objectMapper.readValue(json,BaseDoctorSuggestDO.class);
        baseDoctorSuggestDO.setCreateTime(new Date());
        baseDoctorSuggestDO.setIsDel("1");
        BasePatientDO basePatientDO=basePatientDao.findById(baseDoctorSuggestDO.getCreateUser());
        if (basePatientDO!=null){
            baseDoctorSuggestDO.setCreateUserName(basePatientDO.getName());
        }
        BaseDoctorDO baseDoctorDO=baseDoctorDao.findById(baseDoctorSuggestDO.getDoctor());
        if (baseDoctorDO!=null){
            baseDoctorSuggestDO.setDoctorName(baseDoctorDO.getName());
        }
        List<WlyyHospitalSysDictDO> list =wlyyHospitalSysDictDao.findByDictName("doctorSuggestType");
        for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:list){
            if (baseDoctorSuggestDO.getSuggestType().equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                baseDoctorSuggestDO.setSuggestName(wlyyHospitalSysDictDO.getDictValue());
            }
        }
        baseDoctorSuggestDao.save(baseDoctorSuggestDO);
    }
    public MixEnvelop findDoctorSuggest(String doctor,String patient,String doctorName,String patientName,String startTime,String endTime,
                                        String suggestType,String relationType,String keyWord,Integer page,Integer pageSize){
        MixEnvelop mixEnvelop = new MixEnvelop();
        String sql = "select t.id as \"id\"," +
                "t.suggest_type as \"suggestType\"," +
                "t.suggest_name as \"suggestName\"," +
                "t.suggest_content as \"suggestContent\"," +
                "t.relation_code as \"relationCode\"," +
                "t.relation_type as \"relationType\"," ;
        if("xm_ykyy_wx".equals(wxId)){
            if (flag){
                sql+="date_format(t.create_time, '%Y-%m-%d %H:%i:%s')  as \"createTime\",";
            }else {
                sql+="  to_char(t.create_time,'yyyy-MM-dd HH24:mi:ss') as \"createTime\",";
            }
        }else{
            sql+="date_format(t.create_time, '%Y-%m-%d %H:%i:%s')  as \"createTime\",";
        }
        sql+= "t.create_user as \"createUser\"," +
                "t.create_user_name as \"createUserName\"," +
                "t.doctor as \"doctor\"," +
                "t.doctor_name as \"doctorName\"," +
                "t.is_del as \"isDel\"," +
                "t.img_url as \"imgUrl\"" +
                "from base_doctor_suggest t where t.is_del ='1'";
        if (StringUtils.isNoneBlank(doctor)){
            sql+=" and t.doctor='"+doctor+"'";
        }
        if (StringUtils.isNoneBlank(patient)){
            sql+=" and t.create_user='"+patient+"'";
        }
        if (StringUtils.isNoneBlank(doctorName)){
            sql+=" and t.doctor_name like '%"+doctorName+"%'";
        }
        if (StringUtils.isNoneBlank(patientName)){
            sql+=" and t.create_user_name like '%"+patientName+"%'";
        }if (StringUtils.isNoneBlank(suggestType)){
            sql+=" and t.suggest_type='"+suggestType+"'";
        }if (StringUtils.isNoneBlank(relationType)){
            sql+=" and t.relation_type='"+relationType+"'";
        }if (StringUtils.isNoneBlank(keyWord)){
            sql+=" and t.suggest_content like '%"+keyWord+"%'";
        }
        if (StringUtils.isNotBlank(startTime)){
            if("xm_ykyy_wx".equals(wxId)){
                if (flag){
                    sql+=" and t.create_time > '"+startTime+"'";
                }else {
                    sql+=" and t.create_time > to_date('" + startTime + "', 'yyyy-mm-dd hh24:mi:ss') ";
                }
            }else{
                sql+=" and t.create_time > '"+startTime+"'";
            }
        }
        if (StringUtils.isNotBlank(endTime)){
            if("xm_ykyy_wx".equals(wxId)){
                if (flag){
                    sql+="  and t.create_time<='" + endTime + "'";
                }else {
                    sql+="  and t.create_time<= to_date('" + endTime + "','yyyy-mm-dd hh24:mi:ss')";
                }
            }else{
                sql+="  and t.create_time<='" + endTime + "'";
            }
        }
        sql+=" order by t.create_time desc ";
        List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql,page,pageSize);
        String sqlcount = "SELECT COUNT(1) AS \"total\" FROM ("+sql+") q";
        Long count = 0L;
        List<Map<String,Object>> total = hibenateUtils.createSQLQuery(sqlcount);
        if(total!=null){
            //mysql 与 Oracle 聚合函数返回类型不一致,需要判断装换
            count = hibenateUtils.objTransformLong(total.get(0).get("total"));
        }
        mixEnvelop.setTotalCount(count.intValue());
        mixEnvelop.setDetailModelList(list);
        mixEnvelop.setPageSize(pageSize);
        mixEnvelop.setCurrPage(page);
        return mixEnvelop;
    }
    public BaseDoctorSuggestDO findById(String id){
        return baseDoctorSuggestDao.findOne(id);
    }
}

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

@ -4409,20 +4409,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 = "您的图文复诊订单已退号。由于订单退号,诊察费将退回就诊卡内余额。";
                contentMsg = "您的图文复诊订单已退号。由于订单退号,诊察费将退回本院就诊卡内。";
                first = outpatientDO.getConsumerName() + ",您好!您的图文复诊已退号";
            }
            if ("16".equals(type)) {
                contentMsg =  "您的视频复诊订单已退号。由于订单退号,诊察费将退回就诊卡内余额。";
                first = outpatientDO.getConsumerName() + ",您好!您发起的视频复诊已退号";
                contentMsg =  "您的视频复诊订单已退号。由于订单退号,诊察费将退回本院就诊卡内。";
                first = outpatientDO.getConsumerName() + ",您好!您的视频复诊已退号";
            }
            if ("1".equals(type)) {
                contentMsg =  "您的图文咨询订单已退号。由于订单退号,诊察费将退回就诊卡内余额。";
                first = outpatientDO.getConsumerName() + ",您好!您发起的图文咨询已退号";
                contentMsg =  "您的图文咨询订单已退号。由于订单退号,诊察费将退回本院就诊卡内。";
                first = outpatientDO.getConsumerName() + ",您好!您的图文咨询已退号";
            }
            if ("17".equals(type)) {
                contentMsg = "您的视频咨询订单已退号。由于订单退号,诊察费将退回就诊卡内余额。";
                first = outpatientDO.getConsumerName() + ",您好!您发起的视频咨询已退号";
                contentMsg = "您的视频咨询订单已退号。由于订单退号,诊察费将退回本院就诊卡内。";
                first = outpatientDO.getConsumerName() + ",您好!您的视频咨询已退号";
            }
            logger.info("doctorRefund:outpatientId="+outpatientId);
            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId;

+ 124 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/doctor/BaseDoctorSuggestDO.java

@ -0,0 +1,124 @@
package com.yihu.jw.entity.base.doctor;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
@Entity
@Table(name = "base_doctor_suggest")
public class BaseDoctorSuggestDO extends UuidIdentityEntity {
    private String suggestType;
    private String suggestName;
    private String suggestContent;
    private String relationCode;
    private String relationType;
    private Date createTime;
    private String createUser;
    private String createUserName;
    private String doctor;
    private String doctorName;
    private String isDel;
    private String imgUrl;
    @Column(name = "suggest_type")
    public String getSuggestType() {
        return suggestType;
    }
    public void setSuggestType(String suggestType) {
        this.suggestType = suggestType;
    }
    @Column(name = "suggest_name")
    public String getSuggestName() {
        return suggestName;
    }
    public void setSuggestName(String suggestName) {
        this.suggestName = suggestName;
    }
    @Column(name = "suggest_content")
    public String getSuggestContent() {
        return suggestContent;
    }
    public void setSuggestContent(String suggestContent) {
        this.suggestContent = suggestContent;
    }
    @Column(name = "relation_code")
    public String getRelationCode() {
        return relationCode;
    }
    public void setRelationCode(String relationCode) {
        this.relationCode = relationCode;
    }
    @Column(name = "relation_type")
    public String getRelationType() {
        return relationType;
    }
    public void setRelationType(String relationType) {
        this.relationType = relationType;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "create_time")
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    @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 = "doctor")
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }
    @Column(name = "doctor_name")
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }
    @Column(name = "is_del")
    public String getIsDel() {
        return isDel;
    }
    public void setIsDel(String isDel) {
        this.isDel = isDel;
    }
    @Column(name = "img_url")
    public String getImgUrl() {
        return imgUrl;
    }
    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }
}

+ 9 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -1306,6 +1306,15 @@ public class BaseHospitalRequestMapping {
        public static final String changeIsRead = "/changeIsRead";
    }
    /**
     * 医生反馈建议
     */
    public static class DoctorSuggest extends Basic{
        public static final String saveSuggest  = "/saveSuggest";
        public static final String findSuggestList  = "/findSuggestList";
        public static final String findOne  = "/findOne";
        public static final String baseDoctorSuggest  = "/baseDoctorSuggest";
    }
    /**
     * 背景展示
     */

+ 6 - 2
svr/svr-base/src/main/java/com/yihu/jw/base/service/menu/BaseMenuManageService.java

@ -18,6 +18,7 @@ import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import org.apache.commons.lang3.StringUtils;
@ -494,6 +495,7 @@ public class BaseMenuManageService {
                " t.is_del as \"isDel\"," +
                " t.create_time as \"createTime\"," +
                " t.menu_sort as \"menuSort\"," +
                " m.link_url as \"linkUrl\"," +
                " t.style_code as \"styleCode\"," +
                " m.status as \"status\"," +
                " t.style_name as \"styleName\" " +
@ -591,8 +593,10 @@ public class BaseMenuManageService {
        int i =1;
        for (BaseMenuShowDO baseMenuShowDO:menuShowDO){
            for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:list){
                if (baseMenuShowDO.getStyleCode().equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                    baseMenuShowDO.setStyleName(wlyyHospitalSysDictDO.getDictValue());
                if (StringUtils.isNoneBlank(baseMenuShowDO.getStyleCode())){
                    if (baseMenuShowDO.getStyleCode().equalsIgnoreCase(wlyyHospitalSysDictDO.getDictCode())){
                        baseMenuShowDO.setStyleName(wlyyHospitalSysDictDO.getDictValue());
                    }
                }
            }
            String modelSql = "select t.id as \"id\"," +

+ 83 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/BaseDoctorSuggestController.java

@ -0,0 +1,83 @@
package com.yihu.jw.hospital.endpoint.hospital;
import com.yihu.jw.doctor.service.BaseDoctorSuggestService;
import com.yihu.jw.entity.hospital.suggest.BaseSuggestionDO;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping(value = BaseHospitalRequestMapping.DoctorSuggest.baseDoctorSuggest)
@Api(value = "医生反馈建议管理", description = "医生反馈建议管理", tags = {"互联网医院 - 医生反馈建议管理"})
public class BaseDoctorSuggestController extends EnvelopRestEndpoint {
    @Autowired
    private BaseDoctorSuggestService baseDoctorSuggestService;
    @ApiOperation("查询反馈建议列表")
    @GetMapping(value= BaseHospitalRequestMapping.DoctorSuggest.findSuggestList)
    public Envelop findSuggestList(@ApiParam(name = "doctor", value = "doctor", required = false)
                                       @RequestParam(value = "doctor", required = false)String doctor,
                                       @ApiParam(name = "patient", value = "patient", required = false)
                                       @RequestParam(value = "patient", required = false)String patient,
                                       @ApiParam(name = "doctorName", value = "doctorName", required = false)
                                           @RequestParam(value = "doctorName", required = false)String doctorName,
                                       @ApiParam(name = "patientName", value = "patientName", required = false)
                                           @RequestParam(value = "patientName", required = false)String patientName,
                                       @ApiParam(name = "startTime", value = "startTime", required = false)
                                           @RequestParam(value = "startTime", required = false)String startTime,
                                       @ApiParam(name = "endTime", value = "endTime", required = false)
                                           @RequestParam(value = "endTime", required = false)String endTime,
                                       @ApiParam(name = "suggestType", value = "suggestType", required = false)
                                           @RequestParam(value = "suggestType", required = false)String suggestType,
                                       @ApiParam(name = "relationType", value = "relationType", required = false)
                                           @RequestParam(value = "relationType", required = false)String relationType,
                                       @ApiParam(name = "keyWord", value = "keyWord", required = false)
                                           @RequestParam(value = "keyWord", required = false)String keyWord,
                                       @ApiParam(name = "page", value = "page", required = false)
                                       @RequestParam(value = "page", required = false)Integer page,
                                       @ApiParam(name = "size", value = "size", required = false)
                                       @RequestParam(value = "size", required = false)Integer size){
        try {
            return success( baseDoctorSuggestService.findDoctorSuggest(doctor,patient,doctorName,patientName,startTime,endTime,suggestType,relationType,keyWord,page,size));
        }catch (Exception e){
            System.out.println(e.getClass());
            return failedException(e);
        }
    }
    @PostMapping(value= BaseHospitalRequestMapping.DoctorSuggest.saveSuggest)
    @ApiOperation("新增医生反馈建议")
    public Envelop saveSuggest(
            @ApiParam(name = "json", value = "Json数据", required = true)
            @RequestParam(value = "json", required = false)String json)throws Exception{
        try {
           baseDoctorSuggestService.saveDoctorSuggest(json);
            return success("新增成功");
        }catch (Exception e){
            return failedException(e);
        }
    }
    @GetMapping(value= BaseHospitalRequestMapping.DoctorSuggest.findOne)
    @ApiOperation("查询单条")
    public Envelop findOne(
            @ApiParam(name = "id", value = "id", required = true)
            @RequestParam(value = "id", required = false)String id)throws Exception{
        try {
            return success(baseDoctorSuggestService.findById(id));
        }catch (Exception e){
            return failedException(e);
        }
    }
}