Browse Source

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

wangzhinan 1 year ago
parent
commit
f631c0bfb9

+ 1 - 1
common/common-entity/src/main/java/com/yihu/jw/entity/base/servicePackage/ServiceItemPlanDO.java

@ -16,7 +16,7 @@ import javax.persistence.Transient;
public class ServiceItemPlanDO extends UuidIdentityEntityWithCreateTime {
    private String patient;//居民id
    private String status;//状态0未完成 1已完成
    private String status;//状态0未完成 1已完成 2待补录
    private String planTime;//计划时间
    private String completeTime;//完成时间
    private String doctor;//医生id

+ 11 - 2
common/common-entity/src/main/java/com/yihu/jw/entity/door/WlyyDoorServiceOrderDO.java

@ -3,7 +3,6 @@ package com.yihu.jw.entity.door;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import com.yihu.jw.entity.followup.Followup;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import javax.persistence.Column;
import javax.persistence.Entity;
@ -556,7 +555,8 @@ public class WlyyDoorServiceOrderDO extends UuidIdentityEntityWithOperator {
     * 会话id
     */
    private String sessionId;
    //咨询id
    private String consultId;
    /**
     * 服务机构
     */
@ -1293,4 +1293,13 @@ public class WlyyDoorServiceOrderDO extends UuidIdentityEntityWithOperator {
    public void setPlanItemDetailId(String planItemDetailId) {
        this.planItemDetailId = planItemDetailId;
    }
    @Transient
    public String getConsultId() {
        return consultId;
    }
    public void setConsultId(String consultId) {
        this.consultId = consultId;
    }
}

+ 10 - 25
svr/svr-internet-hospital-entrance/pom.xml

@ -81,25 +81,6 @@
            <!--<groupId>com.yihu.jw</groupId>-->
            <!--<artifactId>common-util</artifactId>-->
        <!--</dependency>-->
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>base-service</artifactId>
            <version>${project.parent.version}</version>
            <exclusions>
                <exclusion>
                    <groupId>xalan</groupId>
                    <artifactId>xalan</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>javax.el</artifactId>
                    <groupId>org.glassfish</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>cron-utils</artifactId>
                    <groupId>com.cronutils</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>im-service</artifactId>
@ -135,10 +116,18 @@
            <artifactId>base-service</artifactId>
            <version>${version.wlyy-common}</version>
            <exclusions>
                <exclusion>
                    <groupId>xalan</groupId>
                    <artifactId>xalan</artifactId>
                </exclusion>
                <exclusion>
                    <artifactId>javax.el</artifactId>
                    <groupId>org.glassfish</groupId>
                </exclusion>
                <exclusion>
                    <artifactId>cron-utils</artifactId>
                    <groupId>com.cronutils</groupId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
@ -214,15 +203,11 @@
            <groupId>net.java.dev.jna</groupId>
            <artifactId>jna</artifactId>
            <version>4.2.2</version>
            <scope>system</scope>
            <systemPath>${basedir}/src/main/lib/jna-4.2.2.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>com.zoesoft</groupId>
            <artifactId>zoe-encrypt-sm</artifactId>
            <version>1.0-PK-SNAPSHOT</version>
            <scope>system</scope>
            <systemPath>${basedir}/src/main/lib/zoe-encrypt-sm-1.0-PK-SNAPSHOT.jar</systemPath>
            <version>1.0</version>
        </dependency>
    </dependencies>
@ -264,7 +249,7 @@
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                            <excludeTransitive>false</excludeTransitive>
                            <stripVersion>false</stripVersion>
                            <includeScope>runtime</includeScope>
                            <includeScope>compile</includeScope>
                        </configuration>
                    </execution>
                </executions>

+ 13 - 5
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/service/IotDeviceService.java

@ -1,11 +1,15 @@
package com.yihu.jw.entrance.service;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entrance.util.zysoft.ZysoftBaseService;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
 * 三院物联网对接
@ -16,6 +20,8 @@ public class IotDeviceService {
    @Autowired
    private ZysoftBaseService zysoftBaseService;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    /**
     * 获取accesstoken
@ -24,13 +30,15 @@ public class IotDeviceService {
     */
    public String getAccessToken() throws Exception{
        Map<String,String> header = new HashMap<>();
        header.put("ORGCODE","350211A1004");
        header.put("LICENCE","1GPM6UKII0NF33155F0A0000348D061E");
        List<WlyyHospitalSysDictDO> dictDOList =  wlyyHospitalSysDictDao.findByDictName("zy_iot");
        Map<String,String> dictMap = dictDOList.stream().collect(Collectors.toMap(WlyyHospitalSysDictDO::getDictCode,WlyyHospitalSysDictDO::getDictValue));
        header.put("ORGCODE",dictMap.get("ORGCODE"));
        header.put("LICENCE",dictMap.get("LICENCE"));
        Map<String,String> params = new HashMap<>();
        params.put("appid","dsyy808081724b116c017254d437fe0008");
        params.put("appSecret","dsyy808081724b116c017254d437fe0008");
        String response = zysoftBaseService.postSecondYg("accesstoken","获取accesstoken",params,null,header,false,5,"5");
        params.put("appid",dictMap.get("appid"));
        params.put("appSecret",dictMap.get("appSecret"));
        String response = zysoftBaseService.postSecondYg("accesstoken","获取accesstoken",params,null,header,false,0);
        return response;
    }

+ 3 - 3
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/service/LogService.java

@ -63,15 +63,15 @@ public class LogService {
    /**
     * 保存http调用日志【基卫接口】
     **/
    public void saveHttpLog(Boolean isSuccess,String url,String content,String method,String header,String params,String response,String error)
    public void saveHttpLog(Boolean isSuccess,String url,String content,String method,String params,String response,String error)
    {
        saveHttpLog( isSuccess, url, content, method, header, params, response, error,"1");
        saveHttpLog( isSuccess, url, content, method,  params, response, error,"1");
    }
    /**
     * 保存http调用日志    0开放api  1基卫接口  2市民健康网接口   3易联众接口  4长处方接口
     **/
    public void saveHttpLog(Boolean isSuccess,String url,String content,String method,String header,String params,String response,String error,String type)
    public void saveHttpLog(Boolean isSuccess,String url,String content,String method,String params,String response,String error,String type)
    {
        try {
            WlyyHttpLogDO log = new WlyyHttpLogDO();

+ 2 - 2
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/util/zysoft/ZysoftApiSeconde.java

@ -20,8 +20,8 @@ import java.util.Map;
 **/
public class ZysoftApiSeconde extends AbstractApiExecuter2 {
//    private static final String keyPath = "D:\\jkzl\\wlyy2.0-springb2.4\\svr\\svr-internet-hospital-entrance\\src\\main\\resources";
    private static final String keyPath = "/data/hospital/svr-internet-hospital-entrance-1024/resources";
    private static final String keyPath = "D:\\jkzl\\wlyy2.0-springb2.4\\svr\\svr-internet-hospital-entrance\\src\\main\\resources";
//    private static final String keyPath = "/data/hospital/svr-internet-hospital-entrance-10024/resources";
    @Override

+ 20 - 23
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/util/zysoft/ZysoftBaseService.java

@ -48,7 +48,16 @@ public class ZysoftBaseService {
     * @return
     */
    private String getBaseApi(Integer apiType){
        return "wlw";
        String baseApi = "";
        switch (apiType){
            case 0:
                baseApi = "/wlw/accesstoken";
                break;
            default:
                baseApi = "";
                break;
        }
        return baseApi;
    }
@ -208,58 +217,46 @@ public class ZysoftBaseService {
     * YG请求 新的公钥和私钥
     */
    public String postSecondYg(String api,String content, Map<String,String> params,JSONObject jsonParams, Map<String,String> headers,
                               boolean needRetry,Integer apiType,String type) throws Exception
                               boolean needRetry,Integer apiType) throws Exception
    {
        String re = "";
        headers.put("INTERFACE",api);
        Map<String,String> paramsList = new HashMap<>();
        String msgBody = params==null?JSONObject.toJSONString(jsonParams, SerializerFeature.WriteMapNullValue):
                JSONObject.toJSONString(params, SerializerFeature.WriteMapNullValue);
        String msgHeader = JSONObject.toJSONString(headers, SerializerFeature.WriteMapNullValue);
        paramsList.put("msgHeader",msgHeader);
        paramsList.put("msgBody",msgBody);
        logger.info("msgHeader:"+msgHeader+"\r\n");
        logger.info("msgBody:"+msgBody+"\r\n");
        //新增日志
        String method = "POST";
        Boolean isSuccess = true;
        String error = "";
        String msgBody = params==null?JSONObject.toJSONString(jsonParams, SerializerFeature.WriteMapNullValue):
                JSONObject.toJSONString(params, SerializerFeature.WriteMapNullValue);
        String baseApi = getBaseApi(apiType);
        int times = 0;
        try {
            re = ZysoftApiSeconde.getSingleton().post(baseApi, paramsList, null,openCrypto,"SM2_V2",headers.get("LICENCE").toString());
            re = ZysoftApiSeconde.getSingleton().post(baseApi, params, null,openCrypto,"SM2_V2", headers.get("LICENCE"));
            if(needRetry)
            {
                int maxTimes = retryTimes;
                while(maxTimes>0 && re.contains("接口调用传入的参数[msgHeader]格式不正确"))    //基卫bug预防,重调接口
                {
                    re = ZysoftApiSeconde.getSingleton().post(baseApi, paramsList, null,openCrypto,"SM2_V2",headers.get("LICENCE").toString());
                    re = ZysoftApiSeconde.getSingleton().post(baseApi, params, null,openCrypto,"SM2_V2", headers.get("LICENCE"));
                    maxTimes --;
                    times++;
                }
            }
            logger.info("=====接口返回============="+re);
            Map<String,String> map = objectMapper.readValue(re,Map.class);
            String code = map.get("CODE");
            if(!code.equals("1"))
            if(!"1".equals(code)&&code!=null)
            {
                throw new HttpApiException(Integer.valueOf(code),map.get("MESSAGE"));
                throw new HttpApiException(Integer.parseInt(code),map.get("MESSAGE"));
            }
            //保存http日志
            logService.saveHttpLog(isSuccess,api,content,method,msgHeader,msgBody,re,error);
            logService.saveHttpLog(isSuccess,api,content,method,msgBody,re,error);
        }
        catch (Exception ex)
        {
            ex.printStackTrace();
            //保存http日志
            logService.saveHttpLog(isSuccess,api,content,method,msgHeader,msgBody,re,error);
            logService.saveHttpLog(isSuccess,api,content,method,msgBody,re,error);
            if(ex instanceof ApiException)
            {

+ 51 - 10
svr/svr-internet-hospital-entrance/src/main/resources/application.yml

@ -1,13 +1,15 @@
#通用的配置不用区分环境变量
server:
#  port: ${server.svr-internet-hospital-entrance-port}
  #  port: ${server.svr-internet-hospital-entrance-port}
  port: 10023
spring:
  aop:
    proxy-target-class: true
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    max-active: 50
    max-idle: 50 #最大空闲连接
    max-active: 200
    max-idle: 200 #最大空闲连接
    min-idle: 10 #最小空闲连接
    validation-query-timeout: 20
    log-validation-errors: true
@ -15,16 +17,12 @@ spring:
    validation-query: SELECT 1 #SQL 查询, 用来验证从连接池取出的连接, 在将连接返回给调用者之前。 如果指定, 则查询必须是一个SQL SELECT 并且必须返回至少一行记录
    test-on-borrow: true #指明是否在从池中取出连接前进行检验, 如果检验失败, 则从池中去除连接并尝试取出另一个。注意: 设置为true 后如果要生效,validationQuery 参数必须设置为非空字符串
    test-on-return: true #指明是否在归还到池中前进行检验 注意: 设置为true 后如果要生效validationQuery 参数必须设置为非空字符串
    idle-timeout: 30000
    idle-timeout: 20000
    connection-test-query: SELECT 1
    num-tests-per-eviction-run: 50 #在每次空闲连接回收器线程(如果有)运行时检查的连接数量,最好和maxActive
    num-tests-per-eviction-run: 200 #在每次空闲连接回收器线程(如果有)运行时检查的连接数量,最好和maxActive
    test-while-idle: true #指明连接是否被空闲连接回收器(如果有)进行检验,如果检测失败,则连接将被从池中去除
    min-evictable-idle-time-millis: 3600000 #连接池中连接,在时间段内一直空闲,被逐出连接池的时间(1000*60*60),以毫秒为单位
    time-between-eviction-runs-millis: 300000 #在空闲连接回收器线程运行期间休眠的时间值,以毫秒为单位,一般比minEvictableIdleTimeMillis小
  http:
    multipart:
      max-file-size: 30MB
      max-request-size: 100MB
  main:
    allow-bean-definition-overriding: true
  redis:
@ -39,7 +37,7 @@ spring:
  application:
    name: svr-internet-hospital-entrance
fast-dfs:
#  tracker-server: 172.26.0.110:22122 #服务器地址
  #  tracker-server: 172.26.0.110:22122 #服务器地址
  connect-timeout: 2 #链接超时时间
  network-timeout: 30
  charset: ISO8859-1 #编码
@ -620,3 +618,46 @@ express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: WH000061
  sf_check_word: BEWFSCXSyjt4314rz
---
#海沧医院内网
spring:
  profiles: mlwTest
  datasource:
    url: jdbc:mysql://172.26.0.114:3306/base?useUnicode=true&characterEncoding=utf-8&autoReconnect=true&useSSL=false
    username: root
    password: 4D^tK%!4
# mq 是否获取his数据,flag代表获取演示数据,false代表获取his真实数据
demo:
  flag: false
#支付支付
pay:
  flag: true
hospital:
  url: https://wx.xmzsh.com
  mqUser: JKZL
  mqPwd: 123456
  SourceSysCode: S60
  TargetSysCode: S01
im:
  im_list_get: http://192.168.118.240:3000/
  data_base_name: im
fastDFS:
  fastdfs_file_url: http://127.0.0.1:8888/
fast-dfs:
  tracker-server: :22122 #服务器地址
#是否开启i健康接口 0关闭,1开启
testPattern:
  sign: 0
wlyy:
  url: http://www.xmtyw.cn/wlyytest/
wechat:
  id: xm_xzzx_wx  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
  url: http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: WH000061
  sf_check_word: BEWFSCXSyjt4314rz

+ 3 - 1
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/door/service/DoorOrderService.java

@ -450,6 +450,7 @@ public class DoorOrderService {
        System.out.println("consult==>" + JSON.toJSONString(consult));
        if (null != consult) {
            doorServiceOrder.setSessionId(doorServiceOrder.getPatient() + "_" + consult.getId() + "_" + doorServiceOrder.getNumber() + "_" + consult.getType());
            doorServiceOrder.setConsultId(consult.getId());
        }
        // 设置服务小结
@ -926,7 +927,7 @@ public class DoorOrderService {
                                       String doctorCode, Integer examPaperStatus, Integer page, Integer pageSize, Integer type, String name, String serverType) throws Exception {
        StringBuilder sqlList = new StringBuilder(
                "select DISTINCT o.id as orderId,o.status," +
//                        "h.org_name AS hospitalName, " +//这个会重复
                        "o.relation_code AS relationCode, " +
                        " h.org_code AS hospital," +
                        "o.is_trans_other_org,o.transed_org_code ,o.patient_name," +
                        " o.patient_phone,o.remark,o.serve_desc,dc.service_time,o.patient as patientCode ," +
@ -997,6 +998,7 @@ public class DoorOrderService {
            JSONObject object = new JSONObject();
            object.put("id", one.get("orderId"));
            object.put("serverCode", one.get("serverCode"));
            object.put("relationCode", one.get("relationCode"));
            Integer statustemp = Integer.valueOf(one.get("status") + "");
            String statusName = "";
            switch (statustemp) {

+ 25 - 12
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/door/service/WlyyDoorServiceOrderService.java

@ -9,6 +9,7 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.servicePackage.ServiceItemPlanDO;
import com.yihu.jw.entity.door.*;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.file_upload.FileUploadService;
@ -16,12 +17,11 @@ import com.yihu.jw.hospital.HospitalDao;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.hospital.module.consult.service.ConsultTeamService;
import com.yihu.jw.hospital.module.door.dao.*;
import com.yihu.jw.hospital.module.rehabilitation.service.RehabilitationManageService;
import com.yihu.jw.hospital.task.PushMsgTask;
import com.yihu.jw.hospital.utils.WeiXinAccessTokenUtils;
import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.order.BusinessOrderService;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.service.BasePatientService;
import com.yihu.jw.restmodel.ResponseContant;
@ -30,6 +30,7 @@ import com.yihu.jw.restmodel.qvo.ParamQvo;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.QrcodeUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.entity.ServiceException;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.utils.EntityUtils;
import com.yihu.jw.wechat.dao.WxTemplateConfigDao;
@ -70,21 +71,14 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
    private Logger logger = LoggerFactory.getLogger(WlyyDoorServiceOrderService.class);
//    @Value("${server.server_url}")
//    private String wxServerUrl;
//    @Value("${doctorAssistant.api}")
//    private String doctorAssistant;
//    @Value("${doctorAssistant.target_url}")
//    private String targetUrl;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Autowired
    private BusinessOrderDao businessOrderDao;
    private ServiceItemPlanDao serviceItemPlanDao;
    @Autowired
    private BusinessOrderService businessOrderService;
    private RehabilitationManageService rehabilitationManageService;
    @Autowired
    private WlyyDoorServiceOrderDao wlyyDoorServiceOrderDao;
@ -726,8 +720,27 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
            orderDO.setType(2);
        }
        orderDO.setServiceStatus("1");//服务类型 1-预约项目 2-即时项目
        //关联code不为空情况
        ServiceItemPlanDO serviceItemPlanDO = null;
        if(StringUtils.isNotBlank(orderDO.getRelationCode())){
            serviceItemPlanDO = serviceItemPlanDao.findById(orderDO.getRelationCode()).orElse(null);
            if(serviceItemPlanDO!=null){
                if("1".equals(serviceItemPlanDO.getStatus())){
                    throw new ServiceException("请勿重复申请");
                }
                orderDO.setDoctor(serviceItemPlanDO.getDoctor());
                orderDO.setDoctorName(serviceItemPlanDO.getDoctorName());
            }
        }
        //保存服务订单
        wlyyDoorServiceOrderDao.save(orderDO);
        orderDO = wlyyDoorServiceOrderDao.save(orderDO);
        if(serviceItemPlanDO!=null){
            serviceItemPlanDO.setRelationCode(orderDO.getId());
            rehabilitationManageService.completePlan(serviceItemPlanDO);
        }
        //新增工单与服务项费用关联关系
        if (orderWithPackageItemFeeAdd(result, jsonObjectParam, orderDO)) {

+ 16 - 0
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/controller/RehabilitationManageController.java

@ -43,6 +43,22 @@ public class RehabilitationManageController extends EnvelopRestEndpoint {
    @Autowired
    private RehabilitationGuidanceService rehabilitationGuidanceService;
    @PostMapping(value = "updItemPlanStatus")
    @ApiOperation("电话关怀,状态更新成待补录")
    public Envelop updItemPlanStatus(
            @ApiParam(name = "id", value = "执行计划id", required = true)
            @RequestParam(value = "id", required = true) String id) {
        try {
            rehabilitationManageService.updItemPlanStatus(id,getUID());
            return Envelop.getSuccess("操作成功");
        }catch (ServiceException se){
            return Envelop.getError(se.getMessage());
        }catch (Exception e) {
            e.printStackTrace();
            return Envelop.getError("操作失败");
        }
    }
    @PostMapping(value = "completePlan")
    @ApiOperation("确认完成服务,填写服务笔记")
    public Envelop completePlan(

+ 15 - 0
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/rehabilitation/service/RehabilitationManageService.java

@ -1389,6 +1389,21 @@ public class RehabilitationManageService {
        return detailDOList;
    }
    //电话关怀,状态更新成待补录
    public void updItemPlanStatus(String id,String doctor){
        ServiceItemPlanDO planDO = serviceItemPlanDao.findById(id).orElse(null);
        if(!planDO.getDoctor().equals(doctor)){
            throw new ServiceException("不是您的任务,无法操作");
        }
        if("1".equals(planDO.getStatus())){
            throw new ServiceException("任务已完成,请勿重复操作");
        }
        if("0".equals(planDO.getStatus())){
            planDO.setStatus("2");
            serviceItemPlanDao.save(planDO);
        }
    }
    //确认完成服务,填写服务笔记
    public ServiceItemPlanDO completePlan(String id,String content,String appendixs,String doctor){
        ServiceItemPlanDO planDO = serviceItemPlanDao.findById(id).orElse(null);