Commit 888312130d9a34351233104fe30c7e6c0bb53144
1 parent
7bf2041b65
Exists in
luanping
and in
1 other branch
#优化秦皇岛二院高危因素检查项配置,新增流程步骤配置项
Showing 17 changed files with 450 additions and 110 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/FactorProjectMapper.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/ProjectWayMapper.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/FactorProject.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/FactorProjectEntity.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/FactorProjectManage.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/ProjectWay.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/ProjectWayQuery.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/CheckItemService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/FactorProjectService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/ProjectWayService.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/CheckItemServiceImpl.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/FactorProjectServiceImpl.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/ProjectWayServiceImpl.java
- platform-biz-service/src/main/resources/mainOrm/master/FactorProjectMapper.xml
- platform-biz-service/src/main/resources/mainOrm/master/ProjectWayMapper.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FactorProjectController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/FactorProjectMapper.java
View file @
8883121
| ... | ... | @@ -2,15 +2,18 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.permission.model.FactorProject; |
| 4 | 4 | import com.lyms.platform.permission.model.FactorProjectQuery; |
| 5 | +import org.apache.ibatis.annotations.Param; | |
| 5 | 6 | |
| 6 | 7 | import java.util.List; |
| 7 | 8 | |
| 8 | 9 | public interface FactorProjectMapper { |
| 9 | 10 | List<FactorProject> getList(FactorProjectQuery factorProjectQuery); |
| 11 | + List<FactorProject> selectList(@Param("hospitalId")Integer hospitalId, @Param("week")String week); | |
| 10 | 12 | int queryFactorProjectCount(FactorProjectQuery factorProjectQuery); |
| 11 | 13 | void add(FactorProject factorProject); |
| 12 | 14 | void update(FactorProject factorProject); |
| 13 | 15 | void del(Integer id); |
| 14 | 16 | FactorProject selectById(Integer id); |
| 17 | + FactorProject selectInfo(Integer id); | |
| 15 | 18 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/dao/master/ProjectWayMapper.java
View file @
8883121
| 1 | +package com.lyms.platform.permission.dao.master; | |
| 2 | + | |
| 3 | +import com.lyms.platform.permission.model.ProjectWay; | |
| 4 | + | |
| 5 | +import java.util.List; | |
| 6 | + | |
| 7 | +public interface ProjectWayMapper { | |
| 8 | + List<ProjectWay> getList(List<Integer> ids); | |
| 9 | + void add(ProjectWay factorProject); | |
| 10 | + void update(ProjectWay factorProject); | |
| 11 | + void del(List<Integer> ids); | |
| 12 | + ProjectWay selectById(Integer id); | |
| 13 | + void insertBatch(List<ProjectWay> list); | |
| 14 | +} |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/FactorProject.java
View file @
8883121
| 1 | 1 | package com.lyms.platform.permission.model; |
| 2 | 2 | |
| 3 | +import org.springframework.data.annotation.Transient; | |
| 4 | + | |
| 3 | 5 | import java.util.Date; |
| 6 | +import java.util.List; | |
| 4 | 7 | |
| 5 | 8 | public class FactorProject { |
| 6 | 9 | private Integer id; |
| 7 | 10 | private String riskFactorIds; |
| 8 | 11 | private String riskFactorName; |
| 9 | - private String weekProjectId; | |
| 10 | 12 | private String week; |
| 11 | 13 | private Integer hospitalId; |
| 12 | 14 | private Date created; |
| 15 | + @Transient | |
| 16 | + private List<ProjectWay> wayList; | |
| 13 | 17 | |
| 14 | 18 | public Integer getId() { |
| 15 | 19 | return id; |
| ... | ... | @@ -35,14 +39,6 @@ |
| 35 | 39 | this.riskFactorName = riskFactorName; |
| 36 | 40 | } |
| 37 | 41 | |
| 38 | - public String getWeekProjectId() { | |
| 39 | - return weekProjectId; | |
| 40 | - } | |
| 41 | - | |
| 42 | - public void setWeekProjectId(String weekProjectId) { | |
| 43 | - this.weekProjectId = weekProjectId; | |
| 44 | - } | |
| 45 | - | |
| 46 | 42 | public String getWeek() { |
| 47 | 43 | return week; |
| 48 | 44 | } |
| ... | ... | @@ -65,6 +61,14 @@ |
| 65 | 61 | |
| 66 | 62 | public void setCreated(Date created) { |
| 67 | 63 | this.created = created; |
| 64 | + } | |
| 65 | + | |
| 66 | + public List<ProjectWay> getWayList() { | |
| 67 | + return wayList; | |
| 68 | + } | |
| 69 | + | |
| 70 | + public void setWayList(List<ProjectWay> wayList) { | |
| 71 | + this.wayList = wayList; | |
| 68 | 72 | } |
| 69 | 73 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/FactorProjectEntity.java
View file @
8883121
| ... | ... | @@ -3,9 +3,10 @@ |
| 3 | 3 | import java.util.List; |
| 4 | 4 | |
| 5 | 5 | public class FactorProjectEntity { |
| 6 | + private List<String> riskFactorNames; | |
| 6 | 7 | private String week; |
| 7 | - private List<CheckItem> healthItemList; | |
| 8 | - private List<CheckItem> riskItemList; | |
| 8 | + private List<ProjectWay> healthItemList; | |
| 9 | + private List<ProjectWay> riskItemList; | |
| 9 | 10 | |
| 10 | 11 | public String getWeek() { |
| 11 | 12 | return week; |
| 12 | 13 | |
| 13 | 14 | |
| 14 | 15 | |
| 15 | 16 | |
| ... | ... | @@ -15,20 +16,28 @@ |
| 15 | 16 | this.week = week; |
| 16 | 17 | } |
| 17 | 18 | |
| 18 | - public List<CheckItem> getHealthItemList() { | |
| 19 | + public List<ProjectWay> getHealthItemList() { | |
| 19 | 20 | return healthItemList; |
| 20 | 21 | } |
| 21 | 22 | |
| 22 | - public void setHealthItemList(List<CheckItem> healthItemList) { | |
| 23 | + public void setHealthItemList(List<ProjectWay> healthItemList) { | |
| 23 | 24 | this.healthItemList = healthItemList; |
| 24 | 25 | } |
| 25 | 26 | |
| 26 | - public List<CheckItem> getRiskItemList() { | |
| 27 | + public List<ProjectWay> getRiskItemList() { | |
| 27 | 28 | return riskItemList; |
| 28 | 29 | } |
| 29 | 30 | |
| 30 | - public void setRiskItemList(List<CheckItem> riskItemList) { | |
| 31 | + public void setRiskItemList(List<ProjectWay> riskItemList) { | |
| 31 | 32 | this.riskItemList = riskItemList; |
| 33 | + } | |
| 34 | + | |
| 35 | + public List<String> getRiskFactorNames() { | |
| 36 | + return riskFactorNames; | |
| 37 | + } | |
| 38 | + | |
| 39 | + public void setRiskFactorNames(List<String> riskFactorNames) { | |
| 40 | + this.riskFactorNames = riskFactorNames; | |
| 32 | 41 | } |
| 33 | 42 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/FactorProjectManage.java
View file @
8883121
platform-biz-service/src/main/java/com/lyms/platform/permission/model/ProjectWay.java
View file @
8883121
| 1 | +package com.lyms.platform.permission.model; | |
| 2 | + | |
| 3 | +public class ProjectWay { | |
| 4 | + private Integer id; | |
| 5 | + private String weekProjectId; | |
| 6 | + private String way; | |
| 7 | + private String weekProjectName; | |
| 8 | + private Integer factorId; | |
| 9 | + private Integer sort; | |
| 10 | + | |
| 11 | + public Integer getId() { | |
| 12 | + return id; | |
| 13 | + } | |
| 14 | + | |
| 15 | + public void setId(Integer id) { | |
| 16 | + this.id = id; | |
| 17 | + } | |
| 18 | + | |
| 19 | + public String getWeekProjectId() { | |
| 20 | + return weekProjectId; | |
| 21 | + } | |
| 22 | + | |
| 23 | + public void setWeekProjectId(String weekProjectId) { | |
| 24 | + this.weekProjectId = weekProjectId; | |
| 25 | + } | |
| 26 | + | |
| 27 | + public String getWay() { | |
| 28 | + return way; | |
| 29 | + } | |
| 30 | + | |
| 31 | + public void setWay(String way) { | |
| 32 | + this.way = way; | |
| 33 | + } | |
| 34 | + | |
| 35 | + public Integer getSort() { | |
| 36 | + return sort; | |
| 37 | + } | |
| 38 | + | |
| 39 | + public void setSort(Integer sort) { | |
| 40 | + this.sort = sort; | |
| 41 | + } | |
| 42 | + | |
| 43 | + public String getWeekProjectName() { | |
| 44 | + return weekProjectName; | |
| 45 | + } | |
| 46 | + | |
| 47 | + public void setWeekProjectName(String weekProjectName) { | |
| 48 | + this.weekProjectName = weekProjectName; | |
| 49 | + } | |
| 50 | + | |
| 51 | + public Integer getFactorId() { | |
| 52 | + return factorId; | |
| 53 | + } | |
| 54 | + | |
| 55 | + public void setFactorId(Integer factorId) { | |
| 56 | + this.factorId = factorId; | |
| 57 | + } | |
| 58 | +} |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/ProjectWayQuery.java
View file @
8883121
| 1 | +package com.lyms.platform.permission.model; | |
| 2 | + | |
| 3 | +public class ProjectWayQuery { | |
| 4 | + private String week; | |
| 5 | + private Integer hospitalId; | |
| 6 | + | |
| 7 | + public String getWeek() { | |
| 8 | + return week; | |
| 9 | + } | |
| 10 | + | |
| 11 | + public void setWeek(String week) { | |
| 12 | + this.week = week; | |
| 13 | + } | |
| 14 | + | |
| 15 | + public Integer getHospitalId() { | |
| 16 | + return hospitalId; | |
| 17 | + } | |
| 18 | + | |
| 19 | + public void setHospitalId(Integer hospitalId) { | |
| 20 | + this.hospitalId = hospitalId; | |
| 21 | + } | |
| 22 | +} |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/CheckItemService.java
View file @
8883121
platform-biz-service/src/main/java/com/lyms/platform/permission/service/FactorProjectService.java
View file @
8883121
| ... | ... | @@ -2,7 +2,6 @@ |
| 2 | 2 | |
| 3 | 3 | import com.lyms.platform.permission.model.FactorProject; |
| 4 | 4 | import com.lyms.platform.permission.model.FactorProjectEntity; |
| 5 | -import com.lyms.platform.permission.model.FactorProjectManage; | |
| 6 | 5 | import com.lyms.platform.permission.model.FactorProjectQuery; |
| 7 | 6 | |
| 8 | 7 | import java.util.List; |
| ... | ... | @@ -13,7 +12,7 @@ |
| 13 | 12 | void update(FactorProject factorProject); |
| 14 | 13 | void del(Integer id); |
| 15 | 14 | FactorProject selectById(Integer id); |
| 16 | - FactorProjectManage selectInfo(Integer id); | |
| 17 | - FactorProjectEntity selectByWeek(FactorProjectQuery factorProjectQuery); | |
| 15 | + FactorProjectEntity selectByWeek(Integer hospitalId,String week); | |
| 16 | + FactorProject selectInfo(Integer id); | |
| 18 | 17 | } |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/ProjectWayService.java
View file @
8883121
| 1 | +package com.lyms.platform.permission.service; | |
| 2 | + | |
| 3 | +import com.lyms.platform.permission.model.ProjectWay; | |
| 4 | + | |
| 5 | +import java.util.List; | |
| 6 | + | |
| 7 | +public interface ProjectWayService { | |
| 8 | + List<ProjectWay> getList(List<Integer> ids); | |
| 9 | + void add(ProjectWay projectWay); | |
| 10 | + void update(ProjectWay projectWay); | |
| 11 | + void del(List<Integer> ids); | |
| 12 | + void insertBatch(List<ProjectWay> list); | |
| 13 | + ProjectWay selectById(Integer id); | |
| 14 | +} |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/CheckItemServiceImpl.java
View file @
8883121
| ... | ... | @@ -6,6 +6,7 @@ |
| 6 | 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | 7 | import org.springframework.stereotype.Service; |
| 8 | 8 | |
| 9 | +import java.util.ArrayList; | |
| 9 | 10 | import java.util.List; |
| 10 | 11 | import java.util.Map; |
| 11 | 12 | |
| ... | ... | @@ -37,8 +38,16 @@ |
| 37 | 38 | } |
| 38 | 39 | |
| 39 | 40 | @Override |
| 40 | - public List<CheckItem> selectByIds(List<Integer> list) { | |
| 41 | - return checkItemMapper.selectByIds(list); | |
| 41 | + public List<CheckItem> selectByIds(String[] list) { | |
| 42 | + if (list.length>0){ | |
| 43 | + List<Integer> ids=new ArrayList<>(); | |
| 44 | + for (int i = 0,j=list.length; i <j ; i++) { | |
| 45 | + Integer id= Integer.valueOf(list[i]); | |
| 46 | + ids.add(id); | |
| 47 | + } | |
| 48 | + return checkItemMapper.selectByIds(ids); | |
| 49 | + } | |
| 50 | + return null; | |
| 42 | 51 | } |
| 43 | 52 | |
| 44 | 53 | @Override |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/FactorProjectServiceImpl.java
View file @
8883121
| ... | ... | @@ -6,18 +6,22 @@ |
| 6 | 6 | import com.lyms.platform.permission.model.*; |
| 7 | 7 | import com.lyms.platform.permission.service.CheckItemService; |
| 8 | 8 | import com.lyms.platform.permission.service.FactorProjectService; |
| 9 | +import com.lyms.platform.permission.service.ProjectWayService; | |
| 9 | 10 | import org.apache.commons.collections.CollectionUtils; |
| 10 | 11 | import org.springframework.beans.factory.annotation.Autowired; |
| 11 | 12 | import org.springframework.stereotype.Service; |
| 12 | 13 | |
| 13 | 14 | import java.util.ArrayList; |
| 15 | +import java.util.Collections; | |
| 16 | +import java.util.Comparator; | |
| 14 | 17 | import java.util.List; |
| 18 | + | |
| 15 | 19 | @Service("factorProjectService") |
| 16 | 20 | public class FactorProjectServiceImpl implements FactorProjectService { |
| 17 | 21 | @Autowired |
| 18 | 22 | private FactorProjectMapper factorProjectMapper; |
| 19 | 23 | @Autowired |
| 20 | - private CheckItemService checkItemService; | |
| 24 | + private ProjectWayService projectWayService; | |
| 21 | 25 | |
| 22 | 26 | @Override |
| 23 | 27 | public List<FactorProject> getList(FactorProjectQuery factorProjectQuery) { |
| 24 | 28 | |
| 25 | 29 | |
| 26 | 30 | |
| ... | ... | @@ -27,19 +31,62 @@ |
| 27 | 31 | return factorProjectMapper.getList(factorProjectQuery); |
| 28 | 32 | } |
| 29 | 33 | |
| 34 | + | |
| 30 | 35 | @Override |
| 31 | 36 | public void add(FactorProject factorProject) { |
| 32 | - factorProjectMapper.add(factorProject); | |
| 37 | + List<ProjectWay> wayList = factorProject.getWayList(); | |
| 38 | + if (CollectionUtils.isNotEmpty(wayList)) { | |
| 39 | + factorProjectMapper.add(factorProject); | |
| 40 | + Integer id=factorProject.getId(); | |
| 41 | + Collections.sort(wayList, new Comparator<ProjectWay>() { | |
| 42 | + @Override | |
| 43 | + public int compare(ProjectWay o1, ProjectWay o2) { | |
| 44 | + Integer result = o1.getSort() - o2.getSort(); | |
| 45 | + if (result < 0) { | |
| 46 | + return -1; | |
| 47 | + } else { | |
| 48 | + return 1; | |
| 49 | + } | |
| 50 | + } | |
| 51 | + }); | |
| 52 | + for (int i = 0, j = wayList.size(); i < j; i++) { | |
| 53 | + ProjectWay projectWay = wayList.get(i); | |
| 54 | + projectWay.setFactorId(id); | |
| 55 | + } | |
| 56 | + projectWayService.insertBatch(wayList); | |
| 57 | + } | |
| 33 | 58 | } |
| 34 | 59 | |
| 35 | 60 | @Override |
| 36 | 61 | public void update(FactorProject factorProject) { |
| 37 | - factorProjectMapper.update(factorProject); | |
| 62 | + List<ProjectWay> wayList = factorProject.getWayList(); | |
| 63 | + if (CollectionUtils.isNotEmpty(wayList)) { | |
| 64 | + for (int i = 0, j = wayList.size(); i < j; i++) { | |
| 65 | + ProjectWay projectWay = wayList.get(i); | |
| 66 | + if (projectWay.getId() != null) { | |
| 67 | + projectWayService.update(projectWay); | |
| 68 | + } | |
| 69 | + } | |
| 70 | + factorProjectMapper.update(factorProject); | |
| 71 | + } | |
| 72 | + | |
| 38 | 73 | } |
| 39 | 74 | |
| 40 | 75 | @Override |
| 41 | 76 | public void del(Integer id) { |
| 42 | - factorProjectMapper.del(id); | |
| 77 | + FactorProject factorProject= selectInfo(id); | |
| 78 | + if (factorProject!=null){ | |
| 79 | + List<ProjectWay> wayList= factorProject.getWayList(); | |
| 80 | + if (CollectionUtils.isNotEmpty(wayList)){ | |
| 81 | + List<Integer> ids=new ArrayList<>(); | |
| 82 | + for (int i = 0,j=wayList.size(); i < j; i++) { | |
| 83 | + ProjectWay projectWay= wayList.get(i); | |
| 84 | + ids.add(projectWay.getId()); | |
| 85 | + } | |
| 86 | + projectWayService.del(ids); | |
| 87 | + factorProjectMapper.del(id); | |
| 88 | + } | |
| 89 | + } | |
| 43 | 90 | } |
| 44 | 91 | |
| 45 | 92 | @Override |
| 46 | 93 | |
| 47 | 94 | |
| ... | ... | @@ -48,63 +95,36 @@ |
| 48 | 95 | } |
| 49 | 96 | |
| 50 | 97 | @Override |
| 51 | - public FactorProjectManage selectInfo(Integer id) { | |
| 52 | - FactorProject factorProject= factorProjectMapper.selectById(id); | |
| 53 | - if (factorProject!=null){ | |
| 54 | - FactorProjectManage factorProjectManage=new FactorProjectManage(); | |
| 55 | - factorProjectManage.setId(id); | |
| 56 | - factorProjectManage.setRiskFactorName(factorProject.getRiskFactorName()); | |
| 57 | - factorProjectManage.setWeek(factorProject.getWeek()); | |
| 58 | - String weekProjectIds= factorProject.getWeekProjectId(); | |
| 59 | - if (StringUtils.isNotEmpty(weekProjectIds)){ | |
| 60 | - String [] ids= weekProjectIds.split(","); | |
| 61 | - if (ids.length>0){ | |
| 62 | - List<Integer> list=new ArrayList<>(); | |
| 63 | - for (int i = 0,j=ids.length; i < j ; i++) { | |
| 64 | - Integer projectId= Integer.valueOf(ids[i]); | |
| 65 | - list.add(projectId); | |
| 66 | - } | |
| 67 | - List<CheckItem> checkItemList= checkItemService.selectByIds(list); | |
| 68 | - factorProjectManage.setCheckItemList(checkItemList); | |
| 69 | - } | |
| 70 | - } | |
| 71 | - return factorProjectManage; | |
| 72 | - } | |
| 73 | - return null; | |
| 98 | + public FactorProject selectInfo(Integer id) { | |
| 99 | + return factorProjectMapper.selectInfo(id); | |
| 74 | 100 | } |
| 75 | 101 | |
| 76 | 102 | @Override |
| 77 | - public FactorProjectEntity selectByWeek(FactorProjectQuery factorProjectQuery) { | |
| 78 | - List<FactorProject> projectList= factorProjectMapper.getList(factorProjectQuery); | |
| 79 | - if (CollectionUtils.isNotEmpty(projectList)){ | |
| 80 | - FactorProjectEntity factorProjectManage=new FactorProjectEntity(); | |
| 81 | - factorProjectManage.setWeek(factorProjectQuery.getWeek()); | |
| 82 | - List<Integer> healthList = new ArrayList<>(); | |
| 83 | - List<Integer> riskList = new ArrayList<>(); | |
| 84 | - for (int i = 0,j=projectList.size(); i < j; i++) { | |
| 85 | - FactorProject factorProject= projectList.get(i); | |
| 86 | - String weekProjectIds= factorProject.getWeekProjectId(); | |
| 87 | - String [] ids= weekProjectIds.split(","); | |
| 88 | - if (ids.length>0) { | |
| 89 | - if ("健康".equals(factorProject.getRiskFactorName())){ | |
| 90 | - for (int a = 0, b = ids.length; a < b; a++) { | |
| 91 | - Integer projectId = Integer.valueOf(ids[a]); | |
| 92 | - healthList.add(projectId); | |
| 93 | - } | |
| 94 | - }else { | |
| 95 | - for (int a = 0, b = ids.length; a < b; a++) { | |
| 96 | - Integer projectId = Integer.valueOf(ids[a]); | |
| 97 | - riskList.add(projectId); | |
| 98 | - } | |
| 103 | + public FactorProjectEntity selectByWeek(Integer hospitalId,String week) { | |
| 104 | + List<FactorProject> projectList = factorProjectMapper.selectList(hospitalId,week); | |
| 105 | + if (CollectionUtils.isNotEmpty(projectList)) { | |
| 106 | + FactorProjectEntity factorProjectManage = new FactorProjectEntity(); | |
| 107 | + factorProjectManage.setWeek(week); | |
| 108 | + List<ProjectWay> healthList = new ArrayList<>(); | |
| 109 | + List<ProjectWay> riskList = new ArrayList<>(); | |
| 110 | + List<String> riskFactorNames = new ArrayList<>(); | |
| 111 | + for (int i = 0, j = projectList.size(); i < j; i++) { | |
| 112 | + FactorProject factorProject = projectList.get(i); | |
| 113 | + String riskFactorName = factorProject.getRiskFactorName(); | |
| 114 | + List<ProjectWay> wayList = factorProject.getWayList(); | |
| 115 | + if (CollectionUtils.isNotEmpty(wayList)) { | |
| 116 | + if ("健康".equals(factorProject.getRiskFactorName())) { | |
| 117 | + healthList.addAll(wayList); | |
| 118 | + } else { | |
| 119 | + riskList.addAll(wayList); | |
| 120 | + riskFactorNames.add(riskFactorName); | |
| 99 | 121 | } |
| 100 | 122 | } |
| 101 | 123 | } |
| 102 | - if (CollectionUtils.isNotEmpty(healthList)){ | |
| 103 | - factorProjectManage.setHealthItemList(checkItemService.selectByIds(healthList)); | |
| 104 | - } | |
| 105 | - if (CollectionUtils.isNotEmpty(riskList)){ | |
| 106 | - factorProjectManage.setRiskItemList(checkItemService.selectByIds(riskList)); | |
| 107 | - } | |
| 124 | + | |
| 125 | + factorProjectManage.setHealthItemList(healthList); | |
| 126 | + factorProjectManage.setRiskItemList(riskList); | |
| 127 | + factorProjectManage.setRiskFactorNames(riskFactorNames); | |
| 108 | 128 | return factorProjectManage; |
| 109 | 129 | } |
| 110 | 130 | return null; |
platform-biz-service/src/main/java/com/lyms/platform/permission/service/impl/ProjectWayServiceImpl.java
View file @
8883121
| 1 | +package com.lyms.platform.permission.service.impl; | |
| 2 | + | |
| 3 | +import com.lyms.platform.permission.dao.master.ProjectWayMapper; | |
| 4 | +import com.lyms.platform.permission.model.ProjectWay; | |
| 5 | +import com.lyms.platform.permission.service.ProjectWayService; | |
| 6 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 7 | +import org.springframework.stereotype.Service; | |
| 8 | + | |
| 9 | +import java.util.List; | |
| 10 | + | |
| 11 | +@Service("projectWayService") | |
| 12 | +public class ProjectWayServiceImpl implements ProjectWayService { | |
| 13 | + @Autowired | |
| 14 | + private ProjectWayMapper projectWayMapper; | |
| 15 | + | |
| 16 | + @Override | |
| 17 | + public List<ProjectWay> getList(List<Integer> ids) { | |
| 18 | + return projectWayMapper.getList(ids); | |
| 19 | + } | |
| 20 | + | |
| 21 | + @Override | |
| 22 | + public void add(ProjectWay projectWay) { | |
| 23 | + projectWayMapper.add(projectWay); | |
| 24 | + } | |
| 25 | + | |
| 26 | + @Override | |
| 27 | + public void update(ProjectWay projectWay) { | |
| 28 | + projectWayMapper.update(projectWay); | |
| 29 | + } | |
| 30 | + | |
| 31 | + @Override | |
| 32 | + public void del(List<Integer> id) { | |
| 33 | + projectWayMapper.del(id); | |
| 34 | + } | |
| 35 | + | |
| 36 | + @Override | |
| 37 | + public void insertBatch(List<ProjectWay> list) { | |
| 38 | + projectWayMapper.insertBatch(list); | |
| 39 | + } | |
| 40 | + | |
| 41 | + @Override | |
| 42 | + public ProjectWay selectById(Integer id) { | |
| 43 | + return projectWayMapper.selectById(id); | |
| 44 | + } | |
| 45 | +} |
platform-biz-service/src/main/resources/mainOrm/master/FactorProjectMapper.xml
View file @
8883121
| ... | ... | @@ -6,7 +6,6 @@ |
| 6 | 6 | <id column="id" property="id" jdbcType="INTEGER"/> |
| 7 | 7 | <result column="risk_factor_ids" property="riskFactorIds" jdbcType="VARCHAR"/> |
| 8 | 8 | <result column="risk_factor_name" property="riskFactorName" jdbcType="VARCHAR"/> |
| 9 | - <result column="week_project_id" property="weekProjectId" jdbcType="VARCHAR"/> | |
| 10 | 9 | <result column="hospital_id" property="hospitalId" jdbcType="INTEGER"/> |
| 11 | 10 | <result column="week" property="week" jdbcType="VARCHAR"/> |
| 12 | 11 | <result column="created" property="created" jdbcType="TIMESTAMP"/> |
| 13 | 12 | |
| 14 | 13 | |
| ... | ... | @@ -19,13 +18,14 @@ |
| 19 | 18 | </if> |
| 20 | 19 | </if> |
| 21 | 20 | </sql> |
| 22 | - <select id="getList" resultMap="FactorProjectMap" parameterType="com.lyms.platform.permission.model.FactorProjectQuery"> | |
| 21 | + <select id="getList" resultMap="FactorProjectMap" | |
| 22 | + parameterType="com.lyms.platform.permission.model.FactorProjectQuery"> | |
| 23 | 23 | SELECT id, |
| 24 | - risk_factor_name,week_project_id,risk_factor_ids, | |
| 24 | + risk_factor_name,risk_factor_ids, | |
| 25 | 25 | week,hospital_id,created |
| 26 | 26 | FROM lyms_factor_project |
| 27 | 27 | where |
| 28 | - hospital_id = #{hospitalId,jdbcType=INTEGER} | |
| 28 | + hospital_id = #{hospitalId,jdbcType=INTEGER} | |
| 29 | 29 | <if test="week !=null and week !='' "> |
| 30 | 30 | and week=#{week,jdbcType=VARCHAR} |
| 31 | 31 | </if> |
| 32 | 32 | |
| ... | ... | @@ -38,13 +38,13 @@ |
| 38 | 38 | <include refid="orderAndLimit"/> |
| 39 | 39 | </select> |
| 40 | 40 | |
| 41 | - <select id="add" parameterType="com.lyms.platform.permission.model.FactorProject"> | |
| 42 | - INSERT INTO lyms_factor_project(risk_factor_ids,risk_factor_name,week_project_id,week,hospital_id,created) | |
| 43 | - VALUES (#{riskFactorIds},#{riskFactorName},#{weekProjectId},#{week},#{hospitalId},#{created}) | |
| 44 | - </select> | |
| 41 | + <insert id="add" parameterType="com.lyms.platform.permission.model.FactorProject" useGeneratedKeys="true" keyProperty="id"> | |
| 42 | + INSERT INTO lyms_factor_project(risk_factor_ids,risk_factor_name,week,hospital_id,created) | |
| 43 | + VALUES (#{riskFactorIds},#{riskFactorName},#{week},#{hospitalId},#{created}) | |
| 44 | + </insert> | |
| 45 | 45 | |
| 46 | 46 | |
| 47 | - <update id="update" parameterType="com.lyms.platform.permission.model.FactorProject" > | |
| 47 | + <update id="update" parameterType="com.lyms.platform.permission.model.FactorProject"> | |
| 48 | 48 | update lyms_factor_project |
| 49 | 49 | <set> |
| 50 | 50 | <if test="riskFactorIds != null and riskFactorIds != ''"> |
| ... | ... | @@ -53,9 +53,6 @@ |
| 53 | 53 | <if test="riskFactorName != null and riskFactorName != ''"> |
| 54 | 54 | risk_factor_name = #{riskFactorName,jdbcType=VARCHAR}, |
| 55 | 55 | </if> |
| 56 | - <if test="weekProjectId != null and weekProjectId != ''"> | |
| 57 | - week_project_id = #{weekProjectId,jdbcType=VARCHAR}, | |
| 58 | - </if> | |
| 59 | 56 | <if test="hospitalId != null"> |
| 60 | 57 | hospital_id = #{hospitalId,jdbcType=INTEGER}, |
| 61 | 58 | </if> |
| 62 | 59 | |
| ... | ... | @@ -81,11 +78,67 @@ |
| 81 | 78 | </select> |
| 82 | 79 | <select id="selectById" resultMap="FactorProjectMap" parameterType="java.lang.Integer"> |
| 83 | 80 | SELECT id,risk_factor_ids, |
| 84 | - risk_factor_name,week_project_id, | |
| 81 | + risk_factor_name, | |
| 85 | 82 | week,hospital_id,created |
| 86 | 83 | FROM lyms_factor_project |
| 87 | 84 | where |
| 88 | 85 | id = #{id,jdbcType=INTEGER} |
| 86 | + </select> | |
| 87 | + | |
| 88 | + <resultMap id="FactorProjectResultMap" type="com.lyms.platform.permission.model.FactorProject"> | |
| 89 | + <id column="id" property="id" jdbcType="INTEGER"/> | |
| 90 | + <result column="hospital_id" property="hospitalId" jdbcType="INTEGER"/> | |
| 91 | + <result column="risk_factor_ids" property="riskFactorIds" jdbcType="VARCHAR"/> | |
| 92 | + <result column="risk_factor_name" property="riskFactorName" jdbcType="VARCHAR"/> | |
| 93 | + <result column="week" property="week" jdbcType="VARCHAR"/> | |
| 94 | + <result column="created" property="created" jdbcType="TIMESTAMP"/> | |
| 95 | + <collection property="wayList" ofType="com.lyms.platform.permission.model.ProjectWay"> | |
| 96 | + <id column="projectWay.id" property="id"/> | |
| 97 | + <result column="projectWay.week_project_id" property="weekProjectId"/> | |
| 98 | + <result column="projectWay.way" property="way"/> | |
| 99 | + <result column="projectWay.week_project_name" property="weekProjectName"/> | |
| 100 | + <result column="projectWay.factor_id" property="factorId"/> | |
| 101 | + <result column="projectWay.sort" property="sort"/> | |
| 102 | + </collection> | |
| 103 | + </resultMap> | |
| 104 | + <select id="selectInfo" resultMap="FactorProjectResultMap" parameterType="java.lang.Integer"> | |
| 105 | + SELECT | |
| 106 | + fp.id, | |
| 107 | + fp.hospital_id, | |
| 108 | + fp.risk_factor_ids, | |
| 109 | + fp.risk_factor_name, | |
| 110 | + fp.`week`, | |
| 111 | + pw.id AS `projectWay.id`, | |
| 112 | + pw.way AS `projectWay.way`, | |
| 113 | + pw.factor_id AS `projectWay.factor_id`, | |
| 114 | + pw.week_project_id AS `projectWay.week_project_id`, | |
| 115 | + pw.week_project_name AS `projectWay.week_project_name`, | |
| 116 | + pw.sort AS `projectWay.sort` | |
| 117 | +FROM | |
| 118 | + `lyms_factor_project` fp | |
| 119 | +INNER JOIN lyms_project_way pw ON pw.factor_id = fp.id | |
| 120 | + where | |
| 121 | + fp.id = #{id,jdbcType=INTEGER} | |
| 122 | + </select> | |
| 123 | + | |
| 124 | + <select id="selectList" resultMap="FactorProjectResultMap"> | |
| 125 | + SELECT | |
| 126 | + fp.id, | |
| 127 | + fp.risk_factor_ids, | |
| 128 | + fp.risk_factor_name, | |
| 129 | + fp.`week`, | |
| 130 | + pw.id AS `projectWay.id`, | |
| 131 | + pw.way AS `projectWay.way`, | |
| 132 | + pw.factor_id AS `projectWay.factor_id`, | |
| 133 | + pw.week_project_id AS `projectWay.week_project_id`, | |
| 134 | + pw.week_project_name AS `projectWay.week_project_name`, | |
| 135 | + pw.sort AS `projectWay.sort` | |
| 136 | + FROM | |
| 137 | + `lyms_factor_project` fp | |
| 138 | + INNER JOIN lyms_project_way pw ON pw.factor_id = fp.id | |
| 139 | + where | |
| 140 | + fp.hospital_id = #{hospitalId} | |
| 141 | + and fp.week = #{week} | |
| 89 | 142 | </select> |
| 90 | 143 | |
| 91 | 144 | </mapper> |
platform-biz-service/src/main/resources/mainOrm/master/ProjectWayMapper.xml
View file @
8883121
| 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.ProjectWayMapper"> | |
| 4 | + | |
| 5 | + <resultMap id="ProjectWayMap" type="com.lyms.platform.permission.model.ProjectWay"> | |
| 6 | + <id column="id" property="id" jdbcType="INTEGER"/> | |
| 7 | + <result column="week_project_id" property="weekProjectId" jdbcType="VARCHAR"/> | |
| 8 | + <result column="week_project_name" property="weekProjectName" jdbcType="VARCHAR"/> | |
| 9 | + <result column="factor_id" property="factorId" jdbcType="INTEGER"/> | |
| 10 | + <result column="way" property="way" jdbcType="VARCHAR"/> | |
| 11 | + <result column="sort" property="sort" jdbcType="INTEGER"/> | |
| 12 | + </resultMap> | |
| 13 | + | |
| 14 | + <select id="getList" resultMap="ProjectWayMap" parameterType="java.util.List"> | |
| 15 | + SELECT id, | |
| 16 | + week_project_id,week_project_name, | |
| 17 | + way,sort | |
| 18 | + FROM lyms_project_way | |
| 19 | + where | |
| 20 | + <if test="ids!=null and ids.size() > 0"> | |
| 21 | + and id in | |
| 22 | + <foreach collection="ids" item="item" open="(" close=")" separator=","> | |
| 23 | + #{item} | |
| 24 | + </foreach> | |
| 25 | + </if> | |
| 26 | + | |
| 27 | + </select> | |
| 28 | + | |
| 29 | + <insert id="add" parameterType="com.lyms.platform.permission.model.ProjectWay"> | |
| 30 | + INSERT INTO lyms_project_way(week_project_id,week_project_name,factor_id,way,sort) | |
| 31 | + VALUES (#{weekProjectId},#{weekProjectName},#{factorId},#{way},#{sort}) | |
| 32 | + </insert> | |
| 33 | + | |
| 34 | + <insert id="insertBatch"> | |
| 35 | + insert into lyms_project_way(week_project_id,week_project_name,factor_id,way,sort) | |
| 36 | + values | |
| 37 | + <foreach collection="list" item="entity" separator=","> | |
| 38 | + (#{entity.weekProjectId},#{entity.weekProjectName},#{entity.factorId},#{entity.way},#{entity.sort}) | |
| 39 | + </foreach> | |
| 40 | + </insert> | |
| 41 | + <update id="update" parameterType="com.lyms.platform.permission.model.ProjectWay" > | |
| 42 | + update lyms_project_way | |
| 43 | + <set> | |
| 44 | + <if test="weekProjectId != null and weekProjectId != ''"> | |
| 45 | + week_project_id = #{weekProjectId,jdbcType=VARCHAR}, | |
| 46 | + </if> | |
| 47 | + <if test="weekProjectName != null and weekProjectName != ''"> | |
| 48 | + week_project_name = #{weekProjectName,jdbcType=VARCHAR}, | |
| 49 | + </if> | |
| 50 | + <if test="factorId != null and factorId != ''"> | |
| 51 | + factor_id = #{factorId,jdbcType=VARCHAR}, | |
| 52 | + </if> | |
| 53 | + <if test="way != null and way != ''"> | |
| 54 | + way = #{way,jdbcType=VARCHAR}, | |
| 55 | + </if> | |
| 56 | + <if test="sort !=null"> | |
| 57 | + sort = #{sort,jdbcType=INTEGER}, | |
| 58 | + </if> | |
| 59 | + </set> | |
| 60 | + where id = #{id,jdbcType=INTEGER} | |
| 61 | + </update> | |
| 62 | + | |
| 63 | + <delete id="del" parameterType="java.util.List"> | |
| 64 | + delete from lyms_project_way where id in | |
| 65 | + <if test="ids!=null and ids.size() > 0"> | |
| 66 | + <foreach collection="ids" item="item" open="(" close=")" separator=","> | |
| 67 | + #{item} | |
| 68 | + </foreach> | |
| 69 | + </if> | |
| 70 | + </delete> | |
| 71 | + | |
| 72 | + <select id="selectById" resultMap="ProjectWayMap" parameterType="java.lang.Integer"> | |
| 73 | + SELECT id, | |
| 74 | + week_project_id,week_project_name, | |
| 75 | + way,factor_id,sort | |
| 76 | + FROM lyms_project_way | |
| 77 | + where | |
| 78 | + id = #{id,jdbcType=INTEGER} | |
| 79 | + </select> | |
| 80 | + | |
| 81 | +</mapper> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/FactorProjectController.java
View file @
8883121
| ... | ... | @@ -7,10 +7,8 @@ |
| 7 | 7 | import com.lyms.platform.common.utils.StringUtils; |
| 8 | 8 | import com.lyms.platform.operate.web.facade.BookbuildingFacade; |
| 9 | 9 | import com.lyms.platform.operate.web.result.FrontEndResult; |
| 10 | -import com.lyms.platform.permission.model.FactorProject; | |
| 11 | -import com.lyms.platform.permission.model.FactorProjectEntity; | |
| 12 | -import com.lyms.platform.permission.model.FactorProjectManage; | |
| 13 | -import com.lyms.platform.permission.model.FactorProjectQuery; | |
| 10 | +import com.lyms.platform.permission.model.*; | |
| 11 | +import com.lyms.platform.permission.service.CheckItemService; | |
| 14 | 12 | import com.lyms.platform.permission.service.FactorProjectService; |
| 15 | 13 | import org.springframework.beans.factory.annotation.Autowired; |
| 16 | 14 | import org.springframework.beans.factory.annotation.Qualifier; |
| ... | ... | @@ -27,6 +25,9 @@ |
| 27 | 25 | @Autowired |
| 28 | 26 | @Qualifier("factorProjectService") |
| 29 | 27 | private FactorProjectService factorProjectService; |
| 28 | + @Autowired | |
| 29 | + @Qualifier("cfCheckItemService") | |
| 30 | + private CheckItemService checkItemService; | |
| 30 | 31 | |
| 31 | 32 | @RequestMapping(value = "/getList", method = RequestMethod.GET) |
| 32 | 33 | @ResponseBody |
| ... | ... | @@ -63,7 +64,7 @@ |
| 63 | 64 | } |
| 64 | 65 | |
| 65 | 66 | @RequestMapping(value = "/update", method = RequestMethod.POST) |
| 66 | - //@TokenRequired | |
| 67 | + @TokenRequired | |
| 67 | 68 | public void update(HttpServletResponse response, @RequestBody FactorProject factorProject) { |
| 68 | 69 | if (factorProject.getId() == null) { |
| 69 | 70 | ResultUtils.buildParameterErrorResultAndWrite(response, "ID不能为空"); |
| ... | ... | @@ -78,10 +79,9 @@ |
| 78 | 79 | if (id == null) { |
| 79 | 80 | ResultUtils.buildParameterErrorResultAndWrite(response, "ID不能为空"); |
| 80 | 81 | } |
| 81 | - FactorProject factorProject= factorProjectService.selectById(id); | |
| 82 | - if (factorProject!=null){ | |
| 83 | - factorProjectService.del(id); | |
| 84 | - } | |
| 82 | + | |
| 83 | + factorProjectService.del(id); | |
| 84 | + | |
| 85 | 85 | ResultUtils.buildSuccessResultAndWrite(response); |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | |
| 90 | 90 | |
| 91 | 91 | |
| ... | ... | @@ -94,26 +94,37 @@ |
| 94 | 94 | if (id == null) { |
| 95 | 95 | ResultUtils.buildParameterErrorResultAndWrite(response, "ID不能为空"); |
| 96 | 96 | } |
| 97 | - FactorProjectManage factorProject= factorProjectService.selectInfo(id); | |
| 98 | - | |
| 97 | + FactorProject factorProject= factorProjectService.selectInfo(id); | |
| 99 | 98 | ResultUtils.buildSuccessResultAndWrite(response,factorProject); |
| 100 | 99 | } |
| 101 | 100 | |
| 102 | - @RequestMapping(value = "/selectByWeek", method = RequestMethod.GET) | |
| 101 | + @RequestMapping(value = "/selectCheckItem", method = RequestMethod.GET) | |
| 103 | 102 | //@TokenRequired |
| 104 | 103 | public void selectInfo(HttpServletResponse response, |
| 105 | - @RequestParam(value = "hospitalId") Integer hospitalId, | |
| 106 | - @RequestParam(value = "week") String week) { | |
| 104 | + @RequestParam(value = "ids")String ids) { | |
| 105 | + if (StringUtils.isEmpty(ids)) { | |
| 106 | + ResultUtils.buildParameterErrorResultAndWrite(response, "ID不能为空"); | |
| 107 | + } | |
| 108 | + | |
| 109 | + List<CheckItem> itemList= checkItemService.selectByIds(ids.split(",")); | |
| 110 | + ResultUtils.buildSuccessResultAndWrite(response,itemList); | |
| 111 | + } | |
| 112 | + | |
| 113 | + @RequestMapping(value = "/selectByWeek", method = RequestMethod.POST) | |
| 114 | + //@TokenRequired | |
| 115 | + public void selectInfo(HttpServletResponse response, | |
| 116 | + @RequestBody ProjectWayQuery projectWayQuery) { | |
| 117 | + Integer hospitalId= projectWayQuery.getHospitalId(); | |
| 118 | + String week= projectWayQuery.getWeek(); | |
| 107 | 119 | if (hospitalId == null) { |
| 108 | 120 | ResultUtils.buildParameterErrorResultAndWrite(response, "ID不能为空"); |
| 109 | 121 | } |
| 110 | - FactorProjectQuery factorProjectQuery=new FactorProjectQuery(); | |
| 111 | - factorProjectQuery.setHospitalId(hospitalId); | |
| 112 | - factorProjectQuery.setWeek(week); | |
| 113 | - FactorProjectEntity factorProject= factorProjectService.selectByWeek(factorProjectQuery); | |
| 122 | + if (StringUtils.isEmpty(week)) { | |
| 123 | + ResultUtils.buildParameterErrorResultAndWrite(response, "孕周不能为空"); | |
| 124 | + } | |
| 125 | + FactorProjectEntity factorProject= factorProjectService.selectByWeek(hospitalId,week); | |
| 114 | 126 | ResultUtils.buildSuccessResultAndWrite(response,factorProject); |
| 115 | 127 | } |
| 116 | - | |
| 117 | 128 | |
| 118 | 129 | @RequestMapping(value = "/test", method = RequestMethod.GET) |
| 119 | 130 | public void test(HttpServletResponse response){ |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
8883121
| ... | ... | @@ -1232,7 +1232,6 @@ |
| 1232 | 1232 | sendbuildingMsg(patients, SmsServiceEnums.CJYYTX.getId(), "【产检提醒】", "亲爱的孕妈妈,您当前孕周为" + week + ",请点击此处查看就诊流程。", week); |
| 1233 | 1233 | |
| 1234 | 1234 | if (CollectionUtils.isNotEmpty(patients.getRiskFactorId()) && !patients.getRiskFactorId().contains("d42eec03-aa86-45b8-a4e0-78a0ff365fb6")) { |
| 1235 | - //TODO 处理高危和健康跳转的页面逻辑 push_center | |
| 1236 | 1235 | try { |
| 1237 | 1236 | FactorProjectQuery factorProjectQuery = new FactorProjectQuery(); |
| 1238 | 1237 | factorProjectQuery.setHospitalId(Integer.valueOf(hospitalId)); |