ソースを参照

医生变更控制

lyr 8 年 前
コミット
b566220da0

+ 9 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/task/PushMsgTask.java

@ -6,6 +6,7 @@ import java.util.concurrent.LinkedBlockingQueue;
import com.yihu.wlyy.util.SystemConf;
import io.swagger.annotations.Api;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.slf4j.Logger;
@ -188,6 +189,11 @@ public class PushMsgTask {
     */
    private boolean sendWeixinMessage(String access_token, int type, String openid, String name, JSONObject json) {
        try {
            if (StringUtils.isEmpty(openid)) {
                logger.error("send wechat message failed:openid is empty");
                return false;
            }
            if (access_token != null) {
                String token_url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=" + access_token;
                String params = typeMsg(type, openid, name, json);
@ -386,8 +392,8 @@ public class PushMsgTask {
                keyword4.setColor("#000000");
                keyword4.setValue(json.getString("content"));
                m.put("remark", keyword4);
            }else if (type == 9) {
                temp.setUrl(url + "jkjy/html/article.html?openid=" + openid + "&dataId=" + json.getString("article")+"&toUser="+ json.getString("toUser"));
            } else if (type == 9) {
                temp.setUrl(url + "jkjy/html/article.html?openid=" + openid + "&dataId=" + json.getString("article") + "&toUser=" + json.getString("toUser"));
                temp_id = SystemConf.getInstance().getSystemProperties().getProperty("template_healthy_article");
                temp.setTemplate_id(temp_id);
                WechatTemplateData keyword1 = new WechatTemplateData();
@ -410,7 +416,7 @@ public class PushMsgTask {
                keyword5.setColor("#000000");
                keyword5.setValue(json.getString("remark"));
                m.put("remark", keyword5);
            } else if (type == 10){
            } else if (type == 10) {
                temp.setUrl(url + "qygl/html/signing-doctors.html?openid=" + openid + "&state=" + openid + "&toUser=" + json.getString("toUser"));
                temp.setTemplate_id(SystemConf.getInstance().getSystemProperties()
                        .getProperty("template_doctor_change"));

+ 24 - 13
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java

@ -1563,16 +1563,15 @@ public class DoctorController extends BaseController {
                                          @RequestParam(required = false) String patients,
                                          @RequestParam(required = false) String isAll) {
        try {
            String status = redisTemplate.opsForValue().get("jianguanshifenpei:" + getUID());
            status = StringUtils.isEmpty(status) ? "0" : status;
            if(!status.equals("1")){
                redisTemplate.opsForValue().set("jianguanshifenpei:" + getUID(),"1");
                redisTemplate.expire("jianguanshifenpei:" + getUID(), 20, TimeUnit.MINUTES);
            } else {
                return error(-1,"正在分配,请勿重复操作");
            }
            if (StringUtils.isNotEmpty(isAll) && isAll.equals("1")) {
                String status = redisTemplate.opsForValue().get("jianguanshifenpei:" + getUID());
                status = StringUtils.isEmpty(status) ? "0" : status;
                if(!status.equals("1")){
                    redisTemplate.opsForValue().set("jianguanshifenpei:" + getUID(),"1");
                    redisTemplate.expire("jianguanshifenpei:" + getUID(), 20, TimeUnit.MINUTES);
                } else {
                    return error(-1,"正在分配,请勿重复分配");
                }
                int result = doctorInfoService.updateTeamHealthDoctorsAll(newDoctorCode, getUID());
                redisTemplate.opsForValue().set("jianguanshifenpei:" + getUID(),"0");
                redisTemplate.expire("jianguanshifenpei:" + getUID(), 20, TimeUnit.MINUTES);
@ -1587,12 +1586,12 @@ public class DoctorController extends BaseController {
                }
                doctorInfoService.updateTeamHealthDoctors(newDoctorCode, oldDoctorCode, patients, getUID());
            }
            redisTemplate.opsForValue().set("jianguanshifenpei:" + getUID(),"0");
            redisTemplate.expire("jianguanshifenpei:" + getUID(), 20, TimeUnit.MINUTES);
            return write(200, "更新成功");
        } catch (Exception e) {
            if(isAll.equals("1")) {
                redisTemplate.opsForValue().set("jianguanshifenpei:" + getUID(), "0");
                redisTemplate.expire("jianguanshifenpei:" + getUID(), 20, TimeUnit.MINUTES);
            }
            redisTemplate.opsForValue().set("jianguanshifenpei:" + getUID(), "0");
            redisTemplate.expire("jianguanshifenpei:" + getUID(), 20, TimeUnit.MINUTES);
            e.printStackTrace();
            return error(-1, "更新失败");
        }
@ -1612,9 +1611,21 @@ public class DoctorController extends BaseController {
                                    String oldDoctorCode,
                                    String patients) {
        try {
            String status = redisTemplate.opsForValue().get("quankeyishengfenpei:" + getUID());
            status = StringUtils.isEmpty(status) ? "0" : status;
            if(!status.equals("1")){
                redisTemplate.opsForValue().set("quankeyishengfenpei:" + getUID(),"1");
                redisTemplate.expire("quankeyishengfenpei:" + getUID(), 20, TimeUnit.MINUTES);
            } else {
                return error(-1,"正在分配,请勿重复操作");
            }
            doctorInfoService.updateTeamDoctors(newDoctorCode, oldDoctorCode, patients, getUID());
            redisTemplate.opsForValue().set("quankeyishengfenpei:" + getUID(), "0");
            redisTemplate.expire("quankeyishengfenpei:" + getUID(), 20, TimeUnit.MINUTES);
            return write(200, "更新成功");
        } catch (Exception e) {
            redisTemplate.opsForValue().set("quankeyishengfenpei:" + getUID(), "0");
            redisTemplate.expire("quankeyishengfenpei:" + getUID(), 20, TimeUnit.MINUTES);
            e.printStackTrace();
            return error(-1, "更新失败");
        }