Browse Source

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

wangjun 3 years ago
parent
commit
76ec99ce96
18 changed files with 231 additions and 95 deletions
  1. 11 0
      common/common-entity/src/main/java/com/yihu/jw/entity/care/common/BusinessSysDictDO.java
  2. 7 7
      server/svr-authentication/src/main/java/com/yihu/jw/security/core/userdetails/jdbc/WlyyUserDetailsService.java
  3. 1 1
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  4. 10 0
      svr/svr-base/src/main/java/com/yihu/jw/base/service/dict/BusinessSysDictService.java
  5. 54 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/consult/WxPushEndpoint.java
  6. 14 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/patient/PatientEndpoint.java
  7. 2 2
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/security/SecurityMonitoringOrderEndpoint.java
  8. 3 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/wechat/WechatMenuController.java
  9. 1 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/consult/ConsultTeamService.java
  10. 71 0
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/consult/WxPushService.java
  11. 8 4
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/course/CourseService.java
  12. 5 5
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doorCoach/DoctorDoorCoachOrderService.java
  13. 1 1
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doorCoach/PatientDoorCoachOrderService.java
  14. 25 4
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/security/SecurityMonitoringOrderService.java
  15. 9 8
      svr/svr-cloud-care/src/main/java/com/yihu/jw/care/util/MessageUtil.java
  16. 3 3
      svr/svr-cloud-care/src/main/resources/application.yml
  17. 3 54
      svr/svr-cloud-care/src/main/resources/wechat/weixin_menu.txt
  18. 3 3
      svr/svr-cloud-device/src/main/resources/application.yml

+ 11 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/common/BusinessSysDictDO.java

@ -58,6 +58,7 @@ public class BusinessSysDictDO extends UuidIdentityEntityWithTime {
     * 归属机构
     */
    private String orgCode;
    private String orgName;
    @Column(name = "model_name")
    public String getModelName() {
@ -134,6 +135,7 @@ public class BusinessSysDictDO extends UuidIdentityEntityWithTime {
        this.ext2 = ext2;
    }
    @Column(name = "org_code")
    public String getOrgCode() {
        return orgCode;
    }
@ -141,4 +143,13 @@ public class BusinessSysDictDO extends UuidIdentityEntityWithTime {
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    @Column(name = "org_name")
    public String getOrgName() {
        return orgName;
    }
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }
}

+ 7 - 7
server/svr-authentication/src/main/java/com/yihu/jw/security/core/userdetails/jdbc/WlyyUserDetailsService.java

@ -758,13 +758,13 @@ public class WlyyUserDetailsService extends JdbcDaoSupport implements UserDetail
    public static List<String> loginTypeList = new ArrayList<>();
    static {
        loginTypeList.add("1");
        loginTypeList.add("2");
        loginTypeList.add("3");
        loginTypeList.add("4");
        loginTypeList.add("5");
        loginTypeList.add("6");
        loginTypeList.add("7");
        loginTypeList.add("1");//user 登录
        loginTypeList.add("2");//医生登录
        loginTypeList.add("3");//居民登录
        loginTypeList.add("4");//第三方同步患者账号
        loginTypeList.add("5");//支付宝登录
        loginTypeList.add("6");//第三方登录-医联康护
        loginTypeList.add("7");//家人登录
    }
    public boolean setRolePhth(String loginType, OAuth2AccessToken token, String id, StringRedisTemplate redisTemplate) {

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

@ -727,7 +727,7 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
            String captcha = wlyyRedisVerifyCodeService.getCodeNumber();
            //
            String result =  txySmsService.sendMessage(username,captcha);
            if ("ok".equals(result)) {
            if ("Ok".equals(result)) {
                Captcha _captcha = new Captcha();
                _captcha.setCode(captcha);
                _captcha.setExpiresIn(300);

+ 10 - 0
svr/svr-base/src/main/java/com/yihu/jw/base/service/dict/BusinessSysDictService.java

@ -53,6 +53,10 @@ public class BusinessSysDictService extends BaseJpaService<BusinessSysDictDO, Bu
                businessSysDictDO1.setPyCode(businessSysDictDO.getPyCode());
                businessSysDictDO1.setImgUrl(businessSysDictDO.getImgUrl());
                businessSysDictDO1.setSort(businessSysDictDO.getSort());
                businessSysDictDO1.setExt1(businessSysDictDO.getExt1());
                businessSysDictDO1.setExt2(businessSysDictDO.getExt2());
                businessSysDictDO1.setOrgCode(businessSysDictDO.getOrgCode());
                businessSysDictDO1.setOrgName(businessSysDictDO.getOrgName());
                businessSysDictDO1.setModelName(modelName);
            }else {
                businessSysDictDO1 = new BusinessSysDictDO();
@ -62,6 +66,10 @@ public class BusinessSysDictService extends BaseJpaService<BusinessSysDictDO, Bu
                businessSysDictDO1.setPyCode(businessSysDictDO.getPyCode());
                businessSysDictDO1.setImgUrl(businessSysDictDO.getImgUrl());
                businessSysDictDO1.setSort(businessSysDictDO.getSort());
                businessSysDictDO1.setExt1(businessSysDictDO.getExt1());
                businessSysDictDO1.setExt2(businessSysDictDO.getExt2());
                businessSysDictDO1.setOrgCode(businessSysDictDO.getOrgCode());
                businessSysDictDO1.setOrgName(businessSysDictDO.getOrgName());
                businessSysDictDO1.setModelName(modelName);
            }
@ -97,6 +105,8 @@ public class BusinessSysDictService extends BaseJpaService<BusinessSysDictDO, Bu
                " t.sort   as \"sort\","+
                " t.py_code  as \"pyCode\","+
                " t.img_url  as \"imgUrl\","+
                " t.org_code  as \"orgCode\","+
                " t.org_name  as \"orgName\","+
                " t.create_time as \"createTime\""+
                " , t.ext1, t.ext2 from base_business_sys_dict t where 1=1 ";
        if (StringUtils.isNoneBlank(name)){

+ 54 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/consult/WxPushEndpoint.java

@ -0,0 +1,54 @@
package com.yihu.jw.care.endpoint.consult;
import com.yihu.jw.care.service.consult.WxPushService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.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;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/27
 * @Description:
 */
@RestController
@RequestMapping(value = "wxpush")
@Api(value = "im推送微信模板", description = "im推送微信模板", tags = {"im推送微信模板"})
public class WxPushEndpoint extends EnvelopRestEndpoint {
    @Autowired
    private WxPushService wxPushService;
    @PostMapping(value = "sendWXTemplate")
    @ApiOperation(value = "发送微信模板消息")
    public Envelop sendWXTemplate(
            @ApiParam(name = "userName", value = "推送人姓名")
            @RequestParam(value = "userName", required = true) String userName,
            @ApiParam(name = "idCard", value = "推送人身份证")
            @RequestParam(value = "idCard", required = false) String idCard,
            @ApiParam(name = "phone", value = "推送人手机号")
            @RequestParam(value = "phone", required = false) String phone,
            @ApiParam(name = "title", value = "推送标题")
            @RequestParam(value = "title", required = false) String title,
            @ApiParam(name = "url", value = "跳转链接")
            @RequestParam(value = "url", required = false) String url,
            @ApiParam(name = "content", value = "内容简介")
            @RequestParam(value = "content", required = true) String content,
            @ApiParam(name = "topidId", value = "咨询id")
            @RequestParam(value = "topidId", required = true) String topidId,
            @ApiParam(name = "sessionId", value = "会话id")
            @RequestParam(value = "sessionId", required = true) String sessionId,
            @ApiParam(name = "contentString", value = "内容明细串")
            @RequestParam(value = "contentString", required = false) String contentString) throws Exception {
        wxPushService.sendWXTemplate(userName, idCard, phone, title, url, content, topidId, sessionId, contentString);
        return success("success");
    }
}

+ 14 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/patient/PatientEndpoint.java

@ -8,10 +8,10 @@ import com.yihu.jw.care.aop.ServicesAuthAOP;
import com.yihu.jw.care.dao.label.WlyyPatientLabelDao;
import com.yihu.jw.care.service.patient.CarePatientService;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.exception.ApiException;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.base.BaseRequestMapping;
@ -40,6 +40,19 @@ public class PatientEndpoint extends EnvelopRestEndpoint {
    ServicesAuthAOP servicesAuthAOP;
    public int num = 20;
    @GetMapping(value = "testException")
    @ApiOperation(value = "测试异常")
    public String testException(String type) throws Exception {
        if("1".equals(type)){
            throw new NullPointerException();
        }else if("2".equals(type)){
            throw new ApiException("111");
        }
        return "获取成功";
    }
    @RequestMapping(value = "testRedisLock")
    @RedisLock(key = "#patientDO.id")
    public Envelop testRedisLock(BasePatientDO patientDO) {

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/security/SecurityMonitoringOrderEndpoint.java

@ -210,7 +210,7 @@ public class SecurityMonitoringOrderEndpoint extends EnvelopRestEndpoint {
            @RequestParam(value = "conclusion_img", required = false) String conclusion_img
            ) {
        try {
            JSONObject result = securityMonitoringOrderService.updateDoorConclusion(emergency_reason,treatment_status, orderId,conclusion,conclusion_img);
            JSONObject result = securityMonitoringOrderService.updateDoorConclusion(emergency_reason,treatment_status, orderId,conclusion,conclusion_img,getUID());
            if (result.getIntValue("resultFlag") == 0) {
                return ObjEnvelop.getError(result.getString("resultMsg"));
            }
@ -227,7 +227,7 @@ public class SecurityMonitoringOrderEndpoint extends EnvelopRestEndpoint {
    @ApiOperation("取消登记服务小结")
    public ObjEnvelop cancelConclusion(@ApiParam(name = "orderId", value = "工单id", required = true) @RequestParam String orderId) {
        try {
            JSONObject result = securityMonitoringOrderService.cancelConclusion(orderId);
            JSONObject result = securityMonitoringOrderService.cancelConclusion(orderId,getUID());
            if (result.getIntValue("resultFlag") == 0) {
                return ObjEnvelop.getError(result.getString("resultMsg"));
            }

+ 3 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/wechat/WechatMenuController.java

@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
@ -44,7 +45,8 @@ public class WechatMenuController extends EnvelopRestEndpoint {
    public String createMenuTest() {
        try {
            WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
            String filePath = "/usr/local/hospital/weixin_menu.txt";
            String filePath = WechatCoreController.class.getResource("/").getPath() +
                    File.separator + "wechat" + File.separator + "weixin_menu.txt";
            logger.info("filePath"+filePath);
            String url = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=" + wxAccessTokenDO.getAccessToken();
            // 读取微信菜单配置文件

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/consult/ConsultTeamService.java

@ -310,7 +310,7 @@ public class ConsultTeamService {
        for (Map<String,Object> tmp:dispatcherInfoList){
            participants.put(tmp.get("code").toString(), 0);
        }
        String content = patientDO.getName() + "-上门辅导服务咨询";
        String content = patientDO.getName() + "-发起上门辅导服务咨询";
        JSONObject messages = imUtill.getCreateTopicMessage(patient, patientDO.getName(), consult.getTitle(), content, consult.getImages(), "");
        JSONObject imResponseJson = imUtill.createTopics(sessionId, consult.getId(), content, participants, messages, ImUtil.SESSION_TYPE_DOOR_COACH);

+ 71 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/consult/WxPushService.java

@ -0,0 +1,71 @@
package com.yihu.jw.care.service.consult;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.util.MessageUtil;
import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.im.dao.ConsultDao;
import com.yihu.jw.im.util.ImUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yeshijie
 * @Date: 2021/5/27
 * @Description:
 */
@Service
public class WxPushService {
    @Autowired
    private MessageUtil messageUtil;
    @Value("${wechat.id}")
    private String wxId;
    @Autowired
    private ConsultDao consultDao;
    @Autowired
    private BasePatientWechatDao basePatientWechatDao;
    /**
     * 发送微信模板
     */
    public void sendWXTemplate(String userName,String idCard, String phone,String title, String url,String content,
                               String topidId,String sessionId,String contentString){
        JSONObject json = new JSONObject();
        ConsultDo consult =  consultDao.findOne(topidId);
        if(consult == null) {
           return;
        }
        /**
         * 反馈处理结果通知
         【服务对象姓名】的上门辅导服务咨询有新的回复
         提交时间:【回复消息时间】
         提交内容:【IM消息内容】
         处理结果:已回复
         您可点击消息查看详情
         {{first.DATA}}
         提交时间:{{keyword1.DATA}}
         提交内容:{{keyword2.DATA}}
         处理结果:{{keyword3.DATA}}
         {{remark.DATA}}
         */
        String consultType = String.valueOf(consult.getType());
        String first = "key1,您好!您的咨询有新的回复";
        if(ImUtil.SESSION_TYPE_DOOR_COACH.equals(consultType)){
            first = userName +"的上门辅导服务咨询有新的回复";
        }
        json.put("sessionId",sessionId);
        json.put("consultType",consultType);
        List<BasePatientWechatDo> basePatientWechatDos = basePatientWechatDao.findByWechatIdAndPatientId(wxId,consult.getPatient());
        String openId = basePatientWechatDos.get(0).getOpenid();
        messageUtil.putTemplateWxMessage(wxId,"template_consult_reply","zxhf",openId,first,null,null,1,json,
                DateUtil.getStringDate(),content,"已回复");
    }
}

+ 8 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/course/CourseService.java

@ -442,7 +442,9 @@ public class CourseService {
            for (int i=0;i<positionList.size();i++){
                String sql1 = "SELECT id,code,`name`,mobile,photo,address,longitude,latitude ,funDistance("+positionList.get(i).get("latitude")+","+positionList.get(i).get("longitude")+","+lat2+","+lon2+") funDistance FROM base.base_org where id = '"+positionList.get(i).get("id")+"'";
                List<Map<String , Object>> mapList = jdbcTemplate.queryForList(sql1);
//                base_recruit_students
                String allNumSql = "SELECT num FROM base_recruit_students WHERE org_code = '"+mapList.get(0).get("code")+"' AND del = 1 ";
                Integer allNum = jdbcTemplate.queryForObject(allNumSql,Integer.class);
                Integer num = 0;
                // 判断该机构是否开放报名
                String ksbm = "SELECT COUNT(1) a FROM base_recruit_students WHERE '"+nowDate+"' > create_time AND '"+nowDate+"' < end_time AND del = 1 AND org_code = '"+mapList.get(0).get("code")+"'";
@ -453,6 +455,7 @@ public class CourseService {
                            "SELECT rs.id,COUNT(rsr.id) num FROM base_recruit_students rs,base_recruit_students_record rsr WHERE '"+nowDate+"' >rs.start_time AND rs.org_code = '"+mapList.get(0).get("code")+"'\n" +
                            "AND '"+nowDate+"' < rs.end_time AND rs.del = 1 AND rs.id = rsr.recruit_students_id AND rsr.status IN (2,3,6)) bbm";
                    List<Map<String,Object>> maps = jdbcTemplate.queryForList(sqlNum);
                    num = 0;
                    if (maps.size() > 0){
                        for (int j =0 ; j < maps.size() ; j++){
                            num = num + Integer.parseInt(String.valueOf(maps.get(j).get("num")));
@ -476,6 +479,7 @@ public class CourseService {
                obj.put("mobile",mapList.get(0).get("mobile"));
                obj.put("funDistance",mapList.get(0).get("funDistance"));
                obj.put("num",num);
                obj.put("allNum",allNum);
                obj.put("course",course);
                list.add(obj);
            }
@ -601,7 +605,7 @@ public class CourseService {
    public JSONObject getOrgInfoById(String id){
        JSONObject object = new JSONObject();
        String sql = "SELECT o.id,rs.id recruitId,o.`code`,o.`name`,o.mobile,o.photo,o.address,o.intro,rs.start_time startTime,rs.end_time endTime,rs.num,rs.fee,rs.id rsId \n" +
        String sql = "SELECT o.id,rs.id recruitId,o.`code`,o.`name`,o.mobile,o.photo,o.address,o.brief,rs.start_time startTime,rs.end_time endTime,rs.num,rs.fee,rs.id rsId \n" +
                "FROM base_org o,base_recruit_students rs\n" +
                "WHERE o.id = '"+id+"' AND o.type = 4 AND o.del = 1 AND o.`code` = rs.org_code AND rs.del = 1";
        List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
@ -612,14 +616,14 @@ public class CourseService {
            object.put("mobile",mapList.get(0).get("mobile"));//机构联系方式
            object.put("photo",mapList.get(0).get("photo"));//机构图片
            object.put("address",mapList.get(0).get("address"));//机构地址
            object.put("intro",mapList.get(0).get("intro"));//机构简介
            object.put("intro",mapList.get(0).get("brief"));//机构简介
            object.put("startTime",mapList.get(0).get("startTime"));//招生开始时间
            object.put("endTime",mapList.get(0).get("endTime"));//招生结束时间
            object.put("num",mapList.get(0).get("num"));//招生名额
            object.put("fee",mapList.get(0).get("fee"));//报名费用
            String sql1 = "SELECT COUNT(*) count\n" +
                    "FROM base_org o,base_recruit_students_record rsr,base_recruit_students rs\n" +
                    "WHERE o.`code` = rsr.org_code AND rsr.recruit_students_id = '"+mapList.get(0).get("rsId")+"' AND o.`code` = '"+mapList.get(0).get("code")+"' AND (`status` = 3 OR `status` = 6);\n";
                    "WHERE o.`code` = rsr.org_code AND rsr.recruit_students_id = '"+mapList.get(0).get("rsId")+"' AND o.`code` = '"+mapList.get(0).get("code")+"' AND (`status` = 2 OR `status` = 3 OR `status` = 6);\n";
            Integer count = jdbcTemplate.queryForObject(sql1,Integer.class);
            String sql2 = "SELECT * FROM base_course WHERE del = 1 AND org_code = '"+mapList.get(0).get("code")+"'" ;

+ 5 - 5
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doorCoach/DoctorDoorCoachOrderService.java

@ -209,9 +209,9 @@ public class DoctorDoorCoachOrderService {
            object.put("has_read",one.get("is_read"));
            object.put("appliStatus",one.get("appliStatus"));
            Date date = (Date)one.get("create_time");
            object.put("create_time", DateUtil.dateToStr(date,"yyyy-MM-dd HH:mm:ss"));
            object.put("create_time", DateUtil.dateToStrLong(date));
            Date date1 = (Date)one.get("czrq");
            object.put("czrq", DateUtil.dateToStr(date1,"yyyy-MM-dd HH:mm:ss"));
            object.put("czrq", DateUtil.dateToStrLong(date1));
            jsonArray.add(object);
        }
        org.json.JSONObject object = new org.json.JSONObject();
@ -301,7 +301,7 @@ public class DoctorDoorCoachOrderService {
                case 2:statusName="待服务";break;
                case 3:statusName="待服务";break;
                case 4:statusName="待服务";break;
                case 5:statusName="已完成";break;
                case 5:statusName="待服务";break;
                case 6:statusName="已完成";break;
            }
@ -323,7 +323,7 @@ public class DoctorDoorCoachOrderService {
            object.put("serveDesc",one.get("serve_desc"));
            object.put("hosLevel",one.get("hosLevel"));
            Date date = (Date)one.get("create_time");
            object.put("createTime",DateUtil.dateToStr(date,"yyyy-MM-dd HH:mm:ss"));
            object.put("createTime",DateUtil.dateToStrLong(date));
            object.put("examPaperStatus",one.get("examPaperStatus"));
            object.put("totalFee",one.get("total_fee"));
            List<BaseDoorCoachFeeDetailDO> feeDetailDOs = doorFeeDetailDao.findByOrderIdAndType(one.get("orderId")+"", 1);
@ -614,7 +614,7 @@ public class DoctorDoorCoachOrderService {
            json.put("finish",finish);
            List<BasePatientWechatDo> basePatientWechatDos = basePatientWechatDao.findByWechatIdAndPatientId(wxId,patient.getId());
            String openId = basePatientWechatDos.get(0).getOpenid();
            String first="key1预约上门预约医生已完成服务。".replace("key1", DateUtil.dateToStr(new Date(), "yyyy-MM-dd HH:mm"));
            String first="key1预约上门预约医生已完成服务。".replace("key1", DateUtil.dateToStrLong(new Date()));
            messageUtil.putTemplateWxMessage(wxId,"template_process_feedback","fwyspf",openId,first,null,null,31,json,DateUtil.dateToChineseDate(new Date()),"服务医生评分");
        }catch (Exception e){

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doorCoach/PatientDoorCoachOrderService.java

@ -1294,7 +1294,7 @@ public class PatientDoorCoachOrderService extends BaseJpaService<BaseDoorCoachOr
            object.put("serveDesc",one.get("serve_desc"));
            object.put("hosLevel",one.get("hosLevel"));
            Date date = (Date)one.get("create_time");
            object.put("createTime",DateUtil.dateToStr(date,"yyyy-MM-dd HH:mm:ss"));
            object.put("createTime",DateUtil.dateToStrLong(date));
            object.put("examPaperStatus",one.get("examPaperStatus"));
            object.put("totalFee",one.get("total_fee"));
            List<BaseDoorCoachFeeDetailDO> feeDetailDOs = doorFeeDetailDao.findByOrderIdAndType(one.get("orderId")+"", 1);

+ 25 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/security/SecurityMonitoringOrderService.java

@ -473,7 +473,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
            tmp.put("id",one.get("orderId"));
            tmp.put("serveDesc",one.get("serve_desc"));
            Date date = (Date)one.get("create_time");
            tmp.put("createTime", DateUtil.dateToStr(date,"yyyy-MM-dd hh:mm:ss"));
            tmp.put("createTime", DateUtil.dateToStrLong(date));
            tmp.put("status",one.get("status"));
            tmp.put("doctor",one.get("doctor"));
            tmp.put("doctorName",one.get("doctor_name"));
@ -827,11 +827,20 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
     * @return
     * @throws Exception
     */
    public JSONObject updateDoorConclusion(Integer emergency_reason,Integer treatment_status,String orderId,String conclusion,String conclusion_img) throws Exception {
    public JSONObject updateDoorConclusion(Integer emergency_reason,Integer treatment_status,String orderId,String conclusion,String conclusion_img,String doctor) throws Exception {
        JSONObject result = new JSONObject();
        ObjectMapper objectMapper = new ObjectMapper();
        objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd"));
        SecurityMonitoringOrderDO one = securityMonitoringOrderDao.findOne(orderId);
        if (StringUtils.isNotBlank(doctor)){
            BaseDoctorDO doctorDO = baseDoctorDao.findById(doctor);
            if (doctorDO!=null){
                one.setDoctor(doctor);
                one.setDoctorName(doctorDO.getName());
                one.setUpdateUser(doctor);
                one.setUpdateUserName(doctorDO.getName());
            }
        }
        if (one==null){
            String failMsg = "工单不存在" ;
            result.put("resultFlag", 0);
@ -877,9 +886,18 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
     * 跳过登记服务小结
     * @param orderId
     */
    public JSONObject cancelConclusion(String orderId) throws Exception {
    public JSONObject cancelConclusion(String orderId,String doctor) throws Exception {
        JSONObject result = new JSONObject();
        SecurityMonitoringOrderDO one = securityMonitoringOrderDao.findOne(orderId);
        if (StringUtils.isNotBlank(doctor)){
            BaseDoctorDO doctorDO = baseDoctorDao.findById(doctor);
            if (doctorDO!=null){
                one.setDoctor(doctor);
                one.setDoctorName(doctorDO.getName());
                one.setUpdateUser(doctor);
                one.setUpdateUserName(doctorDO.getName());
            }
        }
        if (one==null){
            String failMsg = "工单不存在" ;
            result.put("resultFlag", 0);
@ -890,7 +908,10 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
            String failMsg = "咨询结束失败 无法结束工单";
            throw new Exception(failMsg);
        }
        securityMonitoringOrderDao.updateConclusionStatus(orderId);
        one.setStatus(0);
        one.setUpdateTime(new Date());
        securityMonitoringOrderDao.save(one);
        return getSecurityOrderDetail(orderId,null);
    }

+ 9 - 8
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/util/MessageUtil.java

@ -1,10 +1,8 @@
package com.yihu.jw.care.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxAccessTokenDO;
import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
import com.yihu.jw.entity.care.doorCoach.BaseDoorCoachOrderDO;
@ -13,10 +11,8 @@ import com.yihu.jw.entity.care.securitymonitoring.SecurityMonitoringOrderDO;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.wechat.WeixinMessagePushUtils;
import com.yihu.jw.util.wechat.wxhttp.HttpUtil;
import com.yihu.jw.wechat.dao.WxAccessTokenDao;
import com.yihu.jw.wechat.dao.WxTemplateConfigDao;
import com.yihu.jw.wechat.service.WxAccessTokenService;
@ -27,7 +23,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
@ -77,10 +72,11 @@ public class MessageUtil {
     * @param url 跳转链接
     * @param remark
     * @param type  模板通知类型
     * @param josn 用于对跳转连接的修改,
     * @param json 用于对跳转连接的修改,
     * @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 json,String ...keywords) {
        try {
            System.out.println(wechatId);
            WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
@ -106,7 +102,7 @@ public class MessageUtil {
            if (StringUtils.isNoneBlank(remark)){
                newConfig.setRemark(remark);
            }
            newConfig = setTemPlateUrl(newConfig,type,openId,josn);
            newConfig = setTemPlateUrl(newConfig,type,openId,json);
            int keyLength = keywords.length;
            if (keyLength >= 1) {
               if(StringUtils.isNoneBlank(keywords[0])){
@ -158,6 +154,11 @@ public class MessageUtil {
            return wxTemplateConfigDO;
        }
        switch (type){
            case 1:
                //咨询回复
                wxTemplateConfigDO.setUrl(wxTemplateConfigDO.getUrl() + "?sessionId=" + json.getString("sessionId")
                        +"&type="+json.getString("consultType"));
                break;
            case 19:
                String urlStr= wxTemplateConfigDO.getUrl();
                boolean status = urlStr.contains("openid=");

+ 3 - 3
svr/svr-cloud-care/src/main/resources/application.yml

@ -135,7 +135,7 @@ wechat:
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fweixin.xmtyw.cn%2fwlyy-dev
  accId: gh_ffd64560fb21
  id: sd_tnzyy_wx  # base库中,wx_wechat 的id字段
  id: ijk  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
im:
@ -231,7 +231,7 @@ wechat:
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fweixin.xmtyw.cn%2fwlyy-dev
  accId: gh_ffd64560fb21
  id: sd_tnzyy_wx  # base库中,wx_wechat 的id字段
  id: ijk  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
im:
@ -335,7 +335,7 @@ wechat:
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fweixin.xmtyw.cn%2fwlyy-dev
  accId: gh_ffd64560fb21
  id: sd_tnzyy_wx  # base库中,wx_wechat 的id字段
  id: ijk  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
im:

+ 3 - 54
svr/svr-cloud-care/src/main/resources/wechat/weixin_menu.txt

@ -1,60 +1,9 @@
{
"button":[
   {
	  "name":"掌上医院",
	  "name":"进入云照护",
	  "type":"view",
      "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fintel.yanketong.com%2Fims-wx%2F%23%2FzsIndex&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
   },
   {
	  "name":"就医问诊",
	  "sub_button":[
		 {
         		"type":"view",
         		"name":"预约挂号",
         		"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fintel.yanketong.com%2Fims-wx%2F%23%2Fappointment%2FhospitalList&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
		 {
            	"type":"view",
         	    "name":"充值缴费",
         		"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fintel.yanketong.com%2Fims-wx%2F%23%2FmedicalCard%2Findex&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
		 {
                "type":"view",
               	"name":"专家咨询",
               	"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fintel.yanketong.com%2Fims-wx%2F%23%2FnDocList%3Fzjzx%3D2&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
         {
                "type":"view",
                "name":"在线复诊",
                "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fintel.yanketong.com%2Fims-wx%2F%23%2FnDocList%3FisFz%3D1&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         }
	  ]
   },
   {
	  "name":"我",
	  "sub_button":[
		 {
                "type":"view",
                "name":"个人中心",
                "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fintel.yanketong.com%2Fims-wx%2F%23%2Fpersonal%2Findex&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
         {
        		"type":"view",
        		"name":"APP下载",
        		"url":"http://www.yanketong.com/app/yk.htm"
         },
         {
                "type":"view",
                "name":"报告查询",
                "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fintel.yanketong.com%2Fims-wx%2F%23%2FonlineCheck%2Findex&response_type=code&scope=snsapi_base&state=1#wechat_redirect"
         },
         {
               	"type":"view",
                "name":"家庭成员管理",
                "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3A%2F%2Fintel.yanketong.com%2Fims-wx%2F%23%2FfamilyControl%2Findex&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         }
	 ]
  }
      "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx2c55f5b7b2f3cb56&redirect_uri=https%3A%2F%2Fhzijk.cityihealth.com%2Fmedical-care-patient%2Fhome%2Findex&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
   }
]
}

+ 3 - 3
svr/svr-cloud-device/src/main/resources/application.yml

@ -128,7 +128,7 @@ wechat:
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fweixin.xmtyw.cn%2fwlyy-dev
  accId: gh_ffd64560fb21
  id: sd_tnzyy_wx  # base库中,wx_wechat 的id字段
  id: ijk  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
im:
@ -221,7 +221,7 @@ wechat:
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fweixin.xmtyw.cn%2fwlyy-dev
  accId: gh_ffd64560fb21
  id: sd_tnzyy_wx  # base库中,wx_wechat 的id字段
  id: ijk  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
im:
@ -321,7 +321,7 @@ wechat:
  wechat_token: 27eb3bb24f149a7760cf1bb154b08040
  wechat_base_url: http%3a%2f%2fweixin.xmtyw.cn%2fwlyy-dev
  accId: gh_ffd64560fb21
  id: sd_tnzyy_wx  # base库中,wx_wechat 的id字段
  id: ijk  # base库中,wx_wechat 的id字段
  flag: false #演示环境  true走Mysql数据库  false走Oracle
im: