Commit 27de58e4c05736ad285870125d5b33f7570f98b6
1 parent
25396fcdd4
Exists in
master
and in
6 other branches
秦皇岛一贯制团队管理
Showing 7 changed files with 257 additions and 17 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/DoctorTeam.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/Users.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 @
27de58e
1 | +package com.lyms.platform.permission.dao.master; | |
2 | + | |
3 | +import com.lyms.platform.biz.dal.IbabySieveDao; | |
4 | +import com.lyms.platform.permission.model.DoctorTeam; | |
5 | + | |
6 | +import java.util.List; | |
7 | + | |
8 | +public interface DoctorTeamMapper { | |
9 | + | |
10 | + | |
11 | + int addDoctorTeam(DoctorTeam doctorTeam); | |
12 | + | |
13 | + int updateDoctorTeam(DoctorTeam doctorTeam); | |
14 | + | |
15 | + int delDoctorTeam(Integer id); | |
16 | + | |
17 | + List<DoctorTeam> queryListDoctorTeam(DoctorTeam doctorTeam); | |
18 | + | |
19 | + int queryListDoctorTeamCount(DoctorTeam doctorTeam); | |
20 | +} |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/DoctorTeam.java
View file @
27de58e
1 | +package com.lyms.platform.permission.model; | |
2 | + | |
3 | +import com.lyms.platform.common.dao.BaseQuery; | |
4 | + | |
5 | +import java.util.Date; | |
6 | +import java.util.List; | |
7 | + | |
8 | +//医生团队 | |
9 | +public class DoctorTeam extends BaseQuery { | |
10 | + private Integer id; | |
11 | + //团队名称 | |
12 | + private String teamName; | |
13 | + //机构id | |
14 | + private Integer orgId; | |
15 | + //创建时间 | |
16 | + private Date created; | |
17 | + | |
18 | + public Date getCreated() { | |
19 | + return created; | |
20 | + } | |
21 | + | |
22 | + public void setCreated(Date created) { | |
23 | + this.created = created; | |
24 | + } | |
25 | + | |
26 | + public Integer getId() { | |
27 | + return id; | |
28 | + } | |
29 | + | |
30 | + public void setId(Integer id) { | |
31 | + this.id = id; | |
32 | + } | |
33 | + | |
34 | + public String getTeamName() { | |
35 | + return teamName; | |
36 | + } | |
37 | + | |
38 | + public void setTeamName(String teamName) { | |
39 | + this.teamName = teamName; | |
40 | + } | |
41 | + | |
42 | + public Integer getOrgId() { | |
43 | + return orgId; | |
44 | + } | |
45 | + | |
46 | + public void setOrgId(Integer orgId) { | |
47 | + this.orgId = orgId; | |
48 | + } | |
49 | + | |
50 | +} |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/Users.java
View file @
27de58e
... | ... | @@ -32,6 +32,16 @@ |
32 | 32 | |
33 | 33 | //默认页面 |
34 | 34 | private String defaultPage; |
35 | + //秦皇岛需求医生团队 | |
36 | + private Integer doctorTeamId; | |
37 | + | |
38 | + public Integer getDoctorTeamId() { | |
39 | + return doctorTeamId; | |
40 | + } | |
41 | + | |
42 | + public void setDoctorTeamId(Integer doctorTeamId) { | |
43 | + this.doctorTeamId = doctorTeamId; | |
44 | + } | |
35 | 45 | |
36 | 46 | public String getDefaultPage() { |
37 | 47 | return defaultPage; |
platform-biz-service/src/main/resources/mainOrm/master/DoctorTeamMapper.xml
View file @
27de58e
1 | +<?xml version="1.0" encoding="UTF-8" ?> | |
2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > | |
3 | +<mapper namespace="com.lyms.platform.permission.dao.master.DoctorTeamMapper"> | |
4 | + | |
5 | + <resultMap id="DoctorTeamResultMap" type="com.lyms.platform.permission.model.DoctorTeam"> | |
6 | + <id column="id" property="id" jdbcType="INTEGER"/> | |
7 | + <result column="team_name" property="teamName" jdbcType="VARCHAR"/> | |
8 | + <result column="org_id" property="orgId" jdbcType="INTEGER"/> | |
9 | + <result column="created" property="created" jdbcType="TIMESTAMP"/> | |
10 | + </resultMap> | |
11 | + | |
12 | + <insert id="addDoctorTeam" parameterType="com.lyms.platform.permission.model.DoctorTeam"> | |
13 | + insert into doctor_team | |
14 | + (team_name,org_id,created) | |
15 | + values | |
16 | + (#{teamName},#{orgId},#{created}) | |
17 | + </insert> | |
18 | + | |
19 | + | |
20 | + <update id="updateDoctorTeam" parameterType="com.lyms.platform.permission.model.DoctorTeam"> | |
21 | + update doctor_team | |
22 | + <set> | |
23 | + <if test="teamName != null and teamName != ''"> | |
24 | + team_name = #{teamName,jdbcType=VARCHAR} | |
25 | + </if> | |
26 | + </set> | |
27 | + where id = #{id,jdbcType=INTEGER} | |
28 | + </update> | |
29 | + | |
30 | + | |
31 | + <delete id="delDoctorTeam" parameterType="java.lang.Integer"> | |
32 | +delete from doctor_team where id = #{id,jdbcType=INTEGER} | |
33 | +</delete> | |
34 | + | |
35 | + | |
36 | + | |
37 | + <sql id="DoctorTeamLimit"> | |
38 | + <if test="sort != null and sort != '' "> | |
39 | + order by ${sort} | |
40 | + <if test="need != null and need != ''"> | |
41 | + limit #{offset, jdbcType=INTEGER} , #{limit, jdbcType=INTEGER} | |
42 | + </if> | |
43 | + </if> | |
44 | + </sql> | |
45 | + | |
46 | + | |
47 | + <sql id="DoctorTeamCondition"> | |
48 | + <where> | |
49 | + 1 = 1 | |
50 | + <if test="id != null and id >= 0"> | |
51 | + and id = #{id,jdbcType=INTEGER} | |
52 | + </if> | |
53 | + | |
54 | + <if test="orgId != null and orgId >= 0"> | |
55 | + and org_id = #{orgId,jdbcType=INTEGER} | |
56 | + </if> | |
57 | + | |
58 | + <if test="teamName != null and teamName != ''"> | |
59 | + and team_name = #{teamName,jdbcType=VARCHAR} | |
60 | + </if> | |
61 | + </where> | |
62 | + </sql> | |
63 | + | |
64 | + | |
65 | + <select id="queryListDoctorTeam" resultMap="DoctorTeamResultMap" parameterType="com.lyms.platform.permission.model.DoctorTeam"> | |
66 | + select | |
67 | + id,team_name,org_id,created | |
68 | + from doctor_team | |
69 | + <include refid="DoctorTeamCondition"/> | |
70 | + <include refid="DoctorTeamLimit"/> | |
71 | + </select> | |
72 | + | |
73 | + <select id="queryListDoctorTeamCount" resultType="int" parameterType="com.lyms.platform.permission.model.DoctorTeam"> | |
74 | + select count(DISTINCT id) | |
75 | + from doctor_team | |
76 | + <include refid="DoctorTeamCondition"/> | |
77 | + </select> | |
78 | + | |
79 | +</mapper> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/TeamController.java
View file @
27de58e
... | ... | @@ -7,11 +7,11 @@ |
7 | 7 | import com.lyms.platform.operate.web.facade.AutoMatchFacade; |
8 | 8 | import com.lyms.platform.operate.web.facade.BabyHealthFacade; |
9 | 9 | import com.lyms.platform.operate.web.request.TeamModelRequest; |
10 | +import com.lyms.platform.operate.web.result.FrontEndResult; | |
10 | 11 | import com.lyms.platform.operate.web.service.PatientWeightService; |
11 | 12 | import com.lyms.platform.operate.web.service.TeamService; |
12 | -import com.lyms.platform.permission.service.CouponService; | |
13 | +import com.lyms.platform.permission.model.DoctorTeam; | |
13 | 14 | import com.lyms.platform.permission.service.UsersService; |
14 | -import com.lyms.platform.pojo.TeamModel; | |
15 | 15 | import org.springframework.beans.factory.annotation.Autowired; |
16 | 16 | import org.springframework.stereotype.Controller; |
17 | 17 | import org.springframework.web.bind.annotation.*; |
18 | 18 | |
19 | 19 | |
20 | 20 | |
21 | 21 | |
... | ... | @@ -122,19 +122,42 @@ |
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
125 | - * 根据医生ID获取团队信息 | |
126 | - * @param docId | |
127 | - * @param request | |
128 | - * @param response | |
125 | + * 添加/修改团队 | |
126 | + * @param | |
129 | 127 | * @return |
130 | 128 | */ |
131 | - @RequestMapping(value = "/getTeamByDocId", method = RequestMethod.GET) | |
129 | + @RequestMapping(value = "/addOrUpDoctorTeam", method = RequestMethod.POST) | |
132 | 130 | @ResponseBody |
133 | 131 | @TokenRequired |
134 | - public BaseResponse getTeamByDocId(String docId,HttpServletRequest request, HttpServletResponse response) { | |
132 | + public BaseResponse addOrUpDoctorTeam(@RequestBody DoctorTeam doctorTeam, HttpServletRequest request, HttpServletResponse response) { | |
135 | 133 | BaseResponse baseResponse=new BaseResponse(); |
136 | - baseResponse=teamService.getTeamByDocId(docId); | |
134 | + baseResponse=teamService.addOrUpDoctorTeam(doctorTeam); | |
137 | 135 | return baseResponse; |
136 | + } | |
137 | + /** | |
138 | + * 删除团队 | |
139 | + * @param | |
140 | + * @return | |
141 | + */ | |
142 | + @RequestMapping(value = "/delDoctorTeam", method = RequestMethod.DELETE) | |
143 | + @ResponseBody | |
144 | + @TokenRequired | |
145 | + public BaseResponse delDoctorTeam(Integer id, HttpServletRequest request, HttpServletResponse response) { | |
146 | + BaseResponse baseResponse=new BaseResponse(); | |
147 | + baseResponse=teamService.delDoctorTeam(id); | |
148 | + return baseResponse; | |
149 | + } | |
150 | + | |
151 | + /** | |
152 | + *团队列表 | |
153 | + * @param doctorTeam | |
154 | + * @return | |
155 | + */ | |
156 | + @RequestMapping(value = "/queryListDoctorTeam", method = RequestMethod.GET) | |
157 | + @ResponseBody | |
158 | + @TokenRequired | |
159 | + public FrontEndResult queryListDoctorTeam(@RequestBody DoctorTeam doctorTeam) { | |
160 | + return teamService.queryListDoctorTeam(doctorTeam); | |
138 | 161 | } |
139 | 162 | |
140 | 163 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/TeamService.java
View file @
27de58e
... | ... | @@ -3,14 +3,9 @@ |
3 | 3 | import com.lyms.platform.common.result.BaseObjectResponse; |
4 | 4 | import com.lyms.platform.common.result.BaseResponse; |
5 | 5 | import com.lyms.platform.operate.web.request.TeamModelRequest; |
6 | -import com.lyms.platform.pojo.PatientWeight; | |
7 | -import com.lyms.platform.pojo.Patients; | |
8 | -import com.lyms.platform.pojo.WeightConfigModel; | |
6 | +import com.lyms.platform.operate.web.result.FrontEndResult; | |
7 | +import com.lyms.platform.permission.model.DoctorTeam; | |
9 | 8 | |
10 | -import java.util.Date; | |
11 | -import java.util.List; | |
12 | -import java.util.Map; | |
13 | - | |
14 | 9 | /** |
15 | 10 | * Created by cpf on 2021-10-15 15:25:13 |
16 | 11 | */ |
... | ... | @@ -28,5 +23,11 @@ |
28 | 23 | BaseResponse teamNonDocList(String teamId, String hospitalId); |
29 | 24 | |
30 | 25 | BaseObjectResponse getTeamByDocId(String docId); |
26 | + | |
27 | + BaseResponse addOrUpDoctorTeam(DoctorTeam doctorTeam); | |
28 | + | |
29 | + BaseResponse delDoctorTeam(Integer id); | |
30 | + | |
31 | + FrontEndResult queryListDoctorTeam(DoctorTeam doctorTeam); | |
31 | 32 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/TeamServiceImpl.java
View file @
27de58e
... | ... | @@ -2,16 +2,19 @@ |
2 | 2 | |
3 | 3 | import com.alibaba.fastjson.JSONObject; |
4 | 4 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
5 | +import com.lyms.platform.common.enums.YnEnums; | |
5 | 6 | import com.lyms.platform.common.result.BaseObjectResponse; |
6 | 7 | import com.lyms.platform.common.result.BaseResponse; |
7 | 8 | import com.lyms.platform.common.result.PageResult; |
8 | 9 | import com.lyms.platform.common.result.RespBuilder; |
9 | 10 | import com.lyms.platform.operate.web.request.TeamModelRequest; |
11 | +import com.lyms.platform.operate.web.result.FrontEndResult; | |
10 | 12 | import com.lyms.platform.operate.web.service.TeamService; |
13 | +import com.lyms.platform.permission.dao.master.DoctorTeamMapper; | |
11 | 14 | import com.lyms.platform.permission.model.Users; |
12 | 15 | import com.lyms.platform.permission.model.UsersQuery; |
16 | +import com.lyms.platform.permission.model.DoctorTeam; | |
13 | 17 | import com.lyms.platform.permission.service.UsersService; |
14 | -import com.lyms.platform.pojo.BabyEyeCheck; | |
15 | 18 | import com.lyms.platform.pojo.TeamModel; |
16 | 19 | import org.apache.commons.lang3.StringUtils; |
17 | 20 | import org.springframework.beans.BeanUtils; |
18 | 21 | |
... | ... | @@ -32,7 +35,10 @@ |
32 | 35 | @Autowired |
33 | 36 | private MongoTemplate mongoTemplate; |
34 | 37 | |
38 | + @Autowired | |
39 | + private DoctorTeamMapper doctorTeamMapper; | |
35 | 40 | |
41 | + | |
36 | 42 | @Override |
37 | 43 | public PageResult findPage(String sql, Integer currentPage, Integer pageSize, List<Object> params) { |
38 | 44 | return null; |
... | ... | @@ -218,6 +224,57 @@ |
218 | 224 | |
219 | 225 | return new BaseObjectResponse() |
220 | 226 | .setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS).setData(tLst.size()>0?tLst.get(0):null); |
227 | + } | |
228 | + | |
229 | + @Override | |
230 | + public BaseResponse addOrUpDoctorTeam(DoctorTeam doctorTeam) { | |
231 | + BaseResponse baseResponse=new BaseResponse(); | |
232 | + int result= 0; | |
233 | + try { | |
234 | + if(null==doctorTeam.getId()) {//新增 | |
235 | + result = doctorTeamMapper.addDoctorTeam(doctorTeam); | |
236 | + baseResponse.setErrormsg("成功").setErrorcode(result); | |
237 | + }else {//修改 | |
238 | + result = doctorTeamMapper.updateDoctorTeam(doctorTeam); | |
239 | + baseResponse.setErrormsg("成功").setErrorcode(result); | |
240 | + } | |
241 | + } catch (Exception e) { | |
242 | + e.printStackTrace(); | |
243 | + baseResponse.setErrormsg("失败").setErrorcode(result).setObject(e.getMessage()); | |
244 | + } | |
245 | + return baseResponse; | |
246 | + } | |
247 | + | |
248 | + @Override | |
249 | + public BaseResponse delDoctorTeam(Integer id) { | |
250 | + BaseResponse baseResponse=new BaseResponse(); | |
251 | + int result= 0; | |
252 | + try { | |
253 | + result = doctorTeamMapper.delDoctorTeam(id); | |
254 | + baseResponse.setErrormsg("成功").setErrorcode(result); | |
255 | + } catch (Exception e) { | |
256 | + e.printStackTrace(); | |
257 | + baseResponse.setErrormsg("失败").setErrorcode(result).setObject(e.getMessage()); | |
258 | + } | |
259 | + return baseResponse; | |
260 | + } | |
261 | + | |
262 | + @Override | |
263 | + public FrontEndResult queryListDoctorTeam(DoctorTeam doctorTeam) { | |
264 | + FrontEndResult frontEndResult = new FrontEndResult(); | |
265 | + try { | |
266 | + doctorTeam.setNeed("true"); | |
267 | + doctorTeam.setSort("created desc"); | |
268 | + doctorTeam.mysqlBuild(doctorTeamMapper.queryListDoctorTeamCount(doctorTeam)); | |
269 | + List<DoctorTeam> doctorTeamList = doctorTeamMapper.queryListDoctorTeam(doctorTeam); | |
270 | + frontEndResult.setPageInfo(doctorTeam.getPageInfo()); | |
271 | + frontEndResult.setData(doctorTeamList); | |
272 | + frontEndResult.setErrormsg("成功").setErrorcode(ErrorCodeConstants.SUCCESS); | |
273 | + } catch (Exception e) { | |
274 | + e.printStackTrace(); | |
275 | + frontEndResult.setErrormsg(ErrorCodeConstants.SYSTEM_ERROR_DESCRIPTION).setErrorcode(ErrorCodeConstants.SYSTEM_ERROR).setObject(e.getMessage()); | |
276 | + } | |
277 | + return frontEndResult; | |
221 | 278 | } |
222 | 279 | |
223 | 280 |