Bladeren bron

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

wangjun 4 jaren geleden
bovenliggende
commit
8c3c88f693
20 gewijzigde bestanden met toevoegingen van 351 en 123 verwijderingen
  1. 1 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  2. 8 1
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/TnyyEntranceService.java
  3. 5 4
      business/base-service/src/main/java/com/yihu/jw/patient/service/BasePatientService.java
  4. 14 2
      business/base-service/src/main/java/com/yihu/jw/wechat/service/WechatInfoService.java
  5. 51 0
      business/base-service/src/main/java/com/yihu/jw/wechat/service/WxAccessTokenService.java
  6. 1 1
      business/sms-service/src/main/java/com/yihu/jw/sms/dao/WlyyHospitalSysDictDao.java
  7. 11 21
      business/sms-service/src/main/java/com/yihu/jw/sms/service/ZBSmsService.java
  8. 10 0
      common/common-util/src/main/java/com/yihu/jw/util/date/DateUtil.java
  9. 1 1
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  10. 74 6
      svr/svr-door-serivce/pom.xml
  11. 20 1
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/doctor/DoorOrderController.java
  12. 6 4
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/patient/WlyyDoorServiceOrderController.java
  13. 37 6
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorOrderService.java
  14. 8 25
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorServiceApplicationService.java
  15. 1 1
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/WlyyDoorPrescriptionService.java
  16. 38 17
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/WlyyDoorServiceOrderService.java
  17. 0 3
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/common/ServerPackageService.java
  18. 41 22
      svr/svr-door-serivce/src/main/java/com/yihu/jw/door/util/MessageUtil.java
  19. 6 0
      svr/svr-door-serivce/src/main/resources/application.yml
  20. 18 7
      svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java

+ 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){
        if (basePatientDO!=null){
            patienName = basePatientDO.getName();
            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>();
            List<BasePatientWechatDo> ps = new ArrayList<BasePatientWechatDo>();
            if (StringUtils.isNotEmpty(outpatientId)){
            if (StringUtils.isNotEmpty(outpatientId)){
                ps = basePatientWechatDao.findByWechatIdAndPatientId(wechatId, patientId);
                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;
    }

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

@ -9,6 +9,7 @@ import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.patient.util.ConstantUtils;
import com.yihu.jw.patient.util.ConstantUtils;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.jw.utils.hibernate.HibenateUtils;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.mysql.query.BaseJpaService;
import com.yihu.utils.security.MD5;
import com.yihu.utils.security.MD5;
@ -241,6 +242,10 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
    public Boolean updatePatientPw(String id,String pw,String orgPw){
    public Boolean updatePatientPw(String id,String pw,String orgPw){
        BasePatientDO patientDO = basePatientDao.findOne(id);
        BasePatientDO patientDO = basePatientDao.findOne(id);
        String orgPwMd5 = MD5.md5Hex(orgPw + "{" + patientDO.getSalt() + "}");
        if(!orgPwMd5.equals(patientDO.getPassword())){
            return false;
        }
        //认证信息设置
        //认证信息设置
        if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
        if ("xm_ykyy_wx".equalsIgnoreCase(wxId)){
            String response =ykyyService.updatePatientPassword(patientDO.getMobile(),pw,"");
            String response =ykyyService.updatePatientPassword(patientDO.getMobile(),pw,"");
@ -256,10 +261,6 @@ public class BasePatientService<T, R extends CrudRepository> extends BaseJpaServ
                return true;
                return true;
            }
            }
        }
        }
        String orgPwMd5 = MD5.md5Hex(orgPw + "{" + patientDO.getSalt() + "}");
        if(!orgPwMd5.equals(patientDO.getPassword())){
            return false;
        }
        String salt = randomString(5);
        String salt = randomString(5);
        patientDO.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
        patientDO.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
        patientDO.setSalt(salt);
        patientDO.setSalt(salt);

+ 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.JsApiTicket;
import com.yihu.jw.entity.base.wx.WxWechatDO;
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.EntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.TnyyEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.hospital.prescription.service.entrance.XzzxEntranceService;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
@ -22,6 +23,8 @@ public class WechatInfoService {
    private EntranceService entranceService;
    private EntranceService entranceService;
    @Autowired
    @Autowired
    private XzzxEntranceService xzzxEntranceService;
    private XzzxEntranceService xzzxEntranceService;
    @Autowired
    private TnyyEntranceService tnyyEntranceService;
    /**
    /**
     * 通过code获取判断openid
     * 通过code获取判断openid
@ -66,7 +69,7 @@ public class WechatInfoService {
            WxWechatDO wxWechat = null;
            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);
                jsapiTickets = wxAccessTokenService.findJsapiTicket(wxId);
            }else{
            }else{
                wxWechat = wxAccessTokenService.getWxInfo(wxId);
                wxWechat = wxAccessTokenService.getWxInfo(wxId);
@ -97,6 +100,15 @@ public class WechatInfoService {
            }else if("xm_xzzx_wx".equals(wxId)){
            }else if("xm_xzzx_wx".equals(wxId)){
                token = xzzxEntranceService.getXzToken();
                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{
            }else{
                token = wxAccessTokenService.getWxAccessTokenById(wxId).getAccessToken();
                token = wxAccessTokenService.getWxAccessTokenById(wxId).getAccessToken();
            }
            }
@ -114,7 +126,7 @@ public class WechatInfoService {
                    JsApiTicket newJsApiTicket = new JsApiTicket();
                    JsApiTicket newJsApiTicket = new JsApiTicket();
                    newJsApiTicket.setJsapi_ticket(ticket);
                    newJsApiTicket.setJsapi_ticket(ticket);
                    newJsApiTicket.setExpires_in(Long.parseLong(expires_in));
                    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);
                        newJsApiTicket.setAcc_id(wxId);
                    }else{
                    }else{
                        newJsApiTicket.setAcc_id(wxWechat.getAppOriginId());
                        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.entity.base.wx.WxWechatDO;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.exception.code.ExceptionCode;
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.rm.base.WechatRequestMapping;
import com.yihu.jw.wechat.dao.JsapiTicketDao;
import com.yihu.jw.wechat.dao.JsapiTicketDao;
import com.yihu.jw.wechat.dao.WechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
@ -38,6 +39,8 @@ public class WxAccessTokenService extends BaseJpaService<WxAccessTokenDO, WxAcce
    @Autowired
    @Autowired
    private JsapiTicketDao jsapiTicketDao;
    private JsapiTicketDao jsapiTicketDao;
    @Autowired
    private TnyyEntranceService tnyyEntranceService;
    public WxWechatDO getWxInfo(String wxId){
    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 token_url = "https://api.weixin.qq.com/cgi-bin/token";
            String appId="";
            String appId="";
            String appSecret="";
            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
     * @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.
 * 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);
    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;
package com.yihu.jw.sms.service;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
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 com.yihu.jw.util.http.HttpClientUtil;
import org.slf4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.LoggerFactory;
@ -20,19 +21,14 @@ import java.util.Map;
@Service
@Service
public class ZBSmsService {
public class ZBSmsService {
    private Logger logger= LoggerFactory.getLogger(ZBSmsService.class);
    private Logger logger= LoggerFactory.getLogger(ZBSmsService.class);
    private String clientId;
    private String resturl;
    private String smsAPI;
    private String smsHandlerId;
    private String smsHandlerId;
    @Autowired
    @Autowired
    private HttpClientUtil httpClientUtil;
    private HttpClientUtil httpClientUtil;
    @Autowired
    @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(){
    private void init(){
        List<WlyyHospitalSysDictDO> dictDOList = sysDictDao.findByDictName("zbSms");
        List<WlyyHospitalSysDictDO> dictDOList = sysDictDao.findByDictName("zbSms");
        for (WlyyHospitalSysDictDO wlyyHospitalSysDictDO:dictDOList){
        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();
                smsHandlerId=wlyyHospitalSysDictDO.getDictValue();
            }else if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("appId")){
            }else if (wlyyHospitalSysDictDO.getDictCode().equalsIgnoreCase("appId")){
                appId=wlyyHospitalSysDictDO.getDictValue();
                appId=wlyyHospitalSysDictDO.getDictValue();
@ -64,7 +54,7 @@ public class ZBSmsService {
     * 发送短信
     * 发送短信
     * @return
     * @return
     */
     */
    public Integer sendMessage(String mobile,String content) throws Exception {
    public Integer sendMessage(String mobile,String code) throws Exception {
        try{
        try{
            //初始化参数
            //初始化参数
            init();
            init();
@ -73,10 +63,10 @@ public class ZBSmsService {
                    Long.toString(System.currentTimeMillis());//timestamp必须与服务器时间相差在5分钟以内,否则调用将失败;
                    Long.toString(System.currentTimeMillis());//timestamp必须与服务器时间相差在5分钟以内,否则调用将失败;
            Map<String, String> paramMap = new HashMap<>();
            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("mobile", mobile);
            paramMap.put("content", content);
            paramMap.put("templateParam", object.toJSONString());
            paramMap.put("handlerId", smsHandlerId);
            paramMap.put("handlerId", smsHandlerId);
            paramMap.put("timestamp", timestamp);
            paramMap.put("timestamp", timestamp);

+ 10 - 0
common/common-util/src/main/java/com/yihu/jw/util/date/DateUtil.java

@ -72,6 +72,16 @@ public class DateUtil {
        return formatter.format(date);
        return formatter.format(date);
    }
    }
    public static String dateToChineseDate(Date date) {
        SimpleDateFormat formatter =   new SimpleDateFormat( "yyyy年MM月dd日", Locale.CHINA);
        return formatter.format(date);
    }
    public static String dateToChineseTime(Date date) {
        SimpleDateFormat formatter =   new SimpleDateFormat( "yyyy年MM月dd日 hh:mm:ss", Locale.CHINA);
        return formatter.format(date);
    }
    public static Date getNight23(){
    public static Date getNight23(){
        Calendar cal = Calendar.getInstance();
        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.HOUR_OF_DAY,22);
        cal.set(Calendar.HOUR_OF_DAY,22);

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

+ 74 - 6
svr/svr-door-serivce/pom.xml

@ -150,6 +150,10 @@
            <groupId>org.springframework.boot</groupId>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>
        </dependency>
        <dependency>
            <groupId>com.yihu.jw</groupId>
            <artifactId>common-entity-es</artifactId>
        </dependency>
        <!-- redis end  -->
        <!-- redis end  -->
    </dependencies>
    </dependencies>
@ -158,19 +162,83 @@
        <finalName>svr-door-service</finalName>
        <finalName>svr-door-service</finalName>
        <plugins>
        <plugins>
            <plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                <configuration>
                    <mainClass>com.yihu.SvrDoorServiceApplication</mainClass>
                    <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>
                </configuration>
            </plugin>
            </plugin>
            <!--拷贝依赖到jar外面的lib目录-->
            <plugin>
            <plugin>
                <artifactId>maven-war-plugin</artifactId>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-lib</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <!-- 依赖包输出目录,将来不打进jar包里 -->
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                            <excludeTransitive>false</excludeTransitive>
                            <stripVersion>false</stripVersion>
                            <includeScope>runtime</includeScope>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <!--指定配置文件,将resources打成外部resource-->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <configuration>
                <configuration>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <filteringDeploymentDescriptors>true</filteringDeploymentDescriptors>
                    <archive>
                        <!-- 指定配置文件目录,这样jar运行时会去找到同目录下的resources文件夹下查找 -->
                        <manifestEntries>
                            <Class-Path>resources/</Class-Path>
                        </manifestEntries>
                    </archive>
                    <!-- 打包时忽略的文件(也就是不打进jar包里的文件) -->
                    <excludes>
                        <exclude>**/*.yml</exclude>
                        <exclude>**/*.xml</exclude>
                    </excludes>
                </configuration>
                </configuration>
            </plugin>
            </plugin>
            <!-- 拷贝资源文件 外面的resource目录-->
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <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>
        </plugins>
        </plugins>
    </build>
    </build>
</project>
</project>

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

@ -592,7 +592,7 @@ public class DoorOrderController extends BaseController {
            @ApiParam(value = "jsonData", name = "jsonData")
            @ApiParam(value = "jsonData", name = "jsonData")
            @RequestParam(value = "jsonData", required = false) String jsonData) {
            @RequestParam(value = "jsonData", required = false) String jsonData) {
        try {
        try {
            doorOrderService.updatePackageItemInfo(jsonData);
            doorOrderService.updatePackageItemInfo(jsonData,getUID());
            return write(200, "修改成功");
            return write(200, "修改成功");
        } catch (Exception e) {
        } catch (Exception e) {
            error(e);
            error(e);
@ -1377,4 +1377,23 @@ public class DoorOrderController extends BaseController {
        return null;
        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) {
        if (result.getIntValue(ResponseContant.resultFlag) == ResponseContant.fail) {
            return failed(result.getString(ResponseContant.resultMsg));
            return failed(result.getString(ResponseContant.resultMsg));
        }
        }
        return success(result.get(ResponseContant.resultMsg));
        return success(result);
    }
    }
    @PostMapping(value = "delete")
    @PostMapping(value = "delete")
@ -319,11 +319,13 @@ public class WlyyDoorServiceOrderController extends EnvelopRestEndpoint {
    @PostMapping(value = "payServiceItemFees")
    @PostMapping(value = "payServiceItemFees")
    @ApiOperation("付服务项费用")
    @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) {
                                      @RequestParam String[] ids) {
        try {
        try {
            wlyyDoorServiceOrderService.payServiceItemFees(ids);
            return success();
            JSONObject json = wlyyDoorServiceOrderService.payServiceItemFees(ids,orderId);
            return success(json);
        } catch (Exception e) {
        } catch (Exception e) {
            return failed(e.getMessage());
            return failed(e.getMessage());
        }
        }

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

@ -5,11 +5,13 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.door.dao.*;
import com.yihu.jw.door.dao.*;
import com.yihu.jw.door.dao.followup.FollowUpDao;
import com.yihu.jw.door.dao.followup.FollowUpDao;
import com.yihu.jw.door.util.MessageUtil;
import com.yihu.jw.door.util.MessageUtil;
import com.yihu.jw.door.util.StreamUtil;
import com.yihu.jw.door.util.StreamUtil;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
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.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
@ -90,6 +92,8 @@ public class DoorOrderService {
    private WlyyDoorDoctorStatusDao doctorStatusDao;
    private WlyyDoorDoctorStatusDao doctorStatusDao;
    @Autowired
    @Autowired
    private BaseDoctorDao doctorDao;
    private BaseDoctorDao doctorDao;
    @Autowired
    private BaseDoctorHospitalDao doctorHospitalDao;
/*    @Autowired
/*    @Autowired
    private ServerPackageItemPatientDao serverPackageItemPatientDao;
    private ServerPackageItemPatientDao serverPackageItemPatientDao;
    @Autowired
    @Autowired
@ -301,7 +305,7 @@ public class DoorOrderService {
     * @return
     * @return
     */
     */
    public List<Map<String, Object>> getDoorFeeDetailGroupByStatus(String orderId) {
    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, CONCAT(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);
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql, orderId);
        return list;
        return list;
    }
    }
@ -605,7 +609,7 @@ public class DoorOrderService {
            String first = "key1,您好!您的上门预约服务已由【key2】医生接单了";
            String first = "key1,您好!您的上门预约服务已由【key2】医生接单了";
            first = first.replace("key1",(patient.getName()==null?"":patient.getName()));
            first = first.replace("key1",(patient.getName()==null?"":patient.getName()));
            first = first.replace("key2", null != doorServiceOrder.getDoctorName() ? doorServiceOrder.getDoctorName() : "");
            first = first.replace("key2", null != doorServiceOrder.getDoctorName() ? doorServiceOrder.getDoctorName() : "");
            messageUtil.putTemplateWxMessage(wxId,"template_process_feedback","smyyyjjd",patient.getOpenid(),first,null,null,30,json,DateUtil.dateToStrShort(new Date()),"上门服务已接单");
            messageUtil.putTemplateWxMessage(wxId,"template_process_feedback","smyyyjjd",patient.getOpenid(),first,null,null,30,json,DateUtil.dateToChineseDate(new Date()),"上门服务已接单");
        }catch (Exception e){
        }catch (Exception e){
            e.printStackTrace();
            e.printStackTrace();
            logger.error(e.getMessage());
            logger.error(e.getMessage());
@ -1044,7 +1048,7 @@ public class DoorOrderService {
                json.put("finish",finish);
                json.put("finish",finish);
            }
            }
            String first="key1预约上门服务医生已完成服务。为提高服务质量,诚邀您对本次服务医生进行评分".replace("key1", DateUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm"));
            String first="key1预约上门服务医生已完成服务。为提高服务质量,诚邀您对本次服务医生进行评分".replace("key1", DateUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm"));
            messageUtil.putTemplateWxMessage(wxId,"template_process_feedback","fwyspf",patient.getOpenid(),first,null,null,31,json,DateUtil.dateToStrShort(new Date()),"服务医生评分");
            messageUtil.putTemplateWxMessage(wxId,"template_process_feedback","fwyspf",patient.getOpenid(),first,null,null,31,json,DateUtil.dateToChineseDate(new Date()),"服务医生评分");
        }catch (Exception e){
        }catch (Exception e){
            logger.error(e.getMessage());
            logger.error(e.getMessage());
@ -1103,7 +1107,7 @@ public class DoorOrderService {
                json.put("finish",finish);
                json.put("finish",finish);
            }
            }
            String first="key1预约上门服务医生已完成服务。为提高服务质量,诚邀您对本次服务医生进行评分".replace("key1", DateUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm"));
            String first="key1预约上门服务医生已完成服务。为提高服务质量,诚邀您对本次服务医生进行评分".replace("key1", DateUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm"));
            messageUtil.putTemplateWxMessage(wxId,"template_process_feedback","fwyspf",patient.getOpenid(),first,null,null,31,json,DateUtil.dateToStrShort(new Date()),"服务医生评分");
            messageUtil.putTemplateWxMessage(wxId,"template_process_feedback","fwyspf",patient.getOpenid(),first,null,null,31,json,DateUtil.dateToChineseDate(new Date()),"服务医生评分");
        }catch (Exception e){
        }catch (Exception e){
            logger.error(e.getMessage());
            logger.error(e.getMessage());
        }
        }
@ -1350,14 +1354,14 @@ public class DoorOrderService {
     * @param jsonData
     * @param jsonData
     */
     */
    @org.springframework.transaction.annotation.Transactional(rollbackFor = Exception.class)
    @org.springframework.transaction.annotation.Transactional(rollbackFor = Exception.class)
    public void updatePackageItemInfo(String jsonData) {
    public void updatePackageItemInfo(String jsonData,String doctorId) {
        JSONObject jsonObjectParam = JSONObject.parseObject(jsonData);
        JSONObject jsonObjectParam = JSONObject.parseObject(jsonData);
        String orderId = String.valueOf(jsonObjectParam.get("orderId"));
        String orderId = String.valueOf(jsonObjectParam.get("orderId"));
        WlyyDoorServiceOrderDO order = doorServiceOrderDao.findOne(orderId);
        WlyyDoorServiceOrderDO order = doorServiceOrderDao.findOne(orderId);
        // 删除出诊医生或服务项
        // 删除出诊医生或服务项
        wlyyDoorServiceOrderService.orderWithFeeDelete(jsonObjectParam,order);
        wlyyDoorServiceOrderService.orderWithFeeDelete(jsonObjectParam,order);
        // 更新服务包信息
        // 更新服务包信息
        wlyyDoorServiceOrderService.orderWithPackageItemFeeAdd(new JSONObject(), jsonObjectParam, order);
        wlyyDoorServiceOrderService.orderWithPackageItemFeeAdd(new JSONObject(), jsonObjectParam, order,doctorId);
        // 发送微信模板消息,通知居民服务项目已经变更(smyyyjjd-服务项目变更通知)
        // 发送微信模板消息,通知居民服务项目已经变更(smyyyjjd-服务项目变更通知)
       BasePatientDO patient = patientInfoService.findById(order.getProxyPatient());//·
       BasePatientDO patient = patientInfoService.findById(order.getProxyPatient());//·
@ -1737,4 +1741,31 @@ public class DoorOrderService {
       List<Map<String,Object>> list = jdbcTemplate.queryForList(sqlList+sql);
       List<Map<String,Object>> list = jdbcTemplate.queryForList(sqlList+sql);
        return list;
        return list;
   }
   }
    /**
     *
     * @param doctorId
     * @param orderDO
     */
   public void putTemplateTobePay(WlyyDoorServiceOrderDO orderDO,String doctorId){
       if(StringUtils.isEmpty(doctorId)){
           return;
       }
       JSONObject json = new JSONObject();
       String orderId = orderDO.getId();
       String payTypeName = "上门服务";
       BasePatientDO patientDO = patientInfoService.findById(orderDO.getPatient());
       String openId = patientDO.getOpenid();
       String patientName = patientDO.getName();
       BaseDoctorDO doctorDO = baseDoctorDao.findById(doctorId);
       String doctorName = doctorDO.getName();
       String deptName = "";
       List<BaseDoctorHospitalDO> doctorHospitalDOs = doctorHospitalDao.findByOrgCodeAndDoctorCode("350211A1002",doctorId);
       if(doctorHospitalDOs.size()>0){
           deptName = doctorHospitalDOs.get(0).getDeptName();
       }
       json.put("orderId",orderId);
       messageUtil.putTemplateWxMessage(wxId,"template_to_be_pay","smfwqrfk",openId,DateUtil.dateToStr(new Date(), "yyyy/MM/dd HH:mm"),null,null,35,json,patientName,deptName,payTypeName,doctorName,DateUtil.dateToChineseTime(new Date()));
   }
}
}

+ 8 - 25
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorServiceApplicationService.java

@ -21,6 +21,7 @@ import com.yihu.jw.wechat.dao.WxTemplateConfigDao;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONObject;
import org.jsoup.helper.DataUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
@ -584,11 +585,11 @@ public class DoorServiceApplicationService {
        if(null!=wlyyDoorServiceApplicationDo1){
        if(null!=wlyyDoorServiceApplicationDo1){
            //给代理申请资质的居民发送微信模板消息-审核结果//·
            //给代理申请资质的居民发送微信模板消息-审核结果//·
            BasePatientDO patient = patientInfoService.findById(wlyyDoorServiceApplicationDo1.getProxyPatient());
            BasePatientDO patient = patientInfoService.findById(wlyyDoorServiceApplicationDo1.getProxyPatient());
            String first ="key1您好,key2的资格审核医生已处理。";
            first = first.replace("key1",(patient.getName()==null?"":patient.getName()));
            first = first.replace("key2", (wlyyDoorServiceApplicationDo1.getPatientName() == null ? "" : wlyyDoorServiceApplicationDo1.getPatientName()));
            wlyyDoorServiceApplicationDo1.getAuditorName();
            messageUtil.putTemplateWxMessage(wxId,"template_doctor_audit",scene,patient.getOpenid(),first,null,null,19,null,null,wlyyDoorServiceApplicationDo1.getAuditorName());
//            String first ="key1您好,key2的资格审核医生已处理。";
//            first = first.replace("key1",(patient.getName()==null?"":patient.getName()));
//            first = first.replace("key2", (wlyyDoorServiceApplicationDo1.getPatientName() == null ? "" : wlyyDoorServiceApplicationDo1.getPatientName()));
//            wlyyDoorServiceApplicationDo1.getAuditorName();
//            messageUtil.putTemplateWxMessage(wxId,"template_doctor_audit",scene,patient.getOpenid(),first,null,null,19,null,null,wlyyDoorServiceApplicationDo1.getAuditorName());
        }
        }
@ -650,26 +651,8 @@ public class DoorServiceApplicationService {
    }
    }
    public String myMyTest(){
    public String myMyTest(){
        messageUtil.putTemplateWxMessage("xm_test_ihealth_wx","template_process_feedback","smyyyqx","ojsU-1XvRLx_IjDj96S4gxIRBNlY","您的上门服务知情同意书已送达",null,null,30,null,DateUtil.dateToStrShort(new Date()),"知情同意书已推送");
//        BasePatientDO patient = patientDao.findById("3ae2673512154d5280d1dcf5ffa5626d");
//        WxTemplateConfigDO templateConfig = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus("xm_test_ihealth_wx", "template_process_feedback", "smyyyqx", 1);
//        String first = templateConfig.getFirst().replace("key1", null != patient.getName() ? patient.getName() : "");
//        org.json.JSONObject json = new org.json.JSONObject();
//        templateConfig.setFirst("白海灵您好!您的上门服务知情同意书已送达");
//        templateConfig.setKeyword1(DateUtil.dateToStrShort(new Date()));
//        templateConfig.setKeyword2("知情同意书已推送");
//        json.put("url", templateConfig.getUrl());
//        json.put("url", "appoint_service/html/appoint-serviceDetail.html?id="+orderId);
////        appoint_service/html/appoint-serviceDetail.html?openid=ojsU-1XJVftkfdbP1F5bi8JVPtOo&consult=e0d17c67ab07477f8e96534bc610e51b
//        json.put("remark", templateConfig.getRemark());
//        if(consult != null) {
//            json.put("consult", consult.getCode());
//        }else {
//            json.put("id", orderDO.getId());
//        }
//        pushMsgTask.putWxMsg(tokenUtils.getAccessToken(), 30, patient.getOpenid(), patient.getName(), json);
//        messageUtil
        messageUtil.putTemplateWxMessage("xm_test_ihealth_wx","template_to_be_pay","smfwqrfk","ojsU-1XvRLx_IjDj96S4gxIRBNlY",DateUtil.dateToStr(new Date(), "yyyy/MM/dd HH:mm"),null,null,30,null,null,null,null,null,DateUtil.dateToChineseTime(new Date()));
        return "ss";
        return "ss";
    }
    }

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

@ -269,7 +269,7 @@ public class WlyyDoorPrescriptionService  extends BaseJpaService<WlyyDoorPrescri
        json.put("orderId", orderDO.getId());
        json.put("orderId", orderDO.getId());
        json.put("openId", patient.getOpenid());
        json.put("openId", patient.getOpenid());
        json.put("authorizeImage", orderDO.getAuthorizeImage());
        json.put("authorizeImage", orderDO.getAuthorizeImage());
        messageUtil.putTemplateWxMessage(wxId,"template_process_feedback","authorize",patient.getOpenid(),first,null,null,34,json,DateUtil.dateToStrShort(new Date()));
        messageUtil.putTemplateWxMessage(wxId,"template_process_feedback","authorize",patient.getOpenid(),first,null,null,34,json,DateUtil.dateToChineseDate(new Date()));
/*        Patient patient = patientDao.findByCode(orderDO.getPatient());//·
/*        Patient patient = patientDao.findByCode(orderDO.getPatient());//·
        //发送微信模板消息
        //发送微信模板消息

+ 38 - 17
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/WlyyDoorServiceOrderService.java

@ -231,13 +231,15 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
     * @return
     * @return
     */
     */
    @Transactional(rollbackFor = Exception.class)
    @Transactional(rollbackFor = Exception.class)
    public boolean orderWithPackageItemFeeAdd(JSONObject result, JSONObject jsonObjectParam, WlyyDoorServiceOrderDO order ) {
    public boolean orderWithPackageItemFeeAdd(JSONObject result, JSONObject jsonObjectParam, WlyyDoorServiceOrderDO order,String doctorId) {
        List<WlyyDoorFeeDetailDO> feeDetailDOList = new ArrayList<>();
        List<WlyyDoorFeeDetailDO> feeDetailDOList = new ArrayList<>();
        List<WlyyDoorOrderItemDO> orderItemDOList = new ArrayList<>();
        List<WlyyDoorOrderItemDO> orderItemDOList = new ArrayList<>();
        BigDecimal totalFee = order.getTotalFee();
        BigDecimal totalFee = order.getTotalFee();
        if(null == totalFee){
        if(null == totalFee){
            totalFee = new BigDecimal(0);
            totalFee = new BigDecimal(0);
        }
        }
        //新增服务项
        int addNum = 0;
        //服务项费用
        //服务项费用
        JSONArray packageItemArray = jsonObjectParam.getJSONArray("packageItemArr");
        JSONArray packageItemArray = jsonObjectParam.getJSONArray("packageItemArr");
        if (!CollectionUtils.isEmpty(packageItemArray)) {
        if (!CollectionUtils.isEmpty(packageItemArray)) {
@ -277,7 +279,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
                }else{
                }else{
                    feeDetailDO.setStatus(status);
                    feeDetailDO.setStatus(status);
                }
                }
                feeDetailDO.setPayStatus(0);
//                feeDetailDO.setNumber(1);
//                feeDetailDO.setNumber(1);
                feeDetailDO.setOrderId(order.getId());
                feeDetailDO.setOrderId(order.getId());
                if(StringUtils.isBlank(feeDetailDO.getId())) {
                if(StringUtils.isBlank(feeDetailDO.getId())) {
@ -285,7 +287,12 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
                }else {
                }else {
                    feeDetailDO.setUpdateTime(new Date());
                    feeDetailDO.setUpdateTime(new Date());
                }
                }
                feeDetailDOList.add(feeDetailDO);
                if(StringUtils.isBlank(feeDetailDO.getId())){
                    feeDetailDO.setPayStatus(0);
                    addNum++;
                    feeDetailDOList.add(feeDetailDO);
                }
            }
            }
//            order.setTotalFee(totalFee);
//            order.setTotalFee(totalFee);
//            this.save(order);
//            this.save(order);
@ -305,6 +312,10 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
            order.setTotalFee(new BigDecimal(0));
            order.setTotalFee(new BigDecimal(0));
            this.save(order);
            this.save(order);
        }*/
        }*/
        if(addNum>0){
            doorOrderService.putTemplateTobePay(order,doctorId);
        }
        return false;
        return false;
    }
    }
@ -344,11 +355,12 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
            for(Object oneId : itemArray) {
            for(Object oneId : itemArray) {
                JSONObject oneIdJson = (JSONObject) oneId;
                JSONObject oneIdJson = (JSONObject) oneId;
                WlyyDoorFeeDetailDO doorFeeDetail = wlyyDoorFeeDetailDao.findOne(String.valueOf(oneIdJson.get("id")));
                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);
            wlyyDoorFeeDetailDao.save(list);
//            orderDO.setTotalFee(totalFee.subtract(itemFee));
//            orderDO.setTotalFee(totalFee.subtract(itemFee));
@ -625,7 +637,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        }
        }
        orderDO.setServiceStatus("1");
        orderDO.setServiceStatus("1");
        this.save(orderDO);
        this.save(orderDO);
        result.put("orderId",orderDO.getId());
        //创建咨询
        //创建咨询
        JSONObject successOrNot = null;
        JSONObject successOrNot = null;
        try {
        try {
@ -644,8 +656,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        ConsultTeamDo consultTeam = (ConsultTeamDo)successOrNot.get(ResponseContant.resultMsg);
        ConsultTeamDo consultTeam = (ConsultTeamDo)successOrNot.get(ResponseContant.resultMsg);
        //新增工单与服务项费用关联关系
        //新增工单与服务项费用关联关系
        if (orderWithPackageItemFeeAdd(result, jsonObjectParam, orderDO)) {return result;}
        if (orderWithPackageItemFeeAdd(result, jsonObjectParam, orderDO,null)) {return result;}
        if ( StringUtils.isNotBlank(orderDO.getDoctor())) {
        if ( StringUtils.isNotBlank(orderDO.getDoctor())) {
            orderDO.setStatus(2);
            orderDO.setStatus(2);
@ -1469,7 +1480,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
            json.put("id", orderDO.getId());
            json.put("id", orderDO.getId());
        }
        }
        messageUtil.putTemplateWxMessage(wxId,"template_process_feedback","smyyyqx",patient.getOpenid(),first,null,null,30,json,DateUtil.dateToStrShort(new Date()),"上门预约已取消");
        messageUtil.putTemplateWxMessage(wxId,"template_process_feedback","smyyyqx",patient.getOpenid(),first,null,null,30,json,DateUtil.dateToChineseDate(new Date()),"上门预约已取消");
/*        Consult consult = consultDao.queryByRelationCode(orderId);
/*        Consult consult = consultDao.queryByRelationCode(orderId);
        // 发送微信模板消息,通知居民工单已取消(smyyyqx-上门预约已取消)
        // 发送微信模板消息,通知居民工单已取消(smyyyqx-上门预约已取消)
@ -1517,7 +1528,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        }else {
        }else {
            json.put("id", orderDO.getId());
            json.put("id", orderDO.getId());
        }
        }
        messageUtil.putTemplateWxMessage(wxId,"template_process_feedback","smyyyqx",patient.getOpenid(),first,url,null,30,json,DateUtil.dateToStrShort(new Date()),"知情同意书已推送");
        messageUtil.putTemplateWxMessage(wxId,"template_process_feedback","smyyyqx",patient.getOpenid(),first,url,null,30,json,DateUtil.dateToChineseDate(new Date()),"知情同意书已推送");
/*        BasePatientDO patient = patientDao.findById(orderDO.getPatient());
/*        BasePatientDO patient = patientDao.findById(orderDO.getPatient());
        WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_process_feedback","smyyyqx");
        WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_process_feedback","smyyyqx");
@ -2745,7 +2756,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        this.save(orderDO);
        this.save(orderDO);
        result.put("orderId",orderDO.getId());
        result.put("orderId",orderDO.getId());
        //新增工单与服务项费用关联关系
        //新增工单与服务项费用关联关系
        if (orderWithPackageItemFeeAdd(result, jsonObjectParam, orderDO)) {return result;}
        if (orderWithPackageItemFeeAdd(result, jsonObjectParam, orderDO,doctorCode)) {return result;}
        if("1".equals(orderDO.getShortcutType())){
        if("1".equals(orderDO.getShortcutType())){
            //快捷的当前医生直接接单
            //快捷的当前医生直接接单
@ -2845,7 +2856,7 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
        this.save(orderDO);
        this.save(orderDO);
        result.put("orderId",orderDO.getId());
        result.put("orderId",orderDO.getId());
        //新增工单与服务项费用关联关系
        //新增工单与服务项费用关联关系
        if (orderWithPackageItemFeeAdd(result, jsonObjectParam, orderDO)){
        if (orderWithPackageItemFeeAdd(result, jsonObjectParam, orderDO,doctorCode)){
            return result;
            return result;
        }
        }
@ -2939,7 +2950,10 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
    public JSONObject getServiceItemFees(String orderId){
    public JSONObject getServiceItemFees(String orderId){
        JSONObject json = new JSONObject();
        JSONObject json = new JSONObject();
        List<WlyyDoorFeeDetailDO> feeDetailDOs = wlyyDoorFeeDetailDao.findByOrderIdAndPayStatus(orderId, 0);
        List<WlyyDoorFeeDetailDO> feeDetailDOs = wlyyDoorFeeDetailDao.findByOrderIdAndPayStatus(orderId, 0);
        BigDecimal sum = feeDetailDOs.stream().map(WlyyDoorFeeDetailDO::getFee).reduce(BigDecimal::add).get();
        BigDecimal sum = new BigDecimal(0);
        for (WlyyDoorFeeDetailDO feeDetailDO: feeDetailDOs){
            sum.add(feeDetailDO.getFee().multiply(new BigDecimal(feeDetailDO.getNumber())));
        }
        sum = sum.setScale(1, BigDecimal.ROUND_DOWN);
        sum = sum.setScale(1, BigDecimal.ROUND_DOWN);
        json.put("orderId",orderId);
        json.put("orderId",orderId);
        json.put("sum",sum);
        json.put("sum",sum);
@ -2948,7 +2962,14 @@ public class WlyyDoorServiceOrderService extends BaseJpaService<WlyyDoorServiceO
    }
    }
    @Transactional
    @Transactional
    public void payServiceItemFees(String[] ids){
    public JSONObject payServiceItemFees(String[] ids,String orderId){
        JSONObject json = new JSONObject();
        wlyyDoorFeeDetailDao.updatePayStatusById(ids);
        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 com.alibaba.fastjson.JSONObject;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
@ -22,8 +21,6 @@ import java.util.Map;
@Transactional
@Transactional
public class ServerPackageService  {
public class ServerPackageService  {
    private static org.slf4j.Logger logger = LoggerFactory.getLogger(ServerPackageService.class);
    @Autowired
    @Autowired
    private JdbcTemplate jdbcTemplate;
    private JdbcTemplate jdbcTemplate;
    @Value("${wechat.id}")
    @Value("${wechat.id}")

+ 41 - 22
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/util/MessageUtil.java

@ -22,6 +22,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
@ -58,8 +59,8 @@ public class MessageUtil {
    private BaseDoctorDao baseDoctorDao;
    private BaseDoctorDao baseDoctorDao;
    @Autowired
    @Autowired
    private BasePatientDao basePatientDao;
    private BasePatientDao basePatientDao;
    @Value("${server.server_url}")
    private String server_url;
    @Value("${tnzyy.tnzyy_url}")
    private String tnzyy_url;
    //发送微信模板消息
    //发送微信模板消息
    private  String sendMessageUrl = "http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage";
    private  String sendMessageUrl = "http://172.16.100.37:8090/hospitalPortal-sms/sms/sendMessage";
@ -153,20 +154,32 @@ public class MessageUtil {
    }
    }
    //推送模板消息
    //推送模板消息
    /**
     *
     * @param wechatId
     * @param templateName
     * @param scene
     * @param openId
     * @param first
     * @param url 跳转链接
     * @param remark
     * @param type  模板通知类型
     * @param josn 用于对跳转连接的修改,
     * @param keywords
     */
    public void putTemplateWxMessage(String wechatId, String templateName, String scene, String openId, String first,String url, String remark, Integer type,JSONObject josn,String ...keywords) {
    public void putTemplateWxMessage(String wechatId, String templateName, String scene, String openId, String first,String url, String remark, Integer type,JSONObject josn,String ...keywords) {
        try {
        try {
            System.out.println(wechatId);
            System.out.println(wechatId);
            List<WxAccessTokenDO> list = wxAccessTokenDao.getWxAccessTokenById(wechatId);
            if(list.size()==0){
                return;
            }
            WxAccessTokenDO wxAccessTokenDO = list.get(0);
            WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
            if (wxAccessTokenDO == null) {
            if (wxAccessTokenDO == null) {
                logger.info("wx_access_token表获取为空,wechatId" + wechatId);
                logger.info("wx_access_token表获取为空,wechatId" + wechatId);
                return;
                return;
            }
            }
            WxTemplateConfigDO newConfig = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, templateName, scene, 1);
            WxTemplateConfigDO templateConfig = wxTemplateConfigDao.findByWechatIdAndTemplateNameAndSceneAndStatus(wechatId, templateName, scene, 1);
            WxTemplateConfigDO newConfig = new WxTemplateConfigDO();
            BeanUtils.copyProperties(templateConfig,newConfig);
            if (newConfig == null) {
            if (newConfig == null) {
                logger.info("微信模板不存在!请确认wechatId:" + wechatId + ",templateName:" + templateName + ",scene:" + scene);
                logger.info("微信模板不存在!请确认wechatId:" + wechatId + ",templateName:" + templateName + ",scene:" + scene);
                return;
                return;
@ -176,7 +189,7 @@ public class MessageUtil {
                newConfig.setFirst(first);
                newConfig.setFirst(first);
            }
            }
            if (StringUtils.isNoneBlank(url)){
            if (StringUtils.isNoneBlank(url)){
                newConfig.setUrl(url);
               newConfig.setUrl(url);
            }
            }
            if (StringUtils.isNoneBlank(remark)){
            if (StringUtils.isNoneBlank(remark)){
                newConfig.setRemark(remark);
                newConfig.setRemark(remark);
@ -190,32 +203,32 @@ public class MessageUtil {
            }
            }
            if (keyLength >= 2) {
            if (keyLength >= 2) {
                if(StringUtils.isNoneBlank(keywords[1])){
                if(StringUtils.isNoneBlank(keywords[1])){
                    newConfig.setKeyword1(keywords[1]);
                    newConfig.setKeyword2(keywords[1]);
                }
                }
            }
            }
            if (keyLength >= 3) {
            if (keyLength >= 3) {
                if(StringUtils.isNoneBlank(keywords[2])){
                if(StringUtils.isNoneBlank(keywords[2])){
                    newConfig.setKeyword1(keywords[2]);
                    newConfig.setKeyword3(keywords[2]);
                }
                }
            }
            }
            if (keyLength >= 4) {
            if (keyLength >= 4) {
                if(StringUtils.isNoneBlank(keywords[3])){
                if(StringUtils.isNoneBlank(keywords[3])){
                    newConfig.setKeyword1(keywords[3]);
                    newConfig.setKeyword4(keywords[3]);
                }
                }
            }
            }
            if (keyLength >= 5) {
            if (keyLength >= 5) {
                if(StringUtils.isNoneBlank(keywords[4])){
                if(StringUtils.isNoneBlank(keywords[4])){
                    newConfig.setKeyword1(keywords[4]);
                    newConfig.setKeyword5(keywords[4]);
                }
                }
            }
            }
            if (keyLength >= 6) {
            if (keyLength >= 6) {
                if(StringUtils.isNoneBlank(keywords[5])){
                if(StringUtils.isNoneBlank(keywords[5])){
                    newConfig.setKeyword1(keywords[5]);
                    newConfig.setKeyword6(keywords[5]);
                }
                }
            }
            }
            if (keyLength >= 7) {
            if (keyLength >= 7) {
                if(StringUtils.isNoneBlank(keywords[6])){
                if(StringUtils.isNoneBlank(keywords[6])){
                    newConfig.setKeyword1(keywords[6]);
                    newConfig.setKeyword7(keywords[6]);
                }
                }
            }
            }
            //发起微信消息模板推送
            //发起微信消息模板推送
@ -228,7 +241,10 @@ public class MessageUtil {
    }
    }
    public WxTemplateConfigDO setTemPlateUrl(WxTemplateConfigDO wxTemplateConfigDO,Integer type,String openid,JSONObject json){
    public WxTemplateConfigDO setTemPlateUrl(WxTemplateConfigDO wxTemplateConfigDO,Integer type,String openid,JSONObject json){
        String url = server_url + "wx/html/";
        String url = tnzyy_url + "taian-wx/html/";
        if (json==null){
            return wxTemplateConfigDO;
        }
        if (type==30){//反馈通知 测试 TPbq9m0SAiVfRhXtXq17SDmYIfrJ8Whp2NpSrq9wlfI
        if (type==30){//反馈通知 测试 TPbq9m0SAiVfRhXtXq17SDmYIfrJ8Whp2NpSrq9wlfI
            if(json.containsKey("consult")) {
            if(json.containsKey("consult")) {
                wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl() + "?openid=" + openid + "&consult=" + json.getString("consult"));
                wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl() + "?openid=" + openid + "&consult=" + json.getString("consult"));
@ -240,17 +256,17 @@ public class MessageUtil {
                wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl() + "?resultCode=" + json.getString("resultCode"));
                wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl() + "?resultCode=" + json.getString("resultCode"));
            }
            }
        }
        }
        if (type==31){ //上门服务医生评分   //TPbq9m0SAiVfRhXtXq17SDmYIfrJ8Whp2NpSrq9wlfI
        if (type==31){ //上门服务医生评分   //
            wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl()+"?openid=" + openid + "&id=" + json.getString("id")+ "&finish=" + json.getString("finish"));
            wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl()+"?openid=" + openid + "&id=" + json.getString("id")+ "&finish=" + json.getString("finish"));
        }
        }
        if(type==32){  //TPbq9m0SAiVfRhXtXq17SDmYIfrJ8Whp2NpSrq9wlfI
            String url1 = server_url + "wx/common/";
        if(type==32){  //
            String url1 = tnzyy_url + "wx/common/";
            wxTemplateConfigDO.setUrl(url1 + wxTemplateConfigDO.getUrl()+"?openid=" + openid + "&consult=" + json.getString("consult") + "&status=" + json.getInteger("status"));
            wxTemplateConfigDO.setUrl(url1 + wxTemplateConfigDO.getUrl()+"?openid=" + openid + "&consult=" + json.getString("consult") + "&status=" + json.getInteger("status"));
        }
        }
        if(type==34){ //TPbq9m0SAiVfRhXtXq17SDmYIfrJ8Whp2NpSrq9wlfI
            wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl() + "?openid=" + openid + "&orderId=" + json.get("orderId")+ "&authorizeImage=" + json.getString("authorizeImage"));
        if(type==34){ //居民授权电子健康卡
            wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl() + "?openid=" + openid + "&orderId=" + json.getString("orderId")+ "&authorizeImage=" + json.getString("authorizeImage"));
        }
        }
        if (type==19){  //zSR9w5AjfZFLc_g8AxGBvDKZASoKAeXQuGnvPAQzvps
        if (type==19){  //
            String urlStr= wxTemplateConfigDO.getUrl();
            String urlStr= wxTemplateConfigDO.getUrl();
            boolean status = urlStr.contains("openid=");
            boolean status = urlStr.contains("openid=");
            if(!status){
            if(!status){
@ -258,6 +274,9 @@ public class MessageUtil {
            }
            }
            wxTemplateConfigDO.setUrl(url + urlStr );
            wxTemplateConfigDO.setUrl(url + urlStr );
        }
        }
        if (type==35){//支付提醒
            wxTemplateConfigDO.setUrl(url + wxTemplateConfigDO.getUrl()+json.getString("orderId"));
        }
        return wxTemplateConfigDO;
        return wxTemplateConfigDO;
    }
    }

+ 6 - 0
svr/svr-door-serivce/src/main/resources/application.yml

@ -150,6 +150,9 @@ fast-dfs:
server:
server:
  server_url: http://ehr.yihu.com/wlyy/
  server_url: http://ehr.yihu.com/wlyy/
tnzyy:
  tnzyy_url: http://172.26.0.107:10001/
neiwang:
neiwang:
  enable: true
  enable: true
  wlyy: http://172.26.0.110:22122/
  wlyy: http://172.26.0.110:22122/
@ -316,6 +319,9 @@ neiwang:
server:
server:
  server_url: http://ehr.yihu.com/wlyy/
  server_url: http://ehr.yihu.com/wlyy/
tnzyy:
  tnzyy_url: https://zyy.jkta.com.cn:9660/
base:
base:
  url: http://127.0.0.1:10020/svr-base/
  url: http://127.0.0.1:10020/svr-base/
  hospitalUrl: http://10.9.1.247:10022/
  hospitalUrl: http://10.9.1.247:10022/

+ 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;
package com.yihu.jw.hospital.endpoint.hospital;
import com.alibaba.fastjson.JSONObject;
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.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.family.WlyyPatientFamilyMemberDO;
import com.yihu.jw.entity.hospital.family.WlyyPatientFamilyMemberDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
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.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import com.yihu.jw.sms.service.YkyySMSService;
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.service.ZhongShanSMSService;
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.date.DateUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
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.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.text.ParseException;
import java.util.ArrayList;
import java.util.ArrayList;
@ -68,6 +66,8 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
    @Autowired
    @Autowired
    private TnyyEntranceService tnyyEntranceService;
    private TnyyEntranceService tnyyEntranceService;
    @Autowired
    @Autowired
    private ZBSmsService zbSmsService;
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    @Value("${wechat.id}")
    @Value("${wechat.id}")
    private String wxId;
    private String wxId;
@ -250,6 +250,17 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
                    mixEnvelop.setMessage("验证码发送失败");
                    mixEnvelop.setMessage("验证码发送失败");
                    mixEnvelop.setStatus(500);
                    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);
                }
            }
            }
        }
        }