|
@ -3,6 +3,7 @@ package com.yihu.wlyy.web.doctor.account;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
import com.yihu.wlyy.entity.organization.Hospital;
|
|
|
import com.yihu.wlyy.entity.doctor.profile.Doctor;
|
|
@ -21,6 +22,7 @@ import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@ -73,6 +75,8 @@ public class DoctorController extends BaseController {
|
|
|
private HospitalDeptService deptService;
|
|
|
@Autowired
|
|
|
private DoctorWorkTimeService workTimeService;
|
|
|
@Autowired
|
|
|
StringRedisTemplate redisTemplate;
|
|
|
|
|
|
/**
|
|
|
* 社区医院下医生列表查询接口 没分页
|
|
@ -1560,8 +1564,18 @@ public class DoctorController extends BaseController {
|
|
|
@RequestParam(required = false) String isAll) {
|
|
|
try {
|
|
|
if (StringUtils.isNotEmpty(isAll) && isAll.equals("1")) {
|
|
|
int result = doctorInfoService.updateTeamHealthDoctorsAll(newDoctorCode, getUID());
|
|
|
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);
|
|
|
if (result == 1) {
|
|
|
return write(200, "分配健管师成功");
|
|
|
} else if (result == 2) {
|
|
@ -1575,6 +1589,10 @@ public class DoctorController extends BaseController {
|
|
|
}
|
|
|
return write(200, "更新成功");
|
|
|
} catch (Exception e) {
|
|
|
if(isAll.equals("1")) {
|
|
|
redisTemplate.opsForValue().set("jianguanshifenpei:" + getUID(), "0");
|
|
|
redisTemplate.expire("jianguanshifenpei:" + getUID(), 20, TimeUnit.MINUTES);
|
|
|
}
|
|
|
e.printStackTrace();
|
|
|
return error(-1, "更新失败");
|
|
|
}
|