Browse Source

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

liubing 4 years ago
parent
commit
2a2b24da4e

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

@ -4704,7 +4704,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if (basePatientDO!=null){
            patienName = basePatientDO.getName();
        }
        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
        if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)||"sd_tnzyy_wx".equalsIgnoreCase(wechatId)){
            List<BasePatientWechatDo> ps = new ArrayList<BasePatientWechatDo>();
            if (StringUtils.isNotEmpty(outpatientId)){
                ps = basePatientWechatDao.findByWechatIdAndPatientId(wechatId, patientId);

+ 8 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/TnyyEntranceService.java

@ -869,7 +869,14 @@ public class TnyyEntranceService {
    public JSONObject getAccessToken() throws Exception {
        String url = "http://tazhongyi.519e.com.cn/Api/ApiReport/GetAccessToken";
        HttpResponse httpResponse = HttpUtils.doPost(url,null);
        String content = httpResponse.getContent();
        logger.info("getAccessToken:"+content);
        JSONObject rs = JSON.parseObject(content);
        return rs;
    }

+ 14 - 2
business/base-service/src/main/java/com/yihu/jw/wechat/service/WechatInfoService.java

@ -3,6 +3,7 @@ package com.yihu.jw.wechat.service;
import com.yihu.jw.entity.base.wx.JsApiTicket;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.hospital.prescription.service.entrance.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.TnyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.wechat.dao.WechatDao;
@ -22,6 +23,8 @@ public class WechatInfoService {
    private EntranceService entranceService;
    @Autowired
    private XzzxEntranceService xzzxEntranceService;
    @Autowired
    private TnyyEntranceService tnyyEntranceService;
    /**
     * 通过code获取判断openid
@ -66,7 +69,7 @@ public class WechatInfoService {
            WxWechatDO wxWechat = null;
            
            //中山医院互联网医院
            if("xm_zsyy_wx".equals(wxId) || "xm_xzzx_wx".equals(wxId) || "xm_ykyy_wx".equals(wxId)){
            if("xm_zsyy_wx".equals(wxId) || "xm_xzzx_wx".equals(wxId) || "xm_ykyy_wx".equals(wxId)||"sd_tnzyy_wx".equals(wxId)){
                jsapiTickets = wxAccessTokenService.findJsapiTicket(wxId);
            }else{
                wxWechat = wxAccessTokenService.getWxInfo(wxId);
@ -97,6 +100,15 @@ public class WechatInfoService {
            }else if("xm_xzzx_wx".equals(wxId)){
                token = xzzxEntranceService.getXzToken();
            }else if("xm_xzzx_wx".equals(wxId)){
                token = xzzxEntranceService.getXzToken();
            }else if("sd_tnzyy_wx".equals(wxId)){
                com.alibaba.fastjson.JSONObject jsonObject = tnyyEntranceService.getAccessToken();
                if (jsonObject.getString("ResultCode")!=null&&jsonObject.getString("ResultCode").equalsIgnoreCase("0")){
                    token = jsonObject.getString("AccessToken");
                }else {
                    throw new Exception("获取ACCESSTOKEN失败");
                }
            }else{
                token = wxAccessTokenService.getWxAccessTokenById(wxId).getAccessToken();
            }
@ -114,7 +126,7 @@ public class WechatInfoService {
                    JsApiTicket newJsApiTicket = new JsApiTicket();
                    newJsApiTicket.setJsapi_ticket(ticket);
                    newJsApiTicket.setExpires_in(Long.parseLong(expires_in));
                    if("xm_zsyy_wx".equals(wxId) || "xm_xzzx_wx".equals(wxId) || "xm_ykyy_wx".equals(wxId)){
                    if("xm_zsyy_wx".equals(wxId) || "xm_xzzx_wx".equals(wxId) || "xm_ykyy_wx".equals(wxId)||"sd_tnzyy_wx".equals(wxId)){
                        newJsApiTicket.setAcc_id(wxId);
                    }else{
                        newJsApiTicket.setAcc_id(wxWechat.getAppOriginId());

+ 51 - 0
business/base-service/src/main/java/com/yihu/jw/wechat/service/WxAccessTokenService.java

@ -5,6 +5,7 @@ import com.yihu.jw.entity.base.wx.WxAccessTokenDO;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.exception.code.ExceptionCode;
import com.yihu.jw.hospital.prescription.service.entrance.TnyyEntranceService;
import com.yihu.jw.rm.base.WechatRequestMapping;
import com.yihu.jw.wechat.dao.JsapiTicketDao;
import com.yihu.jw.wechat.dao.WechatDao;
@ -38,6 +39,8 @@ public class WxAccessTokenService extends BaseJpaService<WxAccessTokenDO, WxAcce
    @Autowired
    private JsapiTicketDao jsapiTicketDao;
    @Autowired
    private TnyyEntranceService tnyyEntranceService;
    public WxWechatDO getWxInfo(String wxId){
@ -183,6 +186,9 @@ public class WxAccessTokenService extends BaseJpaService<WxAccessTokenDO, WxAcce
                    }
                }
            }
            if (wechatId.equalsIgnoreCase("sd_tnzyy_wx")){
                return  getAccessTokenById(wechatId);
            }
            String token_url = "https://api.weixin.qq.com/cgi-bin/token";
            String appId="";
            String appSecret="";
@ -222,6 +228,51 @@ public class WxAccessTokenService extends BaseJpaService<WxAccessTokenDO, WxAcce
        }
    }
    /**
     * 泰安获取token
     * @param wechatId
     * @return
     */
    public WxAccessTokenDO getAccessTokenById(String wechatId) {
        try {
            //根据wechatCode查找出appid和appSecret
            WxWechatDO wxWechat = wechatDao.findById(wechatId);
            List<WxAccessTokenDO> wxAccessTokens =  wxAccessTokenDao.getWxAccessTokenById(wechatId);
            if(wxWechat==null){
                throw new ApiException(WechatRequestMapping.WxConfig.message_fail_wxWechat_is_no_exist, ExceptionCode.common_error_params_code);
            }
            if(wxAccessTokens!=null&&wxAccessTokens.size()>0){
                for (WxAccessTokenDO accessToken : wxAccessTokens) {
                    if ((System.currentTimeMillis() - accessToken.getAddTimestamp()) < (accessToken.getExpiresIn() * 500)) {
                        return accessToken;
                    } else {
                        wxAccessTokenDao.delete(accessToken);
                        break;
                    }
                }
            }
            com.alibaba.fastjson.JSONObject json = tnyyEntranceService.getAccessToken();
            if (json.containsKey("AccessToken")) {
                String token = json.get("AccessToken").toString();
                WxAccessTokenDO newaccessToken = new WxAccessTokenDO();
                newaccessToken.setAccessToken(token);
                newaccessToken.setExpiresIn(7200);
                newaccessToken.setAddTimestamp(System.currentTimeMillis());
                newaccessToken.setCzrq(new Date());
                newaccessToken.setCode(UUID.randomUUID().toString().replace("-",""));
                newaccessToken.setWechatId(wechatId);
                wxAccessTokenDao.save(newaccessToken);
                return newaccessToken;
            } else {
                return null;
            }
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }
    /**
     * 获取凭证
     * @param accId 微信原始id

+ 1 - 1
business/sms-service/src/main/java/com/yihu/jw/sms/dao/WlyyHospitalSysDictDao.java

@ -10,7 +10,7 @@ import java.util.List;
/**
 * Created by Trick on 2019/6/17.
 */
public interface WlyyHospitalSysDictDao extends PagingAndSortingRepository<WlyyHospitalSysDictDO, String>, JpaSpecificationExecutor<WlyyHospitalSysDictDO> {
public interface HospitalSysDictDao extends PagingAndSortingRepository<WlyyHospitalSysDictDO, String>, JpaSpecificationExecutor<WlyyHospitalSysDictDO> {
    WlyyHospitalSysDictDO findByHospitalAndDictCode(String hospital, String dictCode);

+ 11 - 21
business/sms-service/src/main/java/com/yihu/jw/sms/service/ZBSmsService.java

@ -1,7 +1,8 @@
package com.yihu.jw.sms.service;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.sms.dao.WlyyHospitalSysDictDao;
import com.yihu.jw.sms.dao.HospitalSysDictDao;
import com.yihu.jw.util.http.HttpClientUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -20,19 +21,14 @@ import java.util.Map;
@Service
public class ZBSmsService {
    private Logger logger= LoggerFactory.getLogger(ZBSmsService.class);
    private String clientId;
    private String resturl;
    private String smsAPI;
    private String smsHandlerId;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Autowired
    private WlyyHospitalSysDictDao sysDictDao;
    private String appId = "9000424";
//    private String secret = "Q1ZCTGKMCTDYHGGQP9S4VJO6KUQRTIA39RKHJ57IIQ8";//测试参数
    private String secret = "YM7WCB2LX32MCKFHWB64V4ARBGMQ36VOO8XOZ2TPP1B";//正式参数
    private String prixUrl = "https://api.yihu.com/OpenPlatform/cgiBin/1.0/";//正式参数
//    private String prixUrl = "https://ssotest.yihu.cn/OpenPlatform/cgiBin/1.0/";//测试参数
    private HospitalSysDictDao sysDictDao;
    private String appId;
    private String secret;//正式参数
    private String prixUrl;//正式参数
    /**
@ -41,13 +37,7 @@ public class ZBSmsService {
    private void init(){
        List<WlyyHospitalSysDictDO> dictDOList = sysDictDao.findByDictName("zbSms");
        for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:dictDOList){
            if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("clientId")){
                clientId=wlyyHospitalSysDictDO.getDictValue();
            }else if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("resturl")){
                resturl=wlyyHospitalSysDictDO.getDictValue();
            }else if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("smsAPI")){
                smsAPI=wlyyHospitalSysDictDO.getDictValue();
            }else if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("smsHandlerId")){
            if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("smsHandlerId")){
                smsHandlerId=wlyyHospitalSysDictDO.getDictValue();
            }else if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("appId")){
                appId=wlyyHospitalSysDictDO.getDictValue();
@ -64,7 +54,7 @@ public class ZBSmsService {
     * 发送短信
     * @return
     */
    public Integer sendMessage(String mobile,String content) throws Exception {
    public Integer sendMessage(String mobile,String code) throws Exception {
        try{
            //初始化参数
            init();
@ -73,10 +63,10 @@ public class ZBSmsService {
                    Long.toString(System.currentTimeMillis());//timestamp必须与服务器时间相差在5分钟以内,否则调用将失败;
            Map<String, String> paramMap = new HashMap<>();
            paramMap.put("provinceCode", "350000");
            paramMap.put("cityCode", "350200");
            JSONObject object = new JSONObject();
            object.put("code",code);
            paramMap.put("mobile", mobile);
            paramMap.put("content", content);
            paramMap.put("templateParam", object.toJSONString());
            paramMap.put("handlerId", smsHandlerId);
            paramMap.put("timestamp", timestamp);

+ 1 - 1
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -649,7 +649,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        }else {
            //发送短信获取验证码
            String captcha = wlyyRedisVerifyCodeService.getCodeNumber();
            int result =  zbSmsService.sendMessage(username,"您好,你的手机登录短信验证码是:"+captcha+",5分钟内有效。");
            int result =  zbSmsService.sendMessage(username,captcha);
            if (0 == result) {
                Captcha _captcha = new Captcha();
                _captcha.setCode(captcha);

+ 41 - 37
svr/svr-door-serivce/pom.xml

@ -161,13 +161,30 @@
    <build>
        <finalName>svr-door-service</finalName>
        <plugins>
            <!-- 分离lib -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <!-- 生成的jar中,不要包含pom.xml和pom.properties这两个文件 -->
                        <addMavenDescriptor>false</addMavenDescriptor>
                        <manifest>
                            <!-- 是否要把第三方jar加入到类构建路径 -->
                            <addClasspath>true</addClasspath>
                            <!-- 外部依赖jar包的最终位置 -->
                            <classpathPrefix>lib/</classpathPrefix>
                            <mainClass>com.yihu.SvrDoorServiceApplication</mainClass>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            <!--拷贝依赖到jar外面的lib目录-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <id>copy-lib</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
@ -182,56 +199,43 @@
                    </execution>
                </executions>
            </plugin>
            <!-- copy资源文件 -->
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>src/main/resources</directory>
                                </resource>
                            </resources>
                            <outputDirectory>${project.build.directory}/resources</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!-- 打jar包时忽略配置文件 -->
            <!--指定配置文件,将resources打成外部resource-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                    <archive>
                        <!-- 指定配置文件目录,这样jar运行时会去找到同目录下的resources文件夹下查找 -->
                        <manifestEntries>
                            <Class-Path>resources/</Class-Path>
                        </manifestEntries>
                    </archive>
                    <!-- 打包时忽略的文件(也就是不打进jar包里的文件) -->
                    <excludes>
                        <exclude>**/*.yml</exclude>
                        <exclude>**/*.xml</exclude>
                    </excludes>
                </configuration>
            </plugin>
            <!-- spring boot repackage -->
            <!-- 拷贝资源文件 外面的resource目录-->
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <layout>ZIP</layout>
                    <includes>
                        <include>
                            <groupId>non-exists</groupId>
                            <artifactId>non-exists</artifactId>
                        </include>
                    </includes>
                </configuration>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>repackage</goal>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <!-- 资源文件输出目录 -->
                            <outputDirectory>${project.build.directory}/resources</outputDirectory>
                            <resources>
                                <resource>
                                    <directory>src/main/resources</directory>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

+ 19 - 0
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/doctor/DoorOrderController.java

@ -1377,4 +1377,23 @@ public class DoorOrderController extends BaseController {
        return null;
    }
    @ApiOperation("医生修改上门服务项")
    @RequestMapping(value = "updServiceItems" , method = RequestMethod.POST)
    public String updServiceItems(   @ApiParam(value = "医生code", name = "doctor")
                                         @RequestParam(value = "doctor", required = true) String doctor,
                                         @ApiParam(value = "工单id", name = "orderId")
                                         @RequestParam(value = "orderId", required = false) String orderId,
                                         @ApiParam(name = "level", value = "医院等级,1.三级医院,2.二级医院,3.一级及以下")
                                         @RequestParam(value = "level",required = true)Integer level ){
        try {
            return write(200, "修改成功", "data", "");
        }catch (Exception e){
            e.printStackTrace();
        }
        return write(-1,"修改失败");
    }
}

+ 6 - 4
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/patient/WlyyDoorServiceOrderController.java

@ -75,7 +75,7 @@ public class WlyyDoorServiceOrderController extends EnvelopRestEndpoint {
        if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
            return failed(result.getString(ResponseContant.resultMsg));
        }
        return success(result.get(ResponseContant.resultMsg));
        return success(result);
    }
    @PostMapping(value = "delete")
@ -319,11 +319,13 @@ public class WlyyDoorServiceOrderController extends EnvelopRestEndpoint {
    @PostMapping(value = "payServiceItemFees")
    @ApiOperation("付服务项费用")
    public Envelop payServiceItemFees(@ApiParam(name = "ids", value = "订单id",required = true)
    public Envelop payServiceItemFees(@ApiParam(name = "orderId", value = "订单id",required = true)
                                          @RequestParam String orderId,
                                      @ApiParam(name = "ids", value = "订单id",required = true)
                                      @RequestParam String[] ids) {
        try {
            wlyyDoorServiceOrderService.payServiceItemFees(ids);
            return success();
            JSONObject json = wlyyDoorServiceOrderService.payServiceItemFees(ids,orderId);
            return success(json);
        } catch (Exception e) {
            return failed(e.getMessage());
        }

+ 1 - 1
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorOrderService.java

@ -301,7 +301,7 @@ public class DoorOrderService {
     * @return
     */
    public List<Map<String, Object>> getDoorFeeDetailGroupByStatus(String orderId) {
        String sql = "SELECT d.id, d.status,d.name,d.code,sum(d.number) num,fee,sum(d.number)*fee sum from wlyy_door_fee_detail d where order_id=? and type=1 GROUP BY status,code";
        String sql = "SELECT d.id, d.status, d.pay_status payStatus,d.name,d.code,sum(d.number) num,fee,sum(d.number)*fee sum from wlyy_door_fee_detail d where order_id=? and type=1 GROUP BY status,code";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql, orderId);
        return list;
    }

+ 18 - 8
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/WlyyDoorServiceOrderService.java

@ -277,7 +277,9 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
                }else{
                    feeDetailDO.setStatus(status);
                }
                feeDetailDO.setPayStatus(0);
                if(StringUtils.isBlank(feeDetailDO.getId())){
                    feeDetailDO.setPayStatus(0);
                }
//                feeDetailDO.setNumber(1);
                feeDetailDO.setOrderId(order.getId());
                if(StringUtils.isBlank(feeDetailDO.getId())) {
@ -344,11 +346,12 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
            for(Object oneId : itemArray) {
                JSONObject oneIdJson = (JSONObject) oneId;
                WlyyDoorFeeDetailDO doorFeeDetail = wlyyDoorFeeDetailDao.findOne(String.valueOf(oneIdJson.get("id")));
                doorFeeDetail.setStatus(3);
                doorFeeDetail.setUpdateTime(new Date());
                list.add(doorFeeDetail);
                itemFee = itemFee.add(doorFeeDetail.getFee().multiply(BigDecimal.valueOf(doorFeeDetail.getNumber())));
                if(doorFeeDetail.getPayStatus()==0){
                    doorFeeDetail.setStatus(3);
                    doorFeeDetail.setUpdateTime(new Date());
                    list.add(doorFeeDetail);
                    itemFee = itemFee.add(doorFeeDetail.getFee().multiply(BigDecimal.valueOf(doorFeeDetail.getNumber())));
                }
            }
            wlyyDoorFeeDetailDao.save(list);
//            orderDO.setTotalFee(totalFee.subtract(itemFee));
@ -625,7 +628,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        }
        orderDO.setServiceStatus("1");
        this.save(orderDO);
        result.put("orderId",orderDO.getId());
        //创建咨询
        JSONObject successOrNot = null;
        try {
@ -2948,7 +2951,14 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
    }
    @Transactional
    public void payServiceItemFees(String[] ids){
    public JSONObject payServiceItemFees(String[] ids,String orderId){
        JSONObject json = new JSONObject();
        wlyyDoorFeeDetailDao.updatePayStatusById(ids);
//        WlyyDoorServiceOrderDO orderDO = wlyyDoorServiceOrderDao.findOne(orderId);
        ConsultDo consult = consultDao.queryByRelationCode(orderId);
        json.put("patient",consult.getPatient());
        json.put("consult",consult.getId());
        return json;
    }
}

+ 0 - 3
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/common/ServerPackageService.java

@ -4,7 +4,6 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
@ -22,8 +21,6 @@ import java.util.Map;
@Transactional
public class ServerPackageService  {
    private static org.slf4j.Logger logger = LoggerFactory.getLogger(ServerPackageService.class);
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Value("${wechat.id}")

+ 18 - 7
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java

@ -1,8 +1,6 @@
package com.yihu.jw.hospital.endpoint.hospital;
import com.alibaba.fastjson.JSONObject;
import com.sun.media.jfxmedia.logging.Logger;
import com.yihu.jw.entity.base.doctor.BaseDoctorBackgroundDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.family.WlyyPatientFamilyMemberDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
@ -18,9 +16,9 @@ import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.sms.service.YkyySMSService;
import com.yihu.jw.sms.service.ZBSmsService;
import com.yihu.jw.sms.service.ZhongShanSMSService;
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -29,11 +27,11 @@ import net.sf.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.text.ParseException;
import java.util.ArrayList;
@ -68,6 +66,8 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
    @Autowired
    private TnyyEntranceService tnyyEntranceService;
    @Autowired
    private ZBSmsService zbSmsService;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Value("${wechat.id}")
    private String wxId;
@ -250,6 +250,17 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
                    mixEnvelop.setMessage("验证码发送失败");
                    mixEnvelop.setStatus(500);
                }
            }else if("sd_tnzyy_wx".equalsIgnoreCase(wxId)){
                //发送短信获取验证码
                String content = captcha;
                int result =  zbSmsService.sendMessage(phoneNum,content);
                if (0 == result) {
                    this.store(client_id, phoneNum, captcha, 120);
                    mixEnvelop.setMessage("验证码发送成功");
                } else {
                    mixEnvelop.setMessage("验证码发送失败");
                    mixEnvelop.setStatus(500);
                }
            }
        }