sinake
23 小时以前 371603a0eb9f3a279cf77073734e991b5851b792
市一短信接口同步服务对接
已添加3个文件
已修改8个文件
210 ■■■■ 文件已修改
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/SmsController.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/tools/BaseSmsaccountController.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application-druid.yml 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application-hzszlyy.yml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-common/src/main/java/com/ruoyi/common/utils/sms/smsUtils.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/CollectHISServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
smartor/src/main/java/com/smartor/domain/smsVO.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/SmsController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,46 @@
package com.ruoyi.web.controller.common;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.common.utils.sms.smsUtils;
import com.ruoyi.framework.config.ServerConfig;
import com.smartor.domain.HtmlContentVO;
import com.smartor.domain.smsVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@RestController
@Api(description = "知信接口")
@RequestMapping("/sms")
public class SmsController {
    @Value("${xhsmsPath}")
    private String xhsmsPath;
    @Value("${xhsmsAccount}")
    private String xhsmsAccount;
    @Value("${xhsmsPwd}")
    private String xhsmsPwd;
    /**
     * @param
     * @return
     */
    @ApiOperation("短信发送")
    @PostMapping("/send")
    public AjaxResult send(@RequestBody smsVO vo) {
        String sendMsg=smsUtils.sendSms(xhsmsPath,xhsmsAccount,xhsmsPwd,vo.getPhone(),vo.getContent());
        return AjaxResult.success(sendMsg);
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/tools/BaseSmsaccountController.java
@@ -1,5 +1,8 @@
package com.ruoyi.web.controller.smartor.tools;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.annotation.RepeatSubmit;
import com.ruoyi.common.core.controller.BaseController;
@@ -7,6 +10,7 @@
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.utils.sms.smsUtils;
import com.smartor.domain.BaseSmsRequest;
import com.smartor.domain.BaseSmsaccount;
import com.smartor.domain.BatchBaseSmsRequest;
@@ -16,6 +20,7 @@
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.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@@ -34,6 +39,18 @@
public class BaseSmsaccountController extends BaseController {
    @Autowired
    private IBaseSmsaccountService baseSmsaccountService;
    @Value("${visitHosp}")
    private Integer visitHosp;
    @Value("${xhsmsPath}")
    private String xhsmsPath;
    @Value("${xhsmsAccount}")
    private String xhsmsAccount;
    @Value("${xhsmsPwd}")
    private String xhsmsPwd;
    /**
     * æŸ¥è¯¢çŸ­ä¿¡è´¦å·åˆ—表
@@ -105,11 +122,23 @@
    @PostMapping("/sendMsg")
    @RepeatSubmit
    public AjaxResult sendMsg(@RequestBody BaseSmsRequest baseSmsRequest) {
        String sendMsg="";
        if(visitHosp.equals("3")) {
            try{
                JSONObject jsTemp = JSON.parseObject(baseSmsRequest.getTemplateParam());
                String content=jsTemp.getString("name");
                sendMsg= smsUtils.sendSms(xhsmsPath,xhsmsAccount,xhsmsPwd,baseSmsRequest.getPhoneNumber(),content);
            } catch (Exception ex) {
                return AjaxResult.error(ex.getMessage()) ;
            }
            return AjaxResult.success(sendMsg);
        }else {
        if (baseSmsaccountService.sendMsg(baseSmsRequest) == null) {
            return error();
        }
        return success(baseSmsaccountService.sendMsg(baseSmsRequest));
    }
    }
    /**
     * æ‰¹é‡çŸ­ä¿¡å‘送
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysLoginController.java
@@ -6,7 +6,6 @@
import com.ruoyi.common.core.domain.entity.SysMenu;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginBody;
import com.ruoyi.common.dx.MessageSend;
import com.ruoyi.common.utils.RSAPublicKeyExample;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
ruoyi-admin/src/main/resources/application-druid.yml
@@ -23,24 +23,20 @@
        #        password: 123456
        #        driverClassName: com.mysql.cj.jdbc.Driver
        #        # æ–°åŽ
#        url: jdbc:mysql://192.168.100.10:3306/smartor_xinhua?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
        #        url: jdbc:mysql://192.168.191.181:3308/smartor?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
#        username: smartor
#        password: Smartor.2023
#        driverClassName: com.mysql.cj.jdbc.Driver
        #  å…¬å¸äº‘
        url: jdbc:mysql://116.62.18.175:6002/smartor_sltd?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
        username: hxsoft
        password: Smartor.2023
        #  ob数据库存
#        url: jdbc:mysql://127.0.0.1:2881/smartor-lisui?useUnicode=true&characterEncoding=utf8&serverTimezone=Asia/Shanghai
#        username: root@sys
#        password:
#        url: jdbc:mysql://116.62.18.175:6002/smartor_xinhua?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
#        username: hxsoft
#        password: Hxerp2000
#        driverClassName: com.mysql.cj.jdbc.Driver
        #  å…¬å¸æœ¬åœ°
#        url: jdbc:mysql://192.168.100.10:3306/smartor_lishui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
        #        username: smartor
        #        password: Smartor.2023
        url: jdbc:mysql://192.168.100.10:3306/smartor_lishui?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
        username: smartor
        password: Smartor.2023
        driverClassName: com.mysql.cj.jdbc.Driver
      #        # é«˜æ–¯æ•°æ®åº“配置
@@ -117,9 +113,8 @@
            multi-statement-allow: true
  # redis é…ç½®
  redis:
    host: 127.0.0.1
    host: 192.168.100.10
    port: 6020
    # æ•°æ®åº“索引
    database: 0
    # å¯†ç 
@@ -276,8 +271,4 @@
#随访医院:1新华   2丽水
visitHosp: 2
#处理投诉建议的部门编码
dealDeptCode: 40003024
#是否加密  0不加   1加密
isEncryp: 0
isEncryp:
ruoyi-admin/src/main/resources/application-hzszlyy.yml
@@ -176,13 +176,11 @@
#app_key_yq: ZurNHpaQLq6P55YS
#本 åœ° çŸ­ä¿¡è¯·æ±‚地址(这个服务是我们自己写的)
#xhsmsPath: http://192.168.2.13:8092/sendSms
#新华短信请求地址(这个服务是我们自己写的)
xhsmsPath: http://192.16.4.220:8092/sendSms
xhsmsPath: http://192.169.140.240:8001/sms/api/sendMessageMass
#帐号
xhsmsAccount: 911124
xhsmsAccount: 300044
#接口密码
xhsmsPwd: zW5eXe
xhsmsPwd: qj0NHDegxWhj
#虚拟接入码
xhsmsjrm: 1069055
@@ -215,5 +213,5 @@
#admin管理员userId
isAdmin: 1,2,3,4,5,6,7,8,9,10,11,12,13
#随访医院:1新华   2丽水
visitHosp: 2
#随访医院:1新华   2丽水 3 æ­å·žå¸‚一医院吴山院区
visitHosp: 3
ruoyi-admin/src/main/resources/application.yml
@@ -74,7 +74,7 @@
    # å›½é™…化资源文件路径
    basename: i18n/messages
  profiles:
    active: ls
    active: hzszlyy
  # æ–‡ä»¶ä¸Šä¼ 
  servlet:
    multipart:
ruoyi-common/src/main/java/com/ruoyi/common/utils/sms/smsUtils.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,42 @@
package com.ruoyi.common.utils.sms;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.utils.HttpUtil;
import com.ruoyi.common.utils.sign.Md5Utils;
import org.springframework.beans.factory.annotation.Value;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
public class smsUtils {
    /**
     * æ­å·žå¸‚一医院吴山院区我短信接口
     *
     * @param url      çŸ­ä¿¡URL
     * @param userName çŸ­ä¿¡å¸å·
     * @param content  çŸ­ä¿¡å¯†ç 
     * @param phone    æ‰‹æœºå·ç»„合如 13500000001,13500000002
     * @param content  çŸ­ä¿¡å†…容
     * @return ä¸¤ä¸ªå‚数的和
     */
    public static String sendSms(String url, String userName, String passWord, String phone, String content) {
        long timestamp = new Date().getTime();
        String sign = Md5Utils.hash(userName + timestamp + Md5Utils.hash(passWord));
        content = "【杭州市一医院吴山院区】" + content;
        String jsonMsg = "{" +
                "\"userName\": \"" + userName + "\"," +
                "\"content\": \"" + content + "\"," +
                "\"phoneList\": [" + phone + "]," +
                "\"timestamp\": " + timestamp + "," +
                "\"sign\": \"" + sign + "\"" +
                "}";
        return HttpUtil.postJsonRequest(url, jsonMsg);
    }
}
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
@@ -111,6 +111,7 @@
                .antMatchers("/login", "/register", "/captchaImage", "/qrcode/generateStaticHtml", "/qrcode/getQRcode", "/qrcode/getFormDate", "/chat", "/system/file/admin/uploadFile", "/smartor/dingtalk/sendNotification", "/patient/read/patientInfo", "/socket", "/API_ESB_Service", "/API_ESB_Service/Run", "/magic/web/**", "/smartor/serviceSubtask/phoneCallBack", "/smartor/serviceSubtask/taskPull", "/smartor/serviceSubtask/phoneCallBackYQ", "/smartor/robot/callstatus", "/smartor/robot/aidialog", "/smartor/robot/cdrinfo", "/getToken", "/smartor/subtaskAnswer/getQuestionCache", "/smartor/subtaskAnswer/saveQuestionCache", "/smartor/servicetask/getScriptInfoByCondition", "/smartor/subtaskAnswer/saveQuestionAnswer", "/smartor/import/download", "/smartor/serviceSubtask/recordAccept", "/smartor/outPath/getInfoByParam", "/smartor/serviceExternal/addDeptInfo", "/smartor/serviceExternal/**", "/sso/**","/smartor/sltdHealthcareRecord/**").permitAll()
                // é™æ€èµ„源,可匿名访问
                .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll().antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll()
                .antMatchers("/smartor/organization/list").permitAll()
                // é™¤ä¸Šé¢å¤–的所有请求全部需要鉴权认证
                .anyRequest().authenticated().and().headers().frameOptions().disable();
        // æ·»åŠ Logout filter
ruoyi-quartz/src/main/java/com/ruoyi/quartz/service/impl/CollectHISServiceImpl.java
@@ -11,6 +11,7 @@
import com.smartor.mapper.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Service;
@@ -82,6 +83,7 @@
    @Override
    public Integer selectPatMedInhospList(PatMedInhosp patMedInhosp) {
        List<PatMedInhosp> patMedInhospList = chMapper.selectPatMedInhospList(patMedInhosp);
        log.info("可同步病人数量"+patMedInhospList.size());
        for (PatMedInhosp pm : patMedInhospList) {
            PatArchive patArchive = new PatArchive();
            patArchive.setPatientno(pm.getPatno());
@@ -126,7 +128,10 @@
    @Override
    public Boolean hnDataGather(HnDataGatherVO hnDataGatherVO) {
        if(ObjectUtils.isEmpty(hnDataGatherVO.getStartTime()) )
            hnDataGatherVO.setStartTime(new Date());
        if(ObjectUtils.isEmpty(hnDataGatherVO.getEndTime()) )
            hnDataGatherVO.setEndTime(new Date());
        LocalDate startDate = hnDataGatherVO.getStartTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
        LocalDate endDate = hnDataGatherVO.getEndTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
ruoyi-quartz/src/main/resources/mapper/quartz/CollectHISMapper.xml
@@ -395,7 +395,7 @@
            <if test="uploadTime != null ">and upload_time = #{uploadTime}</if>
            <if test="viptype != null ">and viptype = #{viptype}</if>
            <if test="pattype != null ">and pattype = #{pattype}</if>
            <if test="patientno != null ">and patientno = CAST(#{patientno} AS INTEGER)</if>
            <if test="patientno != null ">and patientno = #{patientno}</if>
            <if test="patidHis != null ">and patid_his = #{patidHis}</if>
            <if test="sdFlag != null ">and sd_flag = #{sdFlag}</if>
            <if test="ageUnit != null ">and age_unit = #{ageUnit}</if>
@@ -489,17 +489,17 @@
        healthy_inhosp b
        <where>
            <if test="startOutHospTime != null ">and to_char(b.endtime,'YYMMDD') &gt;=
                to_char(#{startOutHospTime}::date,'YYMMDD')
            <if test="startOutHospTime != null ">
                and to_char(b.endtime, 'YYYY-MM-DD HH24:MI:SS') &gt;=to_char(#{startOutHospTime},'YYYY-MM-DD HH24:MI:SS')
            </if>
            <if test="endOutHospTime != null ">and to_char(b.endtime,'YYMMDD') &lt;=
                to_char(#{endOutHospTime}::date,'YYMMDD')
            <if test="endOutHospTime != null ">
                and to_char(b.endtime, 'YYYY-MM-DD HH24:MI:SS') &lt;= to_char(#{endOutHospTime},'YYYY-MM-DD HH24:MI:SS')
            </if>
            <if test="startInHospTime != null ">and to_char(b.starttime,'YYMMDD') &gt;=
                to_char(#{startInHospTime}::date,'%y%m%d')
            <if test="startInHospTime != null ">
                and to_char(starttime, 'YYYY-MM-DD HH24:MI:SS') &gt;= to_char(#{startInHospTime},'YYYY-MM-DD HH24:MI:SS')
            </if>
            <if test="endInHospTime != null ">and to_char(b.starttime,'YYMMDD') &lt;=
                to_char(#{endInHospTime}::date,'YYMMDD')
            <if test="endInHospTime != null ">
                and to_char(starttime, 'YYYY-MM-DD HH24:MI:SS') &lt;=to_char(#{endInHospTime},'YYYY-MM-DD HH24:MI:SS')
            </if>
            <if test="inhospno != null ">and b.inhospno = #{inhospno}</if>
            <if test="fuflag != null ">and b.fuflag = #{fuflag}</if>
@@ -540,11 +540,11 @@
        from healthy_outhosp
        <where>
            <if test="beginTime != null ">and to_char( admitdate,'YYMMDD') &gt;=
                to_char(#{beginTime}::date,'YYMMDD')
            <if test="beginTime != null ">
                and to_char(admitdate, 'YYYY-MM-DD HH24:MI:SS') &gt;= to_char(#{beginTime}, 'YYYY-MM-DD HH24:MI:SS')
            </if>
            <if test="endTime != null ">and to_char( admitdate,'YYMMDD') &lt;=
                to_char(#{endTime}::date,'YYMMDD')
            <if test="endTime != null ">
                and to_char(admitdate, 'YYYY-MM-DD HH24:MI:SS') &lt;= to_char(#{endTime}, 'YYYY-MM-DD HH24:MI:SS')
            </if>
        </where>
smartor/src/main/java/com/smartor/domain/smsVO.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
package com.smartor.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "smsVO", description = "短信")
public class smsVO {
    @ApiModelProperty(value = "手机号")
    private String phone;
    @ApiModelProperty(value = "短信内容")
    private String content;
}