浏览代码

Merge branch 'main' of suhaiwen/wlyy2.0 into dev

wangzhinan 4 年之前
父节点
当前提交
a8e9137eaa
共有 24 个文件被更改,包括 1047 次插入156 次删除
  1. 10 4
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  2. 2 2
      business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java
  3. 47 28
      business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java
  4. 57 12
      business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java
  5. 10 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/score/BaseEvaluateScoreDO.java
  6. 61 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/words/BaseImportSensitiveDO.java
  7. 95 0
      common/common-entity/src/main/java/com/yihu/jw/entity/base/words/BaseSensitiveDO.java
  8. 13 1
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java
  9. 7 11
      common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java
  10. 14 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/word/BaseImportSensitiveDao.java
  11. 16 0
      svr/svr-base/src/main/java/com/yihu/jw/base/dao/word/BaseSensitiveDao.java
  12. 1 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/common/excel/AExcelReader.java
  13. 8 3
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/saas/SaasEndpoint.java
  14. 176 0
      svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/word/BaseSensitiveEndpoint.java
  15. 37 20
      svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java
  16. 29 18
      svr/svr-base/src/main/java/com/yihu/jw/base/service/org/BaseOrgService.java
  17. 29 19
      svr/svr-base/src/main/java/com/yihu/jw/base/service/team/BaseTeamService.java
  18. 30 19
      svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java
  19. 60 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/word/BaseSensitiveExcelReader.java
  20. 246 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/word/BaseSensitiveService.java
  21. 64 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/word/excelImport/BaseSensitiveExcelDO.java
  22. 29 17
      svr/svr-base/src/main/java/com/yihu/jw/base/service/wx/WechatService.java
  23. 2 0
      svr/svr-base/src/main/resources/application.yml
  24. 4 2
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

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

@ -13,12 +13,13 @@ import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.org.BaseDoctorPatientFollowDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.entity.base.sync.BaseSyncDataDO;
import com.yihu.jw.entity.base.words.BaseSensitiveDO;
import com.yihu.jw.entity.base.wx.*;
import com.yihu.jw.entity.hospital.consult.WlyyDoctorClinicRoomDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
@ -62,8 +63,6 @@ import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
import com.yihu.jw.restmodel.base.dict.DictHospitalDeptVO;
import com.yihu.jw.restmodel.base.org.BaseOrgVO;
import com.yihu.jw.restmodel.base.wx.WxGraphicMessageVO;
import com.yihu.jw.restmodel.base.wx.WxReplySceneVO;
import com.yihu.jw.restmodel.hospital.archive.ArchiveVO;
import com.yihu.jw.restmodel.hospital.consult.WlyyHospitalSysDictVO;
import com.yihu.jw.restmodel.hospital.doctor.WlyyDoctorWorkTimeVO;
@ -71,7 +70,6 @@ import com.yihu.jw.restmodel.hospital.prescription.*;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.jw.util.common.IdCardUtil;
@ -246,6 +244,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    @Autowired
    private DictDeptDescDao dictDeptDescDao;
    @Value("${demo.flag}")
    private boolean demoFlag;
    @Value("${wechat.id}")
@ -3787,6 +3788,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            for (BasePatientWechatDo one : ps) {
                logger.info("发送的消息="+ com.alibaba.fastjson.JSONObject.toJSONString(newConfig));
                try {
                    logger.info("调用眼科微信模板消息接口的入参:AccessToken="+wxAccessTokenDO.getAccessToken()+"---Openid="+one.getOpenid());
                    weixinMessagePushUtils.putWxMsg(wxAccessTokenDO.getAccessToken(), one.getOpenid(), newConfig);
                    logger.info("发送成功");
                } catch (Exception e) {
@ -3837,6 +3839,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            logger.info("XZZX_Msg_" + titelType + "=" + responseMsg);
        } else if ("xm_zsyy_wx".equalsIgnoreCase(wxId)) {
            if ("prescriptionPayRemind".equalsIgnoreCase(titelType)){
                return;
            }
            String responseMsg="";
            String prefix="https://hlwyy.xmzsh.com";
            if(StringUtils.isNotEmpty(outpatientId)){
@ -7754,4 +7759,5 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        }
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find, res);
    }
}

+ 2 - 2
business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java

@ -85,9 +85,9 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
        List<Map<String, Object>> result = new ArrayList<>();
        String param = null == nameOrIdcard ? "": nameOrIdcard;
        String sql = "SELECT\n" +
                "\tID AS \"ID\",\n" +
                "\tID AS \"id\",\n" +
                "\tidcard AS \"idcard\",\n" +
                "\tNAME AS \"NAME\",\n" +
                "\tNAME AS \"name\",\n" +
                "\tCASE\n" +
                "WHEN sex = 1 THEN\n" +
                "\t'男'\n" +

+ 47 - 28
business/es-service/src/main/java/com/yihu/jw/es/service/StatisticsEsService.java

@ -27,6 +27,7 @@ import org.omg.CORBA.OBJ_ADAPTER;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -61,6 +62,8 @@ public class StatisticsEsService {
    private BaseEvaluateScoreService baseEvaluateScoreService;
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    @Value("${wechat.flag}")
    private boolean flag;
    /**
     * 问诊量
     * @param startDate
@ -749,24 +752,36 @@ public class StatisticsEsService {
    public JSONObject getOutPatientCircular(String startDate, String endDate, String area, int level, String index, String level2_type) throws Exception {
        JSONObject object = new JSONObject();
        //协同门诊
        SaveModel saveModel1 = null;
        saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "12");
        //图文复诊
        SaveModel saveModel2 = null;
        //saveModel2 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1","1");
        saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "9");
        //视频复诊
        SaveModel saveModel3 = null;
        if (flag){
            object.put("specialistCount",0);//专家咨询数
            object.put("specialistRate","0%");
            object.put("synergyCount",0);//专家咨询数
            object.put("synergyRate","0%");
            object.put("topicCount",0);//图文复诊数量
            object.put("topicRate","0%");
            object.put("videoCount",0);//视频复诊数量
            object.put("videoRate","0%");
            object.put("total",0);
        }else {
            //协同门诊
            SaveModel saveModel1 = null;
            saveModel1 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "12");
            //图文复诊
            SaveModel saveModel2 = null;
            //saveModel2 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1","1");
            saveModel2 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "9");
            //视频复诊
            SaveModel saveModel3 = null;
/*
        saveModel3 = elasticsearchUtil.findOneDateQuotaLevel2(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1","2");
*/
        saveModel3 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "16");
        Double specialistCount =0.0;
        //专科咨询
        SaveModel saveModel4 = null;
        saveModel4 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1");
        specialistCount = saveModel4.getResult1();//专家咨询数量
            saveModel3 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "16");
            Double specialistCount =0.0;
            //专科咨询
            SaveModel saveModel4 = null;
            saveModel4 = elasticsearchUtil.findOneDateQuotaLevel1(endDate, endDate, area, level, index, SaveModel.timeLevel_DDL, "1");
            specialistCount = saveModel4.getResult1();//专家咨询数量
        /*if(index.equalsIgnoreCase("5")){
            //专家咨询数量
            SaveModel saveModel = null;
@ -781,19 +796,23 @@ public class StatisticsEsService {
            specialistCount = 0.0;
        }*/
        Double synergyCount = saveModel1.getResult1();//协同门诊数量
        Double topicCount = saveModel2.getResult1();//图文复诊数量
        Double videoCount = saveModel3.getResult1();//视频复诊数量
        Double total = specialistCount+synergyCount+topicCount+videoCount;//总量
        object.put("specialistCount",specialistCount);//专家咨询数
        object.put("specialistRate",getRange(specialistCount.intValue(),total.intValue(),0));
        object.put("synergyCount",synergyCount);//专家咨询数
        object.put("synergyRate",getRange(synergyCount.intValue(),total.intValue(),0));
        object.put("topicCount",topicCount);//图文复诊数量
        object.put("topicRate",getRange(topicCount.intValue(),total.intValue(),0));
        object.put("videoCount",videoCount);//视频复诊数量
        object.put("videoRate",getRange(videoCount.intValue(),total.intValue(),0));
        object.put("total",total);
            Double synergyCount = saveModel1.getResult1();//协同门诊数量
            Double topicCount = saveModel2.getResult1();//图文复诊数量
            Double videoCount = saveModel3.getResult1();//视频复诊数量
            Double total = specialistCount+synergyCount+topicCount+videoCount;//总量
            object.put("specialistCount",specialistCount);//专家咨询数
            object.put("specialistRate",getRange(specialistCount.intValue(),total.intValue(),0));
            object.put("synergyCount",synergyCount);//专家咨询数
            object.put("synergyRate",getRange(synergyCount.intValue(),total.intValue(),0));
            object.put("topicCount",topicCount);//图文复诊数量
            object.put("topicRate",getRange(topicCount.intValue(),total.intValue(),0));
            object.put("videoCount",videoCount);//视频复诊数量
            object.put("videoRate",getRange(videoCount.intValue(),total.intValue(),0));
            object.put("total",total);
        }
        return object;
    }

+ 57 - 12
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -52,9 +52,9 @@ import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.util.common.FileUtil;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.wechat.service.WxAccessTokenService;
import com.ylzinfo.onepay.sdk.utils.StringUtil;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.slf4j.LoggerFactory;
@ -1631,7 +1631,7 @@ public class ImService {
	 * @param scoreContent
	 * @param type
	 */
	public void evaluationByConsultCode(String consult, String scoreContent, Integer type) throws Exception{
	public void evaluationByConsultCode(String consult, String scoreContent, Integer type,String pennantList) throws Exception{
		JSONArray jsonArray =  JSONArray.parseArray(scoreContent);
		
		Integer totalScore = 0;
@ -1971,7 +1971,12 @@ public class ImService {
		
		if(!StringUtils.isEmpty(start_time)){
			if("xm_ykyy_wx".equals(wxId)){
				sql +=" and a.czrq >= to_date('"+start_time+"','YYYY-MM-DD HH24:MI:SS')";
				if (flag){
					sql +=" and a.czrq >= str_to_date('"+start_time+"','YYYY-MM-DD HH24:MI:SS')";
				}else {
					sql +=" and a.czrq >= to_date('"+start_time+"','YYYY-MM-DD HH24:MI:SS')";
				}
			}else {
				sql +=" and a.czrq >= '"+start_time+"'";
			}
@ -1980,7 +1985,12 @@ public class ImService {
		
		if(!StringUtils.isEmpty(end_time)){
			if("xm_ykyy_wx".equals(wxId)){
				sql +=" and a.czrq <= to_date('"+end_time+"','YYYY-MM-DD HH24:MI:SS')";
				if (flag){
					sql +=" and a.czrq <= str_to_date('"+end_time+"','YYYY-MM-DD HH24:MI:SS')";
				}else {
					sql +=" and a.czrq <= to_date('"+end_time+"','YYYY-MM-DD HH24:MI:SS')";
				}
			}else {
				sql +=" and a.czrq <= '"+end_time+"'";
			}
@ -2042,7 +2052,12 @@ public class ImService {
		
		if(!StringUtils.isEmpty(start_time)){
			if("xm_ykyy_wx".equals(wxId)){
				sql +=" and a.czrq >= to_date('"+start_time+"','YYYY-MM-DD HH24:MI:SS')";
				if (flag){
					sql +=" and a.czrq >= str_to_date('"+start_time+"','YYYY-MM-DD HH24:MI:SS')";
				}else {
					sql +=" and a.czrq >= to_date('"+start_time+"','YYYY-MM-DD HH24:MI:SS')";
				}
			}else {
				sql +=" and a.czrq >= '"+start_time+"'";
			}
@ -2051,7 +2066,12 @@ public class ImService {
		
		if(!StringUtils.isEmpty(end_time)){
			if("xm_ykyy_wx".equals(wxId)){
				sql +=" and a.czrq <= to_date('"+end_time+"','YYYY-MM-DD HH24:MI:SS')";
				if (flag){
					sql +=" and a.czrq <= str_to_date('"+end_time+"','YYYY-MM-DD HH24:MI:SS')";
				}else {
					sql +=" and a.czrq <= to_date('"+end_time+"','YYYY-MM-DD HH24:MI:SS')";
				}
			}else {
				sql +=" and a.czrq <= '"+end_time+"'";
			}
@ -2354,7 +2374,12 @@ public class ImService {
		
		if(!StringUtils.isEmpty(start_time)){
			if("xm_ykyy_wx".equals(wxId)){
				sql +=" and a.czrq >= to_date('"+start_time+"','YYYY-MM-DD HH24:MI:SS')";
				if (flag){
					sql +=" and a.czrq >= str_to_date('"+start_time+"','YYYY-MM-DD HH24:MI:SS')";
				}else {
					sql +=" and a.czrq >= to_date('"+start_time+"','YYYY-MM-DD HH24:MI:SS')";
				}
			}else {
				sql +=" and a.czrq >= '"+start_time+"'";
			}
@ -2363,7 +2388,12 @@ public class ImService {
		
		if(!StringUtils.isEmpty(end_time)){
			if("xm_ykyy_wx".equals(wxId)){
				sql +=" and a.czrq <= to_date('"+end_time+"','YYYY-MM-DD HH24:MI:SS')";
				if (flag){
					sql +=" and a.czrq <= str_to_date('"+end_time+"','YYYY-MM-DD HH24:MI:SS')";
				}else {
					sql +=" and a.czrq <= to_date('"+end_time+"','YYYY-MM-DD HH24:MI:SS')";
				}
			}else {
				sql +=" and a.czrq <= '"+end_time+"'";
			}
@ -2428,7 +2458,12 @@ public class ImService {
		
		if(!StringUtils.isEmpty(start_time)){
			if("xm_ykyy_wx".equals(wxId)){
				sql +=" and a.czrq >= to_date('"+start_time+"','YYYY-MM-DD HH24:MI:SS')";
				if (flag){
					sql +=" and a.czrq >= str_to_date('"+start_time+"','YYYY-MM-DD HH24:MI:SS')";
				}else {
					sql +=" and a.czrq >= to_date('"+start_time+"','YYYY-MM-DD HH24:MI:SS')";
				}
			}else {
				sql +=" and a.czrq >= '"+start_time+"'";
			}
@ -2436,7 +2471,12 @@ public class ImService {
		
		if(!StringUtils.isEmpty(end_time)){
			if("xm_ykyy_wx".equals(wxId)){
				sql +=" and a.czrq <= to_date('"+end_time+"','YYYY-MM-DD HH24:MI:SS')";
				if (flag){
					sql +=" and a.czrq <= str_to_date('"+end_time+"','YYYY-MM-DD HH24:MI:SS')";
				}else {
					sql +=" and a.czrq <= to_date('"+end_time+"','YYYY-MM-DD HH24:MI:SS')";
				}
			}else {
				sql +=" and a.czrq <= '"+end_time+"'";
			}
@ -2596,7 +2636,7 @@ public class ImService {
			
			String scoreContent= "[{\"scoreType\":\"1\",\"score\":100,\"content\":\"\"},{\"scoreType\":\"2\",\"score\":100,\"content\":\"\"},{\"scoreType\":\"3\",\"score\":100,\"content\":\"\"},{\"scoreType\":\"4\",\"score\":0,\"content\":\"五星好评!\"}]";
			
			this.evaluationByConsultCode(consult.getId(),scoreContent,2);
			this.evaluationByConsultCode(consult.getId(),scoreContent,2,"");
		}
	}
	
@ -2737,7 +2777,12 @@ public class ImService {
				//视频复诊
				sql =sql +"AND op.type=2 AND op.outpatient_type=1 ";
				if("xm_ykyy_wx".equals(wxId)){
					sql +=" and op.register_date >= to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					if (flag){
						sql +=" and op.register_date >= str_to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}else {
						sql +=" and op.register_date >= to_date('"+DateUtil.dateToStrShort(new Date())+" 00:00:00','YYYY-MM-DD HH24:MI:SS')";
					}
				}else {
					sql +=" AND  op.register_date >= '"+DateUtil.dateToStrShort(new Date())+" 00:00:00' ";
				}

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/score/BaseEvaluateScoreDO.java

@ -25,6 +25,7 @@ public class BaseEvaluateScoreDO extends UuidIdentityEntityWithOperator {
    private String relationCode;//所属业务关系code,例如:1为咨询code',
    private Double score;//主表分数',
    private Integer type;//1、实名,2、匿名',
    private String pennantList;//锦旗类型
    @Column(name = "city")
    public String getCity() {
@ -133,4 +134,13 @@ public class BaseEvaluateScoreDO extends UuidIdentityEntityWithOperator {
    public void setType(Integer type) {
        this.type = type;
    }
    @Column(name = "pennant_list")
    public String getPennantList() {
        return pennantList;
    }
    public void setPennantList(String pennantList) {
        this.pennantList = pennantList;
    }
}

+ 61 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/words/BaseImportSensitiveDO.java

@ -0,0 +1,61 @@
package com.yihu.jw.entity.base.words;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * @author HZY
 * @vsrsion 1.0
 * Created at 2020/7/6
 */
@Entity
@Table(name = "base_import_sensitive")
public class BaseImportSensitiveDO extends UuidIdentityEntityWithOperator {
    @Column(name = "row")
    private String row;
    @Column(name = "problem")
    private String problem;
    @Column(name = "operator_code")
    private String operatorCode;
    @Column(name = "operator")
    private String operator;
    public String getRow() {
        return row;
    }
    public void setRow(String row) {
        this.row = row;
    }
    public String getProblem() {
        return problem;
    }
    public void setProblem(String problem) {
        this.problem = problem;
    }
    public String getOperatorCode() {
        return operatorCode;
    }
    public void setOperatorCode(String operatorCode) {
        this.operatorCode = operatorCode;
    }
    public String getOperator() {
        return operator;
    }
    public void setOperator(String operator) {
        this.operator = operator;
    }
}

+ 95 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/base/words/BaseSensitiveDO.java

@ -0,0 +1,95 @@
package com.yihu.jw.entity.base.words;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
/**
 * @author HZY
 * @vsrsion 1.0
 * Created at 2020/7/6
 */
@Entity
@Table(name = "base_sensitive")
public class BaseSensitiveDO extends UuidIdentityEntityWithOperator {
    @Column(name = "sensitive_word")
    private String sensitiveWord;//敏感词
    @Column(name = "explanation")
    private String explanation;//说明
    @Column(name = "status")
    private String status;//状态 0:关闭  1:开启
    @Column(name = "operator_code")
    private String operatorCode;//操作者code
    @Column(name = "operator")
    private String operator;//操作者
    @Column(name = "add_time")
    private Date addTime;
    @Column(name = "renew_time")
    private Date renewTime;
    public String getSensitiveWord() {
        return sensitiveWord;
    }
    public void setSensitiveWord(String sensitiveWord) {
        this.sensitiveWord = sensitiveWord;
    }
    public String getExplanation() {
        return explanation;
    }
    public void setExplanation(String explanation) {
        this.explanation = explanation;
    }
    public String getStatus() {
        return status;
    }
    public void setStatus(String status) {
        this.status = status;
    }
    public String getOperator() {
        return operator;
    }
    public void setOperator(String operator) {
        this.operator = operator;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getAddTime() {
        return addTime;
    }
    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getRenewTime() {
        return renewTime;
    }
    public void setRenewTime(Date renewTime) {
        this.renewTime = renewTime;
    }
    public String getOperatorCode() {
        return operatorCode;
    }
    public void setOperatorCode(String operatorCode) {
        this.operatorCode = operatorCode;
    }
}

+ 13 - 1
common/common-request-mapping/src/main/java/com/yihu/jw/rm/base/BaseRequestMapping.java

@ -397,7 +397,7 @@ public class BaseRequestMapping {
    /**
     * 医生基础信息
     * 医生基础信息  BaseSensitive
     */
    public static class BaseDoctor extends Basic {
        public static final String PREFIX  = "/baseDoctor";
@ -412,6 +412,18 @@ public class BaseRequestMapping {
    }
    public static class BaseSensitive extends Basic {
        public static final String PREFIX  = "/baseSensitive";
        public static final String createSensitiveWords = "/createSensitiveWords";
        public static final String updateSensitiveWords = "/updateSensitiveWords";
        public static final String delSensitiveWords = "/delSensitiveWords";
        public static final String updateSensitiveWordsStatus = "/updateSensitiveWordsStatus";
        public static final String findSensitiveWords = "/findSensitiveWords";
        public static final String importSensitiveWords = "/importSensitiveWords";
        public static final String exportSensitiveWordsLog = "/exportSensitiveWordsLog";
    }
    /**
     * 医生职业信息
     */

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

@ -121,7 +121,7 @@ public class BaseHospitalRequestMapping {
         * 查询机构底下部门
         */
        public static final String findDeptByOrgCode ="/findDeptByOrgCode";
    
        /**
         * 查询有所有已开放的科室
         */
@ -131,17 +131,17 @@ public class BaseHospitalRequestMapping {
         * 查询部门下医生
         */
        public static final String findDoctorByHospitalAndDept = "/findDoctorByHospitalAndDept";
    
        /**
         * 根据疾病名称,热门部门查询医生
         */
        public static final String findDoctorByHospitalAndDiseaseAndDept = "/findDoctorByHospitalAndDiseaseAndDept";
    
        /**
         * 居民关注医院
         */
        public static final String followOrgByPatient = "/followOrgByPatient";
    
        /**
         * 获取常见疾病、热门部门、医生拒绝接诊原因 字典
         */
@ -372,7 +372,7 @@ public class BaseHospitalRequestMapping {
         * 居民取消续方
         */
        public static final String cancelPrescription ="/cancelPrescription";
    
        //居民获取当日就诊列表
        public static final String getTodayOutpatinetList ="/getTodayOutpatinetList";
@ -401,10 +401,10 @@ public class BaseHospitalRequestMapping {
        public static final String getDoctorIntroduction ="/getDoctorIntroduction";
        public static final String findByDict ="/findByDict";
    
        //根据居民CODE换取居民请求秘钥
        public static final String getPatientAccetokenByIdcard="/getPatientAccetokenByIdcard";
    
        //医生待办事项列表
        public static final String doctorUpcomingList = "/doctorUpcomingList";
@ -480,10 +480,6 @@ public class BaseHospitalRequestMapping {
        public static final String updatePayStatus = "/updatePayStatus";
        public static final String findPatNoByPatient = "/findPatNoByPatient";
    }
    public static class YkyyPrescription extends BaseHospitalRequestMapping.Basic {

+ 14 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/word/BaseImportSensitiveDao.java

@ -0,0 +1,14 @@
package com.yihu.jw.base.dao.word;
import com.yihu.jw.entity.base.words.BaseImportSensitiveDO;
import com.yihu.jw.entity.base.words.BaseSensitiveDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author HZY
 * @vsrsion 1.0
 * Created at 2020/7/6
 */
public interface BaseImportSensitiveDao  extends PagingAndSortingRepository<BaseImportSensitiveDO, String>, JpaSpecificationExecutor<BaseImportSensitiveDO> {
}

+ 16 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/dao/word/BaseSensitiveDao.java

@ -0,0 +1,16 @@
package com.yihu.jw.base.dao.word;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.words.BaseSensitiveDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * @author HZY
 * @vsrsion 1.0
 * Created at 2020/7/6
 */
public interface BaseSensitiveDao extends PagingAndSortingRepository<BaseSensitiveDO, String>, JpaSpecificationExecutor<BaseSensitiveDO> {
    BaseSensitiveDO findBySensitiveWord(String sensitive);
}

+ 1 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/common/excel/AExcelReader.java

@ -1,6 +1,7 @@
package com.yihu.jw.base.endpoint.common.excel;
import com.yihu.jw.base.service.doctor.excelImport.BaseDoctorExcelDO;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;

+ 8 - 3
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/saas/SaasEndpoint.java

@ -186,13 +186,18 @@ public class SaasEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "size", value = "页码", required = true, defaultValue = "15")
            @RequestParam(value = "size") int size) throws Exception {
        List<SaasDO> saasDOS = saasService.search(fields, filters, sorts, page, size);
        if (saasDOS.isEmpty()){
        if (saasDOS==null&&saasDOS.size()==0){
            return PageEnvelop.getSuccess("无信息");
        }
        saasDOS.forEach(saas->{
        for (SaasDO saas : saasDOS) {
            SaasTypeDictDO saasTypeDictDO = saasTypeDictService.findById(saas.getType());
            if (saasTypeDictDO==null){
                return PageEnvelop.getSuccess("租户类型字典为空");
            }
            saas.setTypeName(saasTypeDictDO.getName());
        });
        }
        int count = (int)saasService.getCount(filters);
        return success(saasDOS, count, page, size, SaasVO.class);
    }

+ 176 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/word/BaseSensitiveEndpoint.java

@ -0,0 +1,176 @@
package com.yihu.jw.base.endpoint.word;
import com.yihu.jw.base.service.doctor.excelImport.BaseDoctorExcelDO;
import com.yihu.jw.base.service.word.BaseSensitiveService;
import com.yihu.jw.base.service.word.BaseSensitiveExcelReader;
import com.yihu.jw.base.service.word.excelImport.BaseSensitiveExcelDO;
import com.yihu.jw.exception.business.ManageException;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
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.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
 * @author HZY
 * @vsrsion 1.0
 * Created at 2020/7/6
 */
@RestController
@RequestMapping(value = BaseRequestMapping.BaseSensitive.PREFIX)
@Api(value = "敏感词汇管理", description = "敏感词汇管理服务接口", tags = {"wlyy基础服务 - 敏感词汇管理服务接口"})
public class BaseSensitiveEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private BaseSensitiveService baseSensitiveService;
    @Autowired
    private BaseSensitiveExcelReader baseSensitiveExcelReader;
    @Value("${fastDFS.fastdfs_file_url}")
    private String fastdfs_file_url;
    @PostMapping(value = BaseRequestMapping.BaseSensitive.createSensitiveWords)
    @ApiOperation(value = "创建敏感词汇")
    public MixEnvelop createSensitiveWords (
            @ApiParam(name = "words", value = "敏感词")
            @RequestParam(value = "words", required = false) String words,
            @ApiParam(name = "explanation", value = "说明")
            @RequestParam(value = "explanation", required = false) String explanation,
            @ApiParam(name = "status", value = "status")
            @RequestParam(value = "status", required = false,defaultValue = "1") String status) throws Exception {
        try {
            baseSensitiveService.createSensitiveWords(words,explanation,status,getUID(),getUNAME());
            return MixEnvelop.getSuccess("创建成功");
        } catch (Exception e) {
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @PostMapping(value = BaseRequestMapping.BaseSensitive.updateSensitiveWords)
    @ApiOperation(value = "更新敏感词汇")
    public MixEnvelop updateSensitiveWords (
            @ApiParam(name = "id", value = "id")
            @RequestParam(value = "id", required = false) String id,
            @ApiParam(name = "words", value = "敏感词")
            @RequestParam(value = "words", required = false) String words,
            @ApiParam(name = "explanation", value = "说明")
            @RequestParam(value = "explanation", required = false) String explanation,
            @ApiParam(name = "status", value = "status")
            @RequestParam(value = "status", required = false,defaultValue = "1") String status) throws Exception {
        try {
            baseSensitiveService.updateSensitiveWords(id,words,explanation,status,getUID(),getUNAME());
            return MixEnvelop.getSuccess("更新成功");
        } catch (Exception e) {
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = BaseRequestMapping.BaseSensitive.delSensitiveWords)
    @ApiOperation(value = "删除敏感词汇")
    public MixEnvelop delSensitiveWords (
            @ApiParam(name = "ids", value = "ids")
            @RequestParam(value = "ids", required = false) String ids) throws Exception {
        try {
            baseSensitiveService.delSensitiveWords(ids);
            return MixEnvelop.getSuccess("删除成功");
        } catch (Exception e) {
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = BaseRequestMapping.BaseSensitive.updateSensitiveWordsStatus)
    @ApiOperation(value = "修改敏感词汇状态")
    public MixEnvelop updateSensitiveWordsStatus (
            @ApiParam(name = "id", value = "id")
            @RequestParam(value = "id", required = false) String id,
            @ApiParam(name = "status", value = "status")
            @RequestParam(value = "status", required = false) String status) throws Exception {
        try {
            baseSensitiveService.updateSensitiveWordsStatus(id,status,getUID(),getUNAME());
            return MixEnvelop.getSuccess("修改成功");
        } catch (Exception e) {
            return MixEnvelop.getError(e.getMessage());
        }
    }
    @GetMapping(value = BaseRequestMapping.BaseSensitive.findSensitiveWords)
    @ApiOperation(value = "查找敏感词")
    public MixEnvelop findSensitiveWords (
            @ApiParam(name = "page", value = "page")
            @RequestParam(value = "page", required = false,defaultValue = "1") Integer page,
            @ApiParam(name = "pageSize", value = "pageSize")
            @RequestParam(value = "pageSize", required = false,defaultValue = "15") Integer pageSize,
            @ApiParam(name = "status", value = "status")
            @RequestParam(value = "status", required = false) String status,
            @ApiParam(name = "words", value = "words")
            @RequestParam(value = "words", required = false) String words) throws Exception {
        try {
            return baseSensitiveService.findSensitiveWords(status,words,page,pageSize);
        } catch (Exception e) {
            return MixEnvelop.getError(e.getMessage());
        }
    }
//    @GetMapping(value = BaseRequestMapping.BaseSensitive.importSensitiveWords)
//    @ApiOperation(value = "导入敏感词")
//    public MixEnvelop importSensitiveWords (
//            @ApiParam(name = "file", value = "文件", required = true)
//            @RequestPart(value = "file") MultipartFile file,
//            HttpServletRequest request) throws IOException, ManageException {
//        try {
//            request.setCharacterEncoding("UTF-8");
//            return baseSensitiveService.importSensitiveWords(file,getUID(),getUNAME());
//        } catch (Exception e) {
//            return MixEnvelop.getError(e.getMessage());
//        }
//    }
    @GetMapping(value = BaseRequestMapping.BaseSensitive.exportSensitiveWordsLog)
    @ApiOperation(value = "导出日志")
    public MixEnvelop exportSensitiveWordsLog () throws Exception {
            return baseSensitiveService.exportSensitiveWordsLog(fastdfs_file_url,getUID());
    }
    @GetMapping(value = BaseRequestMapping.BaseSensitive.importSensitiveWords)
    @ApiOperation(value = "导入敏感词")
    public Envelop importData(
            @ApiParam(name = "file", value = "文件", required = true)
            @RequestPart(value = "file") MultipartFile file,
            HttpServletRequest request) throws IOException, ManageException {
        try {
            request.setCharacterEncoding("UTF-8");
            baseSensitiveExcelReader.read(file);
            //验证未通过(暂无验证)
            List<BaseSensitiveExcelDO> correctLs = baseSensitiveExcelReader.getCorrectLs();
            if(correctLs.size()>0){
                Map<String, Object> result = baseSensitiveService.importSensitive(correctLs,getUID(),getUNAME());
                result.put("correctLs", correctLs);
                return success("导入成功!", result);
            }
        }catch (Exception e){
            e.printStackTrace();
            return failed("导入异常,请检查导入文件格式" + e.getMessage());
        }
        return failed("导入失败");
    }
}

+ 37 - 20
svr/svr-base/src/main/java/com/yihu/jw/base/service/doctor/BaseDoctorService.java

@ -28,6 +28,7 @@ import com.yihu.jw.restmodel.base.wx.WxReplySceneVO;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.security.MD5;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -84,6 +85,8 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
    @Autowired
    private DictDoctorDutyService dictDoctorDutyService;
    @Value("${wechat.flag}")
    private boolean flag;
@ -184,7 +187,12 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
                "\ttb.sex AS \"sex\",\n" +
                "\ttb.mobile AS \"mobile\",";
        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
            sql+="  wm_concat (tb.org || ',') AS \"orgInfo\",";
            if (flag){
                sql+=" GROUP_CONCAT(tb.org SEPARATOR ',') AS orgInfo,";
            }else {
                sql+="  wm_concat (tb.org || ',') AS \"orgInfo\",";
            }
        }else {
            sql+=" GROUP_CONCAT(tb.org SEPARATOR ',') AS orgInfo,";
        }
@ -275,25 +283,34 @@ public class BaseDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        List<Map<String,Object>> list=null;
        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
            String oracleSql="SELECT\n" +
                    "\t*\n" +
                    "FROM\n" +
                    "\t(\n" +
                    "\t\tSELECT\n" +
                    "\t\t\tA .*\n" +
                    "\t\tFROM\n" +
                    "\t\t\t(";
            oracleSql+=finalSql;
            oracleSql+="\t\t\t) A\n" +
                    "\t\tWHERE\n" +
                    "  ROWNUM <="+page*size +
                    "\t) \n" +
                    "WHERE\n" +
                    "\tROWNUM >= "+(page-1)*size;
            Logger.getAnonymousLogger().info("oracleSql="+oracleSql);
            list = jdbcTemplate.queryForList(oracleSql);
            if (flag){
                finalSql+=" LIMIT  " + (page - 1) * size + "," + size + "";
                Logger.getAnonymousLogger().info("finalCountSql="+finalSql);
                list = jdbcTemplate.queryForList(finalSql);
            }else {
                String oracleSql="SELECT\n" +
                        "\t*\n" +
                        "FROM\n" +
                        "\t(\n" +
                        "\t\tSELECT\n" +
                        "\t\t\tA .*\n" +
                        "\t\tFROM\n" +
                        "\t\t\t(";
                oracleSql+=finalSql;
                oracleSql+="\t\t\t) A\n" +
                        "\t\tWHERE\n" +
                        "  ROWNUM <="+page*size +
                        "\t) \n" +
                        "WHERE\n" +
                        "\tROWNUM >= "+(page-1)*size;
                Logger.getAnonymousLogger().info("oracleSql="+oracleSql);
                list = jdbcTemplate.queryForList(oracleSql);
            }
        }else {
            finalSql+=" LIMIT  " + (page - 1) * size + "," + size + "";
            Logger.getAnonymousLogger().info("finalCountSql="+finalSql);

+ 29 - 18
svr/svr-base/src/main/java/com/yihu/jw/base/service/org/BaseOrgService.java

@ -72,6 +72,8 @@ public class BaseOrgService extends BaseJpaService<BaseOrgDO, BaseOrgDao> {
    @Autowired
    private HibenateUtils hibenateUtils;
    @Value("${wechat.flag}")
    private boolean flag;
    /**
     * 机构基础信息列表
@ -149,25 +151,34 @@ public class BaseOrgService extends BaseJpaService<BaseOrgDO, BaseOrgDao> {
        List<Map<String, Object>> list=null;
        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
            String oracleSql="SELECT\n" +
                    "\t*\n" +
                    "FROM\n" +
                    "\t(\n" +
                    "\t\tSELECT\n" +
                    "\t\t\tA .*\n" +
                    "\t\tFROM\n" +
                    "\t\t\t(";
            oracleSql+=finalSql;
            oracleSql+="\t\t\t) A\n" +
                    "\t\tWHERE\n" +
                    "  ROWNUM <="+page*size +
                    "\t) \n" +
                    "WHERE\n" +
                    "\tROWNUM >= "+(page-1)*size;
            list = jdbcTemplate.queryForList(oracleSql);
            if (flag){
                finalSql+=" LIMIT  " + (page - 1) * size + "," + size + "";
                list = jdbcTemplate.queryForList(finalSql);
            }else {
                String oracleSql="SELECT\n" +
                        "\t*\n" +
                        "FROM\n" +
                        "\t(\n" +
                        "\t\tSELECT\n" +
                        "\t\t\tA .*\n" +
                        "\t\tFROM\n" +
                        "\t\t\t(";
                oracleSql+=finalSql;
                oracleSql+="\t\t\t) A\n" +
                        "\t\tWHERE\n" +
                        "  ROWNUM <="+page*size +
                        "\t) \n" +
                        "WHERE\n" +
                        "\tROWNUM >= "+(page-1)*size;
                list = jdbcTemplate.queryForList(oracleSql);
            }
        }else {
            finalSql+=" LIMIT  " + (page - 1) * size + "," + size + "";
            list = jdbcTemplate.queryForList(finalSql);

+ 29 - 19
svr/svr-base/src/main/java/com/yihu/jw/base/service/team/BaseTeamService.java

@ -25,6 +25,7 @@ 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.jdbc.core.BeanPropertyRowMapper;
import org.springframework.stereotype.Service;
import com.yihu.jw.entity.base.team.BaseTeamDO;
@ -69,6 +70,8 @@ public class BaseTeamService extends BaseJpaService<BaseTeamDO, BaseTeamDao> {
    private OrgTreeService orgTreeService;
    @Autowired
    private HibenateUtils hibenateUtils;
    @Value("${wechat.flag}")
    private boolean flag;
    /**
     * 新增团队
@ -380,25 +383,32 @@ public class BaseTeamService extends BaseJpaService<BaseTeamDO, BaseTeamDao> {
        List<Map<String,Object>>  list=null;
        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
            String oracleSql="SELECT\n" +
                    "\t*\n" +
                    "FROM\n" +
                    "\t(\n" +
                    "\t\tSELECT\n" +
                    "\t\t\tA .*\n" +
                    "\t\tFROM\n" +
                    "\t\t\t(";
            oracleSql+=finalSql;
            oracleSql+="\t\t\t) A\n" +
                    "\t\tWHERE\n" +
                    "  ROWNUM <="+page*size +
                    "\t) \n" +
                    "WHERE\n" +
                    "\tROWNUM >= "+(page-1)*size;
            Logger.getAnonymousLogger().info("oracleSql="+oracleSql);
            list = jdbcTemplate.queryForList(oracleSql);
            if (flag){
                finalSql+=" LIMIT  " + (page - 1) * size + "," + size + "";
                Logger.getAnonymousLogger().info("oracleSql="+finalSql);
                list = jdbcTemplate.queryForList(finalSql);
            }else {
                String oracleSql="SELECT\n" +
                        "\t*\n" +
                        "FROM\n" +
                        "\t(\n" +
                        "\t\tSELECT\n" +
                        "\t\t\tA .*\n" +
                        "\t\tFROM\n" +
                        "\t\t\t(";
                oracleSql+=finalSql;
                oracleSql+="\t\t\t) A\n" +
                        "\t\tWHERE\n" +
                        "  ROWNUM <="+page*size +
                        "\t) \n" +
                        "WHERE\n" +
                        "\tROWNUM >= "+(page-1)*size;
                Logger.getAnonymousLogger().info("oracleSql="+oracleSql);
                list = jdbcTemplate.queryForList(oracleSql);
            }
        }else {
            finalSql+=" LIMIT  " + (page - 1) * size + "," + size + "";
            Logger.getAnonymousLogger().info("oracleSql="+finalSql);

+ 30 - 19
svr/svr-base/src/main/java/com/yihu/jw/base/service/user/UserService.java

@ -82,6 +82,9 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Value("${wechat.flag}")
    private boolean flag;
    public UserDO registerWithIdcard(UserDO userDO) {
        userDO.setSalt(randomString(5));
@ -717,25 +720,33 @@ public class UserService extends BaseJpaService<UserDO, UserDao> {
        List<Map<String, Object>> list=null;
        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
            String oracleSql="SELECT\n" +
                    "\t*\n" +
                    "FROM\n" +
                    "\t(\n" +
                    "\t\tSELECT\n" +
                    "\t\t\tA .*\n" +
                    "\t\tFROM\n" +
                    "\t\t\t(";
            oracleSql+=sql;
            oracleSql+="\t\t\t) A\n" +
                    "\t\tWHERE\n" +
                    "  ROWNUM <="+page*size +
                    "\t) \n" +
                    "WHERE\n" +
                    "\tROWNUM >= "+(page-1)*size;
            Logger.getAnonymousLogger().info("oracleSql="+oracleSql);
            list = jdbcTemplate.queryForList(oracleSql);
            if (flag){
                sql+=" LIMIT  " + (page - 1) * size + "," + size + "";
                Logger.getAnonymousLogger().info("sql="+sql);
                list = jdbcTemplate.queryForList(sql);
            }else {
                String oracleSql="SELECT\n" +
                        "\t*\n" +
                        "FROM\n" +
                        "\t(\n" +
                        "\t\tSELECT\n" +
                        "\t\t\tA .*\n" +
                        "\t\tFROM\n" +
                        "\t\t\t(";
                oracleSql+=sql;
                oracleSql+="\t\t\t) A\n" +
                        "\t\tWHERE\n" +
                        "  ROWNUM <="+page*size +
                        "\t) \n" +
                        "WHERE\n" +
                        "\tROWNUM >= "+(page-1)*size;
                Logger.getAnonymousLogger().info("oracleSql="+oracleSql);
                list = jdbcTemplate.queryForList(oracleSql);
            }
        }else {
            sql+=" LIMIT  " + (page - 1) * size + "," + size + "";
            Logger.getAnonymousLogger().info("sql="+sql);

+ 60 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/word/BaseSensitiveExcelReader.java

@ -0,0 +1,60 @@
package com.yihu.jw.base.service.word;
import com.yihu.jw.base.dao.word.BaseSensitiveDao;
import com.yihu.jw.base.endpoint.common.excel.AExcelReader;
import com.yihu.jw.base.service.doctor.excelImport.BaseDoctorExcelDO;
import com.yihu.jw.base.service.word.excelImport.BaseSensitiveExcelDO;
import com.yihu.jw.entity.base.words.BaseSensitiveDO;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.HashSet;
import java.util.Iterator;
/**
 * @author HZY
 * @vsrsion 1.0
 * Created at 2020/7/7
 */
@Component
public class BaseSensitiveExcelReader extends AExcelReader {
    @Override
    public void read(Workbook rwb) throws Exception {
        try{
            Sheet sheetAt = rwb.getSheetAt(0);
//            Iterator<Sheet> sheets = rwb.sheetIterator();
            int j = 0, rows;
            BaseSensitiveExcelDO baseSensitiveExcelDO;
            getRepeat().put("id", new HashSet<>());
            getRepeat().put("sensitiveWords", new HashSet<>());
            getRepeat().put("explanation", new HashSet<>());
//            while (sheets.hasNext()){
//                Sheet sheet = sheets.next();
                if ((rows = sheetAt.getLastRowNum()) == 0) {
                   return;
                }
                for (int i = 1; i <= rows; i++) {
                    baseSensitiveExcelDO = new BaseSensitiveExcelDO();
                    baseSensitiveExcelDO.setId(getCellCont(sheetAt, i, 0));
                    baseSensitiveExcelDO.setSensitiveWord(getCellCont(sheetAt, i, 1));
                    baseSensitiveExcelDO.setExplanation(getCellCont(sheetAt, i, 2));
                    baseSensitiveExcelDO.validate(repeat);
                    correctLs.add(baseSensitiveExcelDO);
                    errorLs.add(baseSensitiveExcelDO);
                }
                j++;
//            }
        }catch (Exception e){
            e.printStackTrace();
            throw e;
        }finally {
            if (rwb != null) {
                rwb.close();
            }
        }
    }
}

+ 246 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/word/BaseSensitiveService.java

@ -0,0 +1,246 @@
package com.yihu.jw.base.service.word;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.base.dao.word.BaseImportSensitiveDao;
import com.yihu.jw.base.dao.word.BaseSensitiveDao;
import com.yihu.jw.base.service.doctor.excelImport.BaseDoctorExcelDO;
import com.yihu.jw.base.service.word.excelImport.BaseSensitiveExcelDO;
import com.yihu.jw.base.useragent.UserAgent;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.sync.BaseSyncDataDO;
import com.yihu.jw.entity.base.words.BaseImportSensitiveDO;
import com.yihu.jw.entity.base.words.BaseSensitiveDO;
import com.yihu.jw.file_upload.FileUploadService;
import com.yihu.jw.restmodel.iot.common.UploadVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.rm.health.house.HealthyHouseMapping;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.stereotype.Service;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.util.*;
import java.util.logging.Logger;
/**
 * @author HZY
 * @vsrsion 1.0
 * Created at 2020/7/6
 */
@Service
public class BaseSensitiveService extends BaseJpaService<BaseSensitiveDO, BaseSensitiveDao> {
    @Autowired
    private BaseSensitiveDao baseSensitiveDao;
    @Autowired
    private BaseImportSensitiveDao baseImportSensitiveDao;
    @Autowired
    FileUploadService fileUploadService;
    /**
     * 创建敏感词汇
     * @param words
     * @param explanation
     */
    public void createSensitiveWords(String words, String explanation,String status,String operatorCode,String name) {
        BaseSensitiveDO baseSensitiveDO = new BaseSensitiveDO();
        baseSensitiveDO.setSensitiveWord(words);
        baseSensitiveDO.setExplanation(explanation);
        baseSensitiveDO.setStatus(status);
        baseSensitiveDO.setAddTime(DateUtil.getNowDate());
        baseSensitiveDO.setOperatorCode(operatorCode);
        baseSensitiveDO.setOperator(name);
        baseSensitiveDao.save(baseSensitiveDO);
    }
    /**
     * 更新敏感词汇
     * @param id
     * @param words
     * @param explanation
     */
    public void updateSensitiveWords(String id, String words, String explanation,String status,String operatorCode,String name) {
        BaseSensitiveDO baseSensitiveDO = baseSensitiveDao.findOne(id);
        baseSensitiveDO.setSensitiveWord(words);
        baseSensitiveDO.setExplanation(explanation);
        baseSensitiveDO.setRenewTime(DateUtil.getNowDate());
        baseSensitiveDO.setOperatorCode(operatorCode);
        baseSensitiveDO.setOperator(name);
        baseSensitiveDO.setStatus(status);
        baseSensitiveDao.save(baseSensitiveDO);
    }
    /**
     * 删除敏感词
     * @param ids
     */
    public void delSensitiveWords(String ids) {
        List<String> list = JSONObject.parseObject(ids, List.class);
        for (String id : list) {
            baseSensitiveDao.delete(id);
        }
    }
    /**
     * 修改敏感词状态
     * @param id
     * @param status
     */
    public void updateSensitiveWordsStatus(String id, String status,String operatorCode,String name) {
        BaseSensitiveDO baseSensitiveDO = baseSensitiveDao.findOne(id);
        baseSensitiveDO.setStatus(status);
        baseSensitiveDO.setRenewTime(DateUtil.getNowDate());
        baseSensitiveDO.setOperatorCode(operatorCode);
        baseSensitiveDO.setOperator(name);
        baseSensitiveDao.save(baseSensitiveDO);
    }
    /**
     * 查询所有敏感词
     * @param status
     * @param words
     * @param page
     * @param pageSize
     * @return
     */
    public MixEnvelop findSensitiveWords(String status, String words, Integer page, Integer pageSize) {
        StringBuffer sql = new StringBuffer("select * from base_sensitive s where 1=1 ");
        StringBuffer countSql = new StringBuffer("select count(*) count from base_sensitive s where 1=1 ");
        if (StringUtils.isNotEmpty(status)){
            sql.append(" AND s.status='").append(status).append("'");
            countSql.append(" AND s.status='").append(status).append("'");
        }
        if (StringUtils.isNotEmpty(words)){
            sql.append(" AND (s.sensitive like'%").append(words).append("%'").append(" or ").append("s.explanation like'%").append(words).append("%')");
            countSql.append(" AND (s.sensitive like'%").append(words).append("%'").append(" or ").append("s.explanation like'%").append(words).append("%')");
        }
        sql.append(" ORDER BY s.renew_time desc LIMIT ").append((page-1)*pageSize).append(",").append(pageSize);
        Logger.getAnonymousLogger().info("sql="+sql.toString());
        List<BaseSensitiveDO> list = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper<>(BaseSensitiveDO.class));
        List<Map<String, Object>> mapList = jdbcTemplate.queryForList(countSql.toString());
        long count = (long)mapList.get(0).get("count");
        return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find,list,page,pageSize,count);
    }
    /**
     * 导出敏感词日志
     * @param url
     * @param operatorCode
     * @return
     */
    public MixEnvelop exportSensitiveWordsLog(String url,String operatorCode){
        String sql="SELECT * FROM base_import_sensitive b WHERE b.create_time=(SELECT MAX(b.create_time) FROM base_import_sensitive b) and b.operator_code="+operatorCode;
        //获取日志
        List<BaseImportSensitiveDO> list =jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(BaseImportSensitiveDO.class));
        //拼接字符串
        StringBuffer text = new StringBuffer();
        for(BaseImportSensitiveDO one:list){
            text.append("第");
            text.append(one.getRow());
            text.append("行");
            text.append("   ");
            text.append(one.getProblem());
            text.append("\r\n");//换行字符
        }
        InputStream is = new ByteArrayInputStream(text.toString().getBytes());
        String name = genAttachmentFileName("导入日志.txt", "import.txt");
        UploadVO uploadVO=new UploadVO();
        try {
            Logger.getAnonymousLogger().info("文件上传参数=name"+name+"---url="+url);
            uploadVO = fileUploadService.uploadStream(is, name, url);
        } catch (Exception e) {
            e.printStackTrace();
            Logger.getAnonymousLogger().info("文件上传失败");
            Logger.getAnonymousLogger().info(e.getMessage());
            return MixEnvelop.getError("日志导出失败");
        }
        return MixEnvelop.getSuccess("下载日志成功",uploadVO);
    }
    public  String genAttachmentFileName(String cnName, String defaultName) {
        try {
            cnName = new String(cnName.getBytes("gb2312"), "ISO8859-1");
        } catch (Exception e) {
            cnName = defaultName;
        }
        return cnName;
    }
    /**
     * 导入敏感词
     * @param correctLs
     * @return
     */
    public Map<String, Object> importSensitive(List<BaseSensitiveExcelDO> correctLs,String operatorCode,String name) {
        Map<String, Object> rs = new HashMap<>();
        int total = correctLs.size();
        rs.put("total",total);
        Date nowDate = DateUtil.getNowDate();
        for (BaseSensitiveExcelDO one : correctLs) {
            BaseSensitiveDO sensitive = baseSensitiveDao.findBySensitiveWord(one.getSensitiveWord());
            if (sensitive!=null){
                BaseImportSensitiveDO importSensitiveDO = new BaseImportSensitiveDO();
                importSensitiveDO.setRow(one.getId());
                importSensitiveDO.setProblem("敏感词已存在");
                importSensitiveDO.setCreateTime(nowDate);
                importSensitiveDO.setOperatorCode(operatorCode);
                importSensitiveDO.setOperator(name);
                baseImportSensitiveDao.save(importSensitiveDO);
                total-=1;
                continue;
            }
            if (StringUtils.isEmpty(one.getSensitiveWord())){
                BaseImportSensitiveDO importSensitiveDO = new BaseImportSensitiveDO();
                importSensitiveDO.setRow(one.getId());
                importSensitiveDO.setProblem("敏感词为空");
                importSensitiveDO.setCreateTime(nowDate);
                importSensitiveDO.setOperatorCode(operatorCode);
                importSensitiveDO.setOperator(name);
                baseImportSensitiveDao.save(importSensitiveDO);
                total-=1;
                continue;
            }
            BaseSensitiveDO baseSensitiveDO = new BaseSensitiveDO();
            baseSensitiveDO.setId(UUID.randomUUID().toString().replaceAll("-",""));
            baseSensitiveDO.setStatus("1");
            baseSensitiveDO.setExplanation(one.getExplanation());
            baseSensitiveDO.setSensitiveWord(one.getSensitiveWord());
            baseSensitiveDO.setOperatorCode(operatorCode);
            baseSensitiveDO.setOperator(name);
            baseSensitiveDO.setAddTime(nowDate);
            baseSensitiveDao.save(baseSensitiveDO);
        }
        rs.put("success",total);
        return rs;
    }
}

+ 64 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/word/excelImport/BaseSensitiveExcelDO.java

@ -0,0 +1,64 @@
package com.yihu.jw.base.service.word.excelImport;
import com.yihu.jw.util.excel.ExcelUtil;
import com.yihu.jw.util.excel.Validation;
import com.yihu.jw.util.excel.annotation.Location;
import com.yihu.jw.util.excel.annotation.Row;
import com.yihu.jw.util.excel.annotation.Title;
import com.yihu.jw.util.excel.annotation.ValidRepeat;
import java.util.Map;
import java.util.Set;
/**
 * @author HZY
 * @vsrsion 1.0
 * Created at 2020/7/7
 */
@Row(start = 1)
@Title(names= "{'序号', '敏感词','说明'}")
public class BaseSensitiveExcelDO extends ExcelUtil implements Validation {
    @Location(x=0)
    @ValidRepeat
    String id;
    @Location(x=1)
    @ValidRepeat
    String sensitiveWord;
    @Location(x=2)
    @ValidRepeat
    String explanation;
    @Override
    public int validate(Map<String, Set> repeatMap) throws Exception {
        int rs = 1;
        return rs;
    }
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getSensitiveWord() {
        return sensitiveWord;
    }
    public void setSensitiveWord(String sensitiveWord) {
        this.sensitiveWord = sensitiveWord;
    }
    public String getExplanation() {
        return explanation;
    }
    public void setExplanation(String explanation) {
        this.explanation = explanation;
    }
}

+ 29 - 17
svr/svr-base/src/main/java/com/yihu/jw/base/service/wx/WechatService.java

@ -19,6 +19,7 @@ import com.yihu.jw.wechat.service.WxAccessTokenService;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
@ -61,6 +62,9 @@ public class WechatService {
    @Autowired
    private HibenateUtils hibenateUtils;
    @Value("${wechat.flag}")
    private boolean flag;
    //====================微信与租户管理=======================
    public MixEnvelop getWxWechatList(String name,String saasName,Integer status,Integer publicType,Integer page,Integer size,String wechatId){
@ -112,25 +116,33 @@ public class WechatService {
        List<WxWechatVO> list =null;
        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
            String oracleSql="SELECT\n" +
                    "\t*\n" +
                    "FROM\n" +
                    "\t(\n" +
                    "\t\tSELECT\n" +
                    "\t\t\tA .*\n" +
                    "\t\tFROM\n" +
                    "\t\t\t(";
            oracleSql+=sql;
            if (flag){
                sql += " LIMIT " + (page - 1) * size + "," + size + "";
                Logger.getAnonymousLogger().info("sql="+sql);
                list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(WxWechatVO.class));
            }else {
                String oracleSql="SELECT\n" +
                        "\t*\n" +
                        "FROM\n" +
                        "\t(\n" +
                        "\t\tSELECT\n" +
                        "\t\t\tA .*\n" +
                        "\t\tFROM\n" +
                        "\t\t\t(";
                oracleSql+=sql;
                oracleSql+="\t\t\t) A\n" +
                        "\t\tWHERE\n" +
                        "  ROWNUM <="+page*size +
                        "\t) \n" +
                        "WHERE\n" +
                        "\tROWNUM >= "+(page-1)*size;
                Logger.getAnonymousLogger().info("oracleSql="+oracleSql);
                list = jdbcTemplate.query(oracleSql, new BeanPropertyRowMapper(WxWechatVO.class));
            }
            oracleSql+="\t\t\t) A\n" +
                    "\t\tWHERE\n" +
                    "  ROWNUM <="+page*size +
                    "\t) \n" +
                    "WHERE\n" +
                    "\tROWNUM >= "+(page-1)*size;
            Logger.getAnonymousLogger().info("oracleSql="+oracleSql);
            list = jdbcTemplate.query(oracleSql, new BeanPropertyRowMapper(WxWechatVO.class));
        }else {
            sql += " LIMIT " + (page - 1) * size + "," + size + "";
            Logger.getAnonymousLogger().info("sql="+sql);

+ 2 - 0
svr/svr-base/src/main/resources/application.yml

@ -163,6 +163,7 @@ wlyy:
  url: http://ehr.yihu.com/wlyy/
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040
  flag: false
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0
@ -511,6 +512,7 @@ wlyy:
  url: http://ehr.yihu.com/wlyy/
wechat:
  id: xm_ykyy_wx
  flag: true
#文件服务器上传配置 0本地,1.I健康,2.内网调用
testPattern:
  sign: 0

+ 4 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/PatientConsultEndpoint.java

@ -628,11 +628,13 @@ public class PatientConsultEndpoint extends EnvelopRestEndpoint {
			@ApiParam(name = "scoreContent", value = "评价内容")
			@RequestParam(value = "scoreContent",required = false) String scoreContent,
			@ApiParam(name = "type", value = "1、实名,2、匿名")
			@RequestParam(value = "type",required = true) Integer type)throws Exception{
			@RequestParam(value = "type",required = true) Integer type,
			@ApiParam(name = "pennantList",value = "锦旗")
			@RequestParam(value = "pennantList",required = false) String pennantList)throws Exception{
//		if(StringUtils.isEmpty(scoreContent)){
//			scoreContent= "[{\"scoreType\":\"1\",\"score\":100,\"content\":\"\"},{\"scoreType\":\"2\",\"score\":80,\"content\":\"\"},{\"scoreType\":\"3\",\"score\":80,\"content\":\"\"},{\"scoreType\":\"4\",\"score\":0,\"content\":\"测试评语。。。。123123\"}]";
//		}
		imService.evaluationByConsultCode(consult,scoreContent,type);
		imService.evaluationByConsultCode(consult,scoreContent,type,pennantList);
		return success("请求成功");
	}