From 611257b6b89e8876cd614c9f4dc9f82f300011d6 Mon Sep 17 00:00:00 2001 From: "litao@lymsh.com" Date: Thu, 24 Aug 2017 11:47:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=A5=E9=9C=80=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/lyms/platform/pojo/PlantformConfigModel.java | 10 ++++++++++ .../operate/web/service/impl/PlantformConfigServiceImpl.java | 9 +++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/platform-dal/src/main/java/com/lyms/platform/pojo/PlantformConfigModel.java b/platform-dal/src/main/java/com/lyms/platform/pojo/PlantformConfigModel.java index 74a62ab..705fea7 100644 --- a/platform-dal/src/main/java/com/lyms/platform/pojo/PlantformConfigModel.java +++ b/platform-dal/src/main/java/com/lyms/platform/pojo/PlantformConfigModel.java @@ -42,6 +42,8 @@ public class PlantformConfigModel extends BaseModel { private String serchKey; private String parentId; + + private Integer userId; /** * 创建时间 @@ -67,6 +69,14 @@ public class PlantformConfigModel extends BaseModel { */ private Long incrementValue; + public Integer getUserId() { + return userId; + } + + public void setUserId(Integer userId) { + this.userId = userId; + } + public static long getSerialVersionUID() { return serialVersionUID; } diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PlantformConfigServiceImpl.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PlantformConfigServiceImpl.java index 9630213..c8a7b3d 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PlantformConfigServiceImpl.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/PlantformConfigServiceImpl.java @@ -43,7 +43,7 @@ public class PlantformConfigServiceImpl extends BaseServiceImpl implements Plant public BaseResponse listCustomType(String key, Integer page, Integer limit, Integer userId) { String hospitalId = autoMatchFacade.getHospitalId(userId); Query query = new Query(); - query.addCriteria(Criteria.where("yn").ne("0")); + query.addCriteria(Criteria.where("yn").ne("0").and("userId").is(userId)); if(StringUtils.isNotEmpty(key)) { query.addCriteria(Criteria.where("value").regex(key)); } @@ -74,8 +74,7 @@ public class PlantformConfigServiceImpl extends BaseServiceImpl implements Plant @Override public BaseResponse customTypeInit(Integer userId) { List> restList = new ArrayList<>(); - String hospitalId = autoMatchFacade.getHospitalId(userId); - List plantformConfigModels = mongoTemplate.find(Query.query(Criteria.where("key").is(hospitalId).and("type").is(SequenceConstant.CUSTOM_TYPE).and("yn").ne("0")), PlantformConfigModel.class); + List plantformConfigModels = mongoTemplate.find(Query.query(Criteria.where("userId").is(userId).and("type").is(SequenceConstant.CUSTOM_TYPE).and("yn").ne("0")), PlantformConfigModel.class); for (PlantformConfigModel plantformConfigModel : plantformConfigModels) { Map temp = new HashMap<>(); temp.put("id", plantformConfigModel.getId().toString()); @@ -94,6 +93,7 @@ public class PlantformConfigServiceImpl extends BaseServiceImpl implements Plant plantformConfigModel.setValue(name); plantformConfigModel.setType(SequenceConstant.CUSTOM_TYPE); plantformConfigModel.setYn("1"); + plantformConfigModel.setUserId(userId); plantformConfigModel.setRemark("产检处理意见自定义类型"); mongoTemplate.save(plantformConfigModel); } else { @@ -106,7 +106,7 @@ public class PlantformConfigServiceImpl extends BaseServiceImpl implements Plant public BaseResponse customContentList(String parentId, Date startDate, Date endDate, Integer page, Integer limit, Integer userId) { String hospitalId = autoMatchFacade.getHospitalId(userId); Query query = new Query(); - query.addCriteria(Criteria.where("yn").ne("0")); + query.addCriteria(Criteria.where("yn").ne("0").and("userId").is(userId)); if(StringUtils.isNotEmpty(parentId)) { query.addCriteria(Criteria.where("parentId").is(parentId)); } @@ -144,6 +144,7 @@ public class PlantformConfigServiceImpl extends BaseServiceImpl implements Plant plantformConfigModel.setYn("1"); plantformConfigModel.setType(SequenceConstant.CUSTOM_CONTENT); plantformConfigModel.setRemark("产检处理意见自定义内容"); + plantformConfigModel.setUserId(userId); mongoTemplate.save(plantformConfigModel); } else { plantformConfigModel.setCreateDate(new Date()); -- 1.8.3.1