Commit da9254ad3a1f29f9ee4a7b6ff86ffb9acff0f9f4
1 parent
aa80cded2b
Exists in
master
and in
6 other branches
医生列表和分配医生团队
Showing 7 changed files with 234 additions and 1 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/DoctorTeamMapper.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/Users.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/UsersQuery.java
- platform-biz-service/src/main/resources/mainOrm/master/DoctorTeamMapper.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TeamController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/TeamService.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TeamServiceImpl.java
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/DoctorTeamMapper.java
View file @
da9254a
| ... | ... | @@ -2,6 +2,8 @@ | 
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.biz.dal.IbabySieveDao; | 
| 4 | 4 | import com.lyms.platform.permission.model.DoctorTeam; | 
| 5 | +import com.lyms.platform.permission.model.Users; | |
| 6 | +import com.lyms.platform.permission.model.UsersQuery; | |
| 5 | 7 | |
| 6 | 8 | import java.util.List; | 
| 7 | 9 | |
| ... | ... | @@ -17,5 +19,11 @@ | 
| 17 | 19 | List<DoctorTeam> queryListDoctorTeam(DoctorTeam doctorTeam); | 
| 18 | 20 | |
| 19 | 21 | int queryListDoctorTeamCount(DoctorTeam doctorTeam); | 
| 22 | + | |
| 23 | + int queryListDoctorCount(UsersQuery usersQuery); | |
| 24 | + | |
| 25 | + List<UsersQuery> queryListDoctor(UsersQuery usersQuery); | |
| 26 | + | |
| 27 | + int allotDoctorTeam(Users users); | |
| 20 | 28 | } | 
platform-biz-service/src/main/java/com/lyms/platform/permission/model/Users.java
View file @
da9254a
| ... | ... | @@ -34,6 +34,33 @@ | 
| 34 | 34 | private String defaultPage; | 
| 35 | 35 | //秦皇岛需求医生团队 | 
| 36 | 36 | private Integer doctorTeamId; | 
| 37 | + private String teamName; | |
| 38 | + private String orgName; | |
| 39 | + private String deptName; | |
| 40 | + | |
| 41 | + public String getDeptName() { | |
| 42 | + return deptName; | |
| 43 | + } | |
| 44 | + | |
| 45 | + public void setDeptName(String deptName) { | |
| 46 | + this.deptName = deptName; | |
| 47 | + } | |
| 48 | + | |
| 49 | + public String getTeamName() { | |
| 50 | + return teamName; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public void setTeamName(String teamName) { | |
| 54 | + this.teamName = teamName; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public String getOrgName() { | |
| 58 | + return orgName; | |
| 59 | + } | |
| 60 | + | |
| 61 | + public void setOrgName(String orgName) { | |
| 62 | + this.orgName = orgName; | |
| 63 | + } | |
| 37 | 64 | |
| 38 | 65 | public Integer getDoctorTeamId() { | 
| 39 | 66 | return doctorTeamId; | 
platform-biz-service/src/main/java/com/lyms/platform/permission/model/UsersQuery.java
View file @
da9254a
| ... | ... | @@ -40,6 +40,43 @@ | 
| 40 | 40 | private Integer otherAccount; //第三方帐号, 1医院帐号 | 
| 41 | 41 | |
| 42 | 42 | private List<String> names; | 
| 43 | + //秦皇岛需求医生团队 | |
| 44 | + private Integer doctorTeamId; | |
| 45 | + private String teamName; | |
| 46 | + private String orgName; | |
| 47 | + private String deptName; | |
| 48 | + | |
| 49 | + public Integer getDoctorTeamId() { | |
| 50 | + return doctorTeamId; | |
| 51 | + } | |
| 52 | + | |
| 53 | + public void setDoctorTeamId(Integer doctorTeamId) { | |
| 54 | + this.doctorTeamId = doctorTeamId; | |
| 55 | + } | |
| 56 | + | |
| 57 | + public String getTeamName() { | |
| 58 | + return teamName; | |
| 59 | + } | |
| 60 | + | |
| 61 | + public void setTeamName(String teamName) { | |
| 62 | + this.teamName = teamName; | |
| 63 | + } | |
| 64 | + | |
| 65 | + public String getOrgName() { | |
| 66 | + return orgName; | |
| 67 | + } | |
| 68 | + | |
| 69 | + public void setOrgName(String orgName) { | |
| 70 | + this.orgName = orgName; | |
| 71 | + } | |
| 72 | + | |
| 73 | + public String getDeptName() { | |
| 74 | + return deptName; | |
| 75 | + } | |
| 76 | + | |
| 77 | + public void setDeptName(String deptName) { | |
| 78 | + this.deptName = deptName; | |
| 79 | + } | |
| 43 | 80 | |
| 44 | 81 | public List<String> getNames() { | 
| 45 | 82 | return names; | 
platform-biz-service/src/main/resources/mainOrm/master/DoctorTeamMapper.xml
View file @
da9254a
| ... | ... | @@ -10,6 +10,37 @@ | 
| 10 | 10 | <result column="created" property="created" jdbcType="TIMESTAMP"/> | 
| 11 | 11 | </resultMap> | 
| 12 | 12 | |
| 13 | + <resultMap id="UsersResultMap" type="com.lyms.platform.permission.model.Users"> | |
| 14 | + <id column="id" property="id" jdbcType="INTEGER"/> | |
| 15 | + <result column="logincenter_id" property="logincenterId" jdbcType="INTEGER"/> | |
| 16 | + <result column="type" property="type" jdbcType="INTEGER"/> | |
| 17 | + <result column="org_id" property="orgId" jdbcType="INTEGER"/> | |
| 18 | + <result column="dept_id" property="deptId" jdbcType="INTEGER"/> | |
| 19 | + <result column="ks_id" property="ksId" jdbcType="INTEGER"/> | |
| 20 | + <result column="name" property="name" jdbcType="VARCHAR"/> | |
| 21 | + <result column="account" property="account" jdbcType="VARCHAR"/> | |
| 22 | + <result column="pwd" property="pwd" jdbcType="VARCHAR"/> | |
| 23 | + <result column="phone" property="phone" jdbcType="VARCHAR"/> | |
| 24 | + <result column="publish_id" property="publishId" jdbcType="INTEGER"/> | |
| 25 | + <result column="publish_name" property="publishName" jdbcType="VARCHAR"/> | |
| 26 | + <result column="yn" property="yn" jdbcType="INTEGER"/> | |
| 27 | + <result column="enable" property="enable" jdbcType="INTEGER"/> | |
| 28 | + <result column="modified" property="modified" jdbcType="TIMESTAMP"/> | |
| 29 | + <result column="created" property="created" jdbcType="TIMESTAMP"/> | |
| 30 | + <result column="remarks" property="remarks" jdbcType="VARCHAR"/> | |
| 31 | + <result column="last_login_time" property="lastLoginTime" jdbcType="TIMESTAMP"/> | |
| 32 | + <result column="foreign_id" property="foreignId" jdbcType="VARCHAR"/> | |
| 33 | + <result column="employee_id" property="employeeId" jdbcType="VARCHAR"/> | |
| 34 | + <result column="other_account" property="otherAccount" jdbcType="INTEGER"/> | |
| 35 | + <result column="zhiChenId" property="zhiChenId" jdbcType="INTEGER"/> | |
| 36 | + <result column="defaultpage" property="defaultPage" jdbcType="INTEGER"/> | |
| 37 | + <result column="doctorTeam_id" property="doctorTeamId" jdbcType="INTEGER"/> | |
| 38 | + <result column="teamname" property="teamName" jdbcType="INTEGER"/> | |
| 39 | + <result column="orgname" property="orgName" jdbcType="VARCHAR"/> | |
| 40 | + <result column="deptname" property="deptName" jdbcType="VARCHAR"/> | |
| 41 | + | |
| 42 | + </resultMap> | |
| 43 | + | |
| 13 | 44 | <insert id="addDoctorTeam" parameterType="com.lyms.platform.permission.model.DoctorTeam"> | 
| 14 | 45 | insert into doctor_team | 
| 15 | 46 | (team_name,org_id,created) | 
| 16 | 47 | |
| ... | ... | @@ -71,11 +102,76 @@ | 
| 71 | 102 | <include refid="DoctorTeamLimit"/> | 
| 72 | 103 | </select> | 
| 73 | 104 | |
| 74 | - <select id="queryListDoctorTeamCount" resultType="int" parameterType="com.lyms.platform.permission.model.DoctorTeam"> | |
| 105 | + <select id="queryListDoctorTeamCount" resultType="int" parameterType="com.lyms.platform.permission.model.UsersQuery"> | |
| 75 | 106 | select count(DISTINCT id) | 
| 76 | 107 | from doctor_team | 
| 77 | 108 | <include refid="DoctorTeamCondition"/> | 
| 78 | 109 | </select> | 
| 79 | 110 | |
| 111 | + <sql id="DoctorLimit"> | |
| 112 | + <if test="sort != null and sort != '' "> | |
| 113 | + order by ${sort} | |
| 114 | + <if test="need != null and need != ''"> | |
| 115 | + limit #{offset, jdbcType=INTEGER} , #{limit, jdbcType=INTEGER} | |
| 116 | + </if> | |
| 117 | + </if> | |
| 118 | + </sql> | |
| 119 | + | |
| 120 | + | |
| 121 | + <sql id="DoctorCondition"> | |
| 122 | + <where> | |
| 123 | + 1 = 1 | |
| 124 | + <if test="id != null and id >= 0"> | |
| 125 | + and u.id = #{id,jdbcType=INTEGER} | |
| 126 | + </if> | |
| 127 | + | |
| 128 | + <if test="orgId != null and orgId >= 0"> | |
| 129 | + and u.org_id = #{orgId,jdbcType=INTEGER} | |
| 130 | + </if> | |
| 131 | + | |
| 132 | + <if test="name != null and name != ''"> | |
| 133 | + and u.name = #{teamName,jdbcType=VARCHAR} | |
| 134 | + </if> | |
| 135 | + | |
| 136 | + <if test="deptId != null and deptId >= 0"> | |
| 137 | + and u.dept_id = #{deptId,jdbcType=INTEGER} | |
| 138 | + </if> | |
| 139 | + | |
| 140 | + <if test="doctorTeamId != null and doctorTeamId >= 0"> | |
| 141 | + and u.doctorTeam_id = #{doctorTeamId,jdbcType=INTEGER} | |
| 142 | + </if> | |
| 143 | + </where> | |
| 144 | + </sql> | |
| 145 | + | |
| 146 | + <select id="queryListDoctor" resultMap="UsersResultMap" parameterType="com.lyms.platform.permission.model.UsersQuery"> | |
| 147 | + select | |
| 148 | + u.id,u.org_id,u.dept_id,u.name,u.phone,u.created,u.remarks,u.doctorTeam_id, | |
| 149 | + o.name as orgname,d.team_name as teamname,dp.name as deptname | |
| 150 | + from users u | |
| 151 | + left join organization o on u.org_id=o.id | |
| 152 | + left join doctor_team d on u.doctorTeam_id=d.id | |
| 153 | + left join departments dp on u.dept_id=dp.id | |
| 154 | + <include refid="DoctorCondition"/> | |
| 155 | + <include refid="DoctorLimit"/> | |
| 156 | + </select> | |
| 157 | + | |
| 158 | + <select id="queryListDoctorCount" resultType="int" parameterType="com.lyms.platform.permission.model.UsersQuery"> | |
| 159 | + select count(DISTINCT u.id) | |
| 160 | + from users u | |
| 161 | + left join organization o on u.org_id=o.id | |
| 162 | + left join doctor_team d on u.doctorTeam_id=d.id | |
| 163 | + left join departments dp on u.dept_id=dp.id | |
| 164 | + <include refid="DoctorCondition"/> | |
| 165 | + </select> | |
| 166 | + | |
| 167 | + <update id="allotDoctorTeam" parameterType="com.lyms.platform.permission.model.Users"> | |
| 168 | + update users | |
| 169 | + <set> | |
| 170 | + <if test="doctorTeamId != null and doctorTeamId >=0 "> | |
| 171 | + doctorTeam_id = #{doctorTeamId,jdbcType=VARCHAR} | |
| 172 | + </if> | |
| 173 | + </set> | |
| 174 | + where id = #{id,jdbcType=INTEGER} | |
| 175 | + </update> | |
| 80 | 176 | </mapper> | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TeamController.java
View file @
da9254a
| ... | ... | @@ -11,6 +11,8 @@ | 
| 11 | 11 | import com.lyms.platform.operate.web.service.PatientWeightService; | 
| 12 | 12 | import com.lyms.platform.operate.web.service.TeamService; | 
| 13 | 13 | import com.lyms.platform.permission.model.DoctorTeam; | 
| 14 | +import com.lyms.platform.permission.model.Users; | |
| 15 | +import com.lyms.platform.permission.model.UsersQuery; | |
| 14 | 16 | import com.lyms.platform.permission.service.UsersService; | 
| 15 | 17 | import org.springframework.beans.factory.annotation.Autowired; | 
| 16 | 18 | import org.springframework.stereotype.Controller; | 
| ... | ... | @@ -160,5 +162,30 @@ | 
| 160 | 162 | return teamService.queryListDoctorTeam(doctorTeam); | 
| 161 | 163 | } | 
| 162 | 164 | |
| 165 | + /** | |
| 166 | + *医生列表 | |
| 167 | + * @param usersQuery | |
| 168 | + * @return | |
| 169 | + */ | |
| 170 | + @RequestMapping(value = "/queryListDoctor", method = RequestMethod.GET) | |
| 171 | + @ResponseBody | |
| 172 | + @TokenRequired | |
| 173 | + public FrontEndResult queryListDoctor(UsersQuery usersQuery) { | |
| 174 | + return teamService.queryListDoctor(usersQuery); | |
| 175 | + } | |
| 176 | + | |
| 177 | + /** | |
| 178 | + * 分配团队医生 | |
| 179 | + * @param | |
| 180 | + * @return | |
| 181 | + */ | |
| 182 | + @RequestMapping(value = "/allotDoctorTeam", method = RequestMethod.POST) | |
| 183 | + @ResponseBody | |
| 184 | + @TokenRequired | |
| 185 | + public BaseResponse allotDoctorTeam(@RequestBody Users users, HttpServletRequest request, HttpServletResponse response) { | |
| 186 | + BaseResponse baseResponse=new BaseResponse(); | |
| 187 | + baseResponse=teamService.allotDoctorTeam(users); | |
| 188 | + return baseResponse; | |
| 189 | + } | |
| 163 | 190 | } | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/TeamService.java
View file @
da9254a
| ... | ... | @@ -5,6 +5,8 @@ | 
| 5 | 5 | import com.lyms.platform.operate.web.request.TeamModelRequest; | 
| 6 | 6 | import com.lyms.platform.operate.web.result.FrontEndResult; | 
| 7 | 7 | import com.lyms.platform.permission.model.DoctorTeam; | 
| 8 | +import com.lyms.platform.permission.model.Users; | |
| 9 | +import com.lyms.platform.permission.model.UsersQuery; | |
| 8 | 10 | |
| 9 | 11 | /** | 
| 10 | 12 | * Created by cpf on 2021-10-15 15:25:13 | 
| ... | ... | @@ -29,5 +31,9 @@ | 
| 29 | 31 | BaseResponse delDoctorTeam(Integer id); | 
| 30 | 32 | |
| 31 | 33 | FrontEndResult queryListDoctorTeam(DoctorTeam doctorTeam); | 
| 34 | + | |
| 35 | + FrontEndResult queryListDoctor(UsersQuery usersQuery); | |
| 36 | + | |
| 37 | + BaseResponse allotDoctorTeam(Users users); | |
| 32 | 38 | } | 
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TeamServiceImpl.java
View file @
da9254a
| ... | ... | @@ -277,6 +277,38 @@ | 
| 277 | 277 | return frontEndResult; | 
| 278 | 278 | } | 
| 279 | 279 | |
| 280 | + @Override | |
| 281 | + public FrontEndResult queryListDoctor(UsersQuery usersQuery) { | |
| 282 | + FrontEndResult frontEndResult = new FrontEndResult(); | |
| 283 | + try { | |
| 284 | + usersQuery.setNeed("true"); | |
| 285 | + usersQuery.setSort("created desc"); | |
| 286 | + usersQuery.mysqlBuild(doctorTeamMapper.queryListDoctorCount(usersQuery)); | |
| 287 | + List<UsersQuery> queryListDoctor = doctorTeamMapper.queryListDoctor(usersQuery); | |
| 288 | + frontEndResult.setPageInfo(usersQuery.getPageInfo()); | |
| 289 | + frontEndResult.setData(queryListDoctor); | |
| 290 | + frontEndResult.setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 291 | + } catch (Exception e) { | |
| 292 | + e.printStackTrace(); | |
| 293 | + frontEndResult.setErrormsg(ErrorCodeConstants.SYSTEM_ERROR_DESCRIPTION).setErrorcode(ErrorCodeConstants.SYSTEM_ERROR).setObject(e.getMessage()); | |
| 294 | + } | |
| 295 | + return frontEndResult; | |
| 296 | + } | |
| 297 | + | |
| 298 | + @Override | |
| 299 | + public BaseResponse allotDoctorTeam(Users users) { | |
| 300 | + BaseResponse baseResponse=new BaseResponse(); | |
| 301 | + int result= 0; | |
| 302 | + try { | |
| 303 | + result = doctorTeamMapper.allotDoctorTeam(users); | |
| 304 | + baseResponse.setErrormsg("成功").setErrorcode(result); | |
| 305 | + } catch (Exception e) { | |
| 306 | + e.printStackTrace(); | |
| 307 | + baseResponse.setErrormsg("失败").setErrorcode(result).setObject(e.getMessage()); | |
| 308 | + } | |
| 309 | + return baseResponse; | |
| 310 | + } | |
| 311 | + | |
| 280 | 312 | |
| 281 | 313 | } |