Ver código fonte

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

huangwenjie 4 anos atrás
pai
commit
f498cf5a19

+ 3 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionExpressageService.java

@ -41,14 +41,17 @@ public class PrescriptionExpressageService extends BaseJpaService<WlyyPrescripti
    //顺丰快递接口请求地址
    @Value("${express.sf_url}")
    private String sf_url;
    
    //顺丰快递接口接入编码
    @Value("${express.sf_code}")
    private String sf_code;
    //顺丰快递接口checkword
    @Value("${express.sf_check_word}")
    private String sf_check_word;

+ 74 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -117,6 +117,9 @@ public class EntranceService {
    @Autowired
    private DoctorZsInfoDao doctorZsInfoDao;
    private static String entranceUrl="http://172.16.100.240:10023/mqsdk/";
//    private static String entranceUrl="http://localhost:10023/mqsdk/";
    /**
     * 获取本地示例返参
     *
@ -2570,5 +2573,76 @@ public class EntranceService {
        return ConvertUtil.convertListEnvelopInBody(resp);
    }
//=====================hospital应用调用entrance应用============start=================
    /**
     * 医生信息同步
     * @return
     * @throws Exception
     */
    public Integer syncMS02003() throws Exception {
        String response="";
        String url = entranceUrl+"MS02003";
        response = httpClientUtil.get(url,"GBK");
        com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(response);
        if(object.getInteger("status")==200){
            String obj = object.getString("obj");
        }
        return object.getInteger("status");
    }
    /**
     * 医生简介同步
     * @return
     * @throws Exception
     */
    public Integer syncBS16010() throws Exception {
        String response="";
        String doctorCode="";
        String url = entranceUrl+"BS16010?doctorCode="+doctorCode;
        response = httpClientUtil.get(url,"GBK");
        com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(response);
        if(object.getInteger("status")==200){
            String obj = object.getString("obj");
        }
        return object.getInteger("status");
    }
    /**
     * 科室简介同步
     * @return
     * @throws Exception
     */
    public Integer syncBS16011() throws Exception {
        String response="";
        String depNumber="";
        String url = entranceUrl+"BS16011?depNumber="+depNumber;
        response = httpClientUtil.get(url,"GBK");
        com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(response);
        if(object.getInteger("status")==200){
            String obj = object.getString("obj");
        }
        return object.getInteger("status");
    }
    /**
     * 同步医生信息
     * @return
     * @throws Exception
     */
    public Integer syncDoctorInfo() throws Exception {
        String response="";
        String idcard="";
        String url = entranceUrl+"sysDoctorInfo?idcard="+idcard;
        response = httpClientUtil.get(url,"GBK");
        com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(response);
        if(object.getInteger("status")==200){
            String obj = object.getString("obj");
        }
        return object.getInteger("status");
    }
//=====================hospital应用调用entrance应用============end=================
}

+ 79 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java

@ -109,6 +109,7 @@ public class XzzxEntranceService{
    public static String sendMessageUrl ="http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage";
    public static String entranceUrl = "http://172.16.100.240:10023/xzzx/";
//    public static String entranceUrl = "http://localhost:10023/xzzx/";
    public String getSelectUrl(){
@ -1114,6 +1115,84 @@ public class XzzxEntranceService{
    }
    /**
     * 同步医生信息
     * @return
     * @throws Exception
     */
    public Integer syncDoctorInfo() throws Exception {
        String response="";
        String idCard="";
        String url = entranceUrl+"getDoctorInfo?idCard="+idCard;
        response = httpClientUtil.get(url,"GBK");
        JSONObject object = JSONObject.parseObject(response);
        if(object.getInteger("status")==200){
            String obj = object.getString("obj");
        }
        return object.getInteger("status");
    }
    /**
     * 同步部门信息
     * @return
     * @throws Exception
     */
    public Integer syncDeptInfo() throws Exception {
        String response="";
        String code="";
        String url = entranceUrl+"getDeptInfo?code="+code;
        response = httpClientUtil.get(url,"GBK");
        JSONObject object = JSONObject.parseObject(response);
        if(object.getInteger("status")==200){
            String obj = object.getString("obj");
        }
        return object.getInteger("status");
    }
    /**
     * 同步职称
     * @return
     * @throws Exception
     */
    public Integer syncJobTitle() throws Exception {
        String response="";
        String url = entranceUrl+"getJobTitle";
        response = httpClientUtil.get(url,"GBK");
        JSONObject object = JSONObject.parseObject(response);
        if(object.getInteger("status")==200){
            String obj = object.getString("obj");
        }
        return object.getInteger("status");
    }
    /**
     * 同步号别
     * @return
     * @throws Exception
     */
    public Integer syncChargeDict() throws Exception {
        String response="";
        String url = entranceUrl+"getChargeDict";
        response = httpClientUtil.get(url,"GBK");
        JSONObject object = JSONObject.parseObject(response);
        if(object.getInteger("status")==200){
            String obj = object.getString("obj");
        }
        return object.getInteger("status");
    }
    /**
     * 获取卡信息
     * @param cardNo 就诊卡

+ 4 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -68,6 +68,7 @@ public class YkyyEntranceService {
    private final static String url="http://192.168.20.55:10023/ykyy/createSQLQuery";
//    private final static String url="http://localhost:10023/ykyy/createSQLQuery";
    private final static String saveUrl="http://192.168.20.55:10023/ykyy/save";
@ -135,6 +136,7 @@ public class YkyyEntranceService {
    private YkyyService ykyyService;
    public List<Map<String, Object>> createSQLQuery(String sql, Map<String, Object> params, Integer page, Integer size){
        return hibenateUtils.createSQLQuery(sql,params,page,size);
    }
@ -1897,4 +1899,6 @@ public class YkyyEntranceService {
            return "推送成功";
        }
    }
}

+ 5 - 4
common/common-entity/src/main/java/com/yihu/jw/entity/base/sync/BaseSyncDataDO.java

@ -1,5 +1,6 @@
package com.yihu.jw.entity.base.sync;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
@ -18,18 +19,18 @@ public class BaseSyncDataDO extends UuidIdentityEntityWithOperator implements ja
    @Column(name = "style")
    private String style;//同步方式 1:手动同步 2:自动同步
    private Integer style;//同步方式 1:手动同步 2:自动同步
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    @Column(name = "complete_time")
    private Date completeTime; //完成时间
    @Column(name = "sync_result")
    private String syncResult;//同步结果
    public String getStyle() {
    public Integer getStyle() {
        return style;
    }
    public void setStyle(String style) {
    public void setStyle(Integer style) {
        this.style = style;
    }

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

@ -685,6 +685,7 @@ public class BaseRequestMapping {
    public static class SyncData extends Basic {
        public static final String PREFIX  = "/syncData";
        public static final String findAllSyncData  = "/findAllSyncData";
        public static final String syncComplete  = "/syncComplete";
        public static final String findDataByTime  = "/findDataByTime";
    }

+ 20 - 26
svr/svr-base/src/main/java/com/yihu/jw/base/endpoint/sync/BaseSyncDataEndpoint.java

@ -1,13 +1,16 @@
package com.yihu.jw.base.endpoint.sync;
import com.yihu.jw.base.service.sync.BaseSyncDataService;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
import com.yihu.jw.rm.iot.IotRequestMapping;
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.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@ -28,45 +31,36 @@ public class BaseSyncDataEndpoint  extends EnvelopRestEndpoint {
    private BaseSyncDataService baseSyncDataService;
    @GetMapping(value = BaseRequestMapping.SyncData.findAllSyncData)
    @ApiOperation(value = "获取同步数据列表")
    public PageEnvelop findAllSyncData( @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "")
                                            @RequestParam(value = "page") Integer page,
                                        @ApiParam(name = "size", value = "页码", required = true, defaultValue = "")
                                            @RequestParam(value = "size") Integer size){
        try {
            if(page == null|| page < 0){
                page = 1;
            }
            if(size == null){
                size = 10;
            }
            return   baseSyncDataService.findAll(page,size);
        }catch (Exception e){
            return PageEnvelop.getError(e.getMessage(),-1);
        }
    }
    @Value("${wechat.id}")
    private String wxId;
    @GetMapping(value = BaseRequestMapping.SyncData.findDataByTime)
    @GetMapping(value = BaseRequestMapping.SyncData.findAllSyncData)
    @ApiOperation(value = "获取同步数据列表")
    public PageEnvelop findDataByTime( @ApiParam(name = "startTime", value = "开始时间", required = true, defaultValue = "")
                                        @RequestParam(value = "startTime") String startTime,
                                        @ApiParam(name = "endTime", value = "结束时间", required = true, defaultValue = "")
                                        @RequestParam(value = "endTime") String endTime,
                                       @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "")
    public PageEnvelop findAllSyncData( @ApiParam(name = "startTime", value = "开始时间", required = false, defaultValue = "")
                                        @RequestParam(value = "startTime",required = false) String startTime,
                                        @ApiParam(name = "endTime", value = "结束时间", required = false, defaultValue = "")
                                        @RequestParam(value = "endTime",required = false) String endTime,
                                       @ApiParam(name = "page", value = "分页大小", required = true, defaultValue = "1")
                                           @RequestParam(value = "page") Integer page,
                                       @ApiParam(name = "size", value = "页码", required = true, defaultValue = "")
                                       @ApiParam(name = "size", value = "页码", required = true, defaultValue = "10")
                                           @RequestParam(value = "size") Integer size){
        try {
            return   baseSyncDataService.findDataByTime(startTime,endTime,page,size);
            return   baseSyncDataService.findAllSyncData(startTime,endTime,page,size);
        }catch (Exception e){
            return PageEnvelop.getError(e.getMessage(),-1);
        }
    }
    @GetMapping(value = BaseRequestMapping.SyncData.syncComplete)
    @ApiOperation(value = "同步数据")
    public MixEnvelop syncComplete(){
        baseSyncDataService.complete(wxId);
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find);
    }
}

+ 69 - 17
svr/svr-base/src/main/java/com/yihu/jw/base/service/sync/BaseSyncDataService.java

@ -3,9 +3,12 @@ package com.yihu.jw.base.service.sync;
import com.yihu.jw.base.dao.sync.BaseSyncDataDao;
import com.yihu.jw.base.useragent.UserAgent;
import com.yihu.jw.entity.base.sync.BaseSyncDataDO;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.rm.iot.IotRequestMapping;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.mysql.query.BaseJpaService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -32,17 +35,25 @@ public class BaseSyncDataService extends BaseJpaService<BaseSyncDataDO, BaseSync
    @Autowired
    private UserAgent userAgent;
    public PageEnvelop findAll(Integer page, Integer size){
        StringBuffer sql= new StringBuffer("SELECT * FROM wlyy_data_sync ");
        sql.append(" ORDER BY complete_time LIMIT ").append((page-1)*size).append(",").append(size);
        List<BaseSyncDataDO> list = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper<>(BaseSyncDataDO.class));
    @Autowired
    private YkyyEntranceService ykyyEntranceService;
        long count =list.size();
    @Autowired
    private EntranceService entranceService;
        return PageEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find,list,page,size,count);
    }
    @Autowired
    private BaseSyncDataDao baseSyncDataDao;
//    public PageEnvelop findAll(Integer page, Integer size){
//
//        StringBuffer sql= new StringBuffer("SELECT * FROM wlyy_data_sync ");
//        sql.append(" ORDER BY complete_time LIMIT ").append((page-1)*size).append(",").append(size);
//
//        List<BaseSyncDataDO> list = jdbcTemplate.query(sql.toString(), new BeanPropertyRowMapper<>(BaseSyncDataDO.class));
//
//        long count =list.size();
//
//        return PageEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find,list,page,size,count);
//    }
    /**
     * 根据时间查询
@ -50,7 +61,7 @@ public class BaseSyncDataService extends BaseJpaService<BaseSyncDataDO, BaseSync
     * @param endTime
     * @return
     */
    public PageEnvelop findDataByTime(String startTime, String endTime,Integer page,Integer size) {
    public PageEnvelop findAllSyncData(String startTime, String endTime,Integer page,Integer size) {
        StringBuffer sql= new StringBuffer("SELECT c.* FROM wlyy_data_sync c WHERE 1=1 ");
        if (StringUtils.isNotBlank(startTime)&&StringUtils.isNotBlank(endTime)){
@ -71,18 +82,59 @@ public class BaseSyncDataService extends BaseJpaService<BaseSyncDataDO, BaseSync
     * 完成同步
     * @return
     */
    public void complete () {
    public void complete (String wxId) {
        BaseSyncDataDO syncDataDO = new BaseSyncDataDO();
        syncDataDO.setUpdateTime(DateUtil.getNowDate());
        syncDataDO.setStyle(1);
        try {
            xzzxEntranceService.getDoctorInfo("");
            xzzxEntranceService.randomString(1);
            xzzxEntranceService.getJobTitle();
            xzzxEntranceService.getChargeDict();
            syncDataDO.setSyncResult("进行中");
            //眼科中心
            if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
                String result = ykyyEntranceService.updateYkyyDept();
                String re = ykyyEntranceService.updateYkyyDoctor();
                if (result.equalsIgnoreCase("success")&&re.equalsIgnoreCase("success")){
                    syncDataDO.setSyncResult("同步成功");
                }else {
                    syncDataDO.setSyncResult("同步失败");
                }
                syncDataDO.setCompleteTime(DateUtil.getNowDate());
            }
            //心脏中心
            if ("xm_xzzx_wx".equalsIgnoreCase(wxId)){
                Integer doctorInfo = xzzxEntranceService.syncDoctorInfo();
                Integer deptInfo = xzzxEntranceService.syncDeptInfo();
                Integer jobTitle = xzzxEntranceService.syncJobTitle();
                Integer chargeDict = xzzxEntranceService.syncChargeDict();
                if (deptInfo==200&&doctorInfo==200&&jobTitle==200&&chargeDict==200){
                    syncDataDO.setSyncResult("同步成功");
                }else {
                    syncDataDO.setSyncResult("同步失败");
                }
                syncDataDO.setCompleteTime(DateUtil.getNowDate());
            }
            if("xm_zsyy_wx".equalsIgnoreCase(wxId)){
                Integer syncMS02003 = entranceService.syncMS02003();
                Integer syncBS16010 = entranceService.syncBS16010();
                Integer syncBS16011 = entranceService.syncBS16011();
                Integer integer1 = entranceService.syncDoctorInfo();
                if (syncMS02003==200&&syncBS16010==200&&syncBS16011==200&&integer1==200){
                    syncDataDO.setSyncResult("同步成功");
                }else {
                    syncDataDO.setSyncResult("同步失败");
                }
                syncDataDO.setCompleteTime(DateUtil.getNowDate());
            }
        } catch (Exception e) {
            syncDataDO.setSyncResult("同步失败");
            syncDataDO.setCompleteTime(DateUtil.getNowDate());
            e.printStackTrace();
        }
        syncDataDO.setCreateUserName(userAgent.getUNAME());
        baseSyncDataDao.save(syncDataDO);
    }
}

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

@ -2,6 +2,11 @@
server:
  port: ${server.svr-base-port}
express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
spring:
  datasource:
    driver-class-name: com.mysql.jdbc.Driver

+ 4 - 2
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/XzzxCotroller.java

@ -26,14 +26,16 @@ public class XzzxCotroller extends EnvelopRestEndpoint {
    @GetMapping(value = "/getDeptInfo")
    @ApiOperation(value = "获取部门信息", notes = "获取部门信息")
    public ObjEnvelop getDeptInfo(String code)throws Exception{
    public ObjEnvelop getDeptInfo(@ApiParam(name = "code", value = "code", required = false)
                                      @RequestParam(value = "code",required = false)String code)throws Exception{
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.getDeptInfo(code));
    }
    @GetMapping(value = "/getDoctorInfo")
    @ApiOperation(value = "获取医生信息", notes = "获取医生信息")
    public ObjEnvelop getDoctorInfo(String idcard)throws Exception{
    public ObjEnvelop getDoctorInfo(@ApiParam(name = "idCard", value = "身份证号", required = false)
                                        @RequestParam(value = "idCard",required = false)String idcard)throws Exception{
        return ObjEnvelop.getSuccess("ok",xzzxEntranceService.getDoctorInfo(idcard));
    }

+ 2 - 0
svr/svr-iot/src/main/java/com/yihu/iot/dao/platform/IotInterfaceLogDao.java

@ -17,4 +17,6 @@ public interface IotInterfaceLogDao extends PagingAndSortingRepository<IotInterf
    @Query("from IotInterfaceLogDO w where w.interfaceName=?1")
    List<IotInterfaceLogDO>  findAllByInterfaceName(String interfaceName);
    List<IotInterfaceLogDO>  findByAppId(String appId);
}

+ 28 - 0
svr/svr-iot/src/main/java/com/yihu/iot/service/company/IotCompanyService.java

@ -2,9 +2,11 @@ package com.yihu.iot.service.company;
import com.yihu.iot.dao.company.*;
import com.yihu.iot.dao.platform.IotCompanyAppInterfaceDao;
import com.yihu.iot.dao.platform.IotInterfaceLogDao;
import com.yihu.iot.service.useragent.UserAgent;
import com.yihu.jw.entity.iot.company.*;
import com.yihu.jw.entity.iot.platform.IotCompanyAppInterfaceDO;
import com.yihu.jw.entity.iot.platform.IotInterfaceLogDO;
import com.yihu.jw.restmodel.iot.company.IotCompanyAppVO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.iot.company.IotCompanyTypeVO;
@ -44,6 +46,8 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
    private UserAgent userAgent;
    @Autowired
    private IotCompanyAppInterfaceDao iotCompanyAppInterfaceDao;
    @Autowired
    private IotInterfaceLogDao iotInterfaceLogDao;
//    /**
@ -860,6 +864,30 @@ public class IotCompanyService extends BaseJpaService<IotCompanyDO,IotCompanyDao
                oldApp.setCompanyName(iotCompany.getName());
                oldApp.setSaasId(getCode());
                iotCompanyAppDao.save(oldApp);
                //修改平台申请接口的应用信息
                List<IotCompanyAppInterfaceDO> appInterfaceDOList = iotCompanyAppInterfaceDao.findByAppId(newApp.getId());
                if (appInterfaceDOList!=null&&appInterfaceDOList.size()>0){
                    appInterfaceDOList.forEach(one->{
                        one.setCompanyName(iotCompany.getName());
                        one.setCompanyId(iotCompany.getId());
                        one.setAppName(newApp.getName());
                        iotCompanyAppInterfaceDao.save(one);
                    });
                }
                //修改应用接口日志信息
                List<IotInterfaceLogDO> iotInterfaceLogDOS = iotInterfaceLogDao.findByAppId(newApp.getId());
                if (iotInterfaceLogDOS!=null&&iotInterfaceLogDOS.size()>0){
                    iotInterfaceLogDOS.forEach(one->{
                        one.setCompanyName(iotCompany.getName());
                        one.setCompanyId(iotCompany.getId());
                        one.setAppName(newApp.getName());
                        iotInterfaceLogDao.save(one);
                    });
                }
            }else {
                newApp.setDel("1");
                newApp.setCompanyName(iotCompany.getName());