Commit 659a1016bda411aa74c5b61dfa1e5ba88a4a749d
1 parent
933587ff34
Exists in
master
and in
1 other branch
code update
Showing 3 changed files with 83 additions and 19 deletions
platform-dal/src/main/java/com/lyms/platform/query/BasicConfigQuery.java
View file @
659a101
| ... | ... | @@ -6,11 +6,16 @@ |
| 6 | 6 | import com.lyms.platform.common.dao.operator.MongoOper; |
| 7 | 7 | import com.lyms.platform.common.dao.operator.MongoQuery; |
| 8 | 8 | import com.lyms.platform.common.enums.YnEnums; |
| 9 | +import org.springframework.data.mongodb.core.query.Criteria; | |
| 9 | 10 | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 10 | 13 | public class BasicConfigQuery extends BaseQuery implements IConvertToNativeQuery { |
| 11 | 14 | |
| 12 | 15 | private String id; |
| 13 | 16 | |
| 17 | + private List ids; | |
| 18 | + | |
| 14 | 19 | private String parentId; |
| 15 | 20 | |
| 16 | 21 | private String code; |
| ... | ... | @@ -37,6 +42,11 @@ |
| 37 | 42 | if (null != id) { |
| 38 | 43 | condition = condition.and("id", id, MongoOper.IS); |
| 39 | 44 | } |
| 45 | + | |
| 46 | + if (null != ids && ids.size() > 0) { | |
| 47 | + Criteria c = Criteria.where("id").in(ids); | |
| 48 | + condition.andCondition( new MongoCondition(c)); | |
| 49 | + } | |
| 40 | 50 | |
| 41 | 51 | if (null != code) { |
| 42 | 52 | condition = condition.and("code", code, MongoOper.IS); |
| ... | ... | @@ -53,6 +63,8 @@ |
| 53 | 63 | if(null!=enable){ |
| 54 | 64 | condition = condition.and("enable", enable, MongoOper.IS); |
| 55 | 65 | } |
| 66 | + | |
| 67 | + | |
| 56 | 68 | if (null != keyword) { |
| 57 | 69 | MongoCondition con1= MongoCondition.newInstance("code", keyword, MongoOper.LIKE); |
| 58 | 70 | MongoCondition con = MongoCondition.newInstance("name", keyword, MongoOper.LIKE); |
| ... | ... | @@ -60,6 +72,14 @@ |
| 60 | 72 | } |
| 61 | 73 | |
| 62 | 74 | return condition.toMongoQuery(); |
| 75 | + } | |
| 76 | + | |
| 77 | + public List getIds() { | |
| 78 | + return ids; | |
| 79 | + } | |
| 80 | + | |
| 81 | + public void setIds(List ids) { | |
| 82 | + this.ids = ids; | |
| 63 | 83 | } |
| 64 | 84 | |
| 65 | 85 | public String getTypeId() { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyBookbuildingFacade.java
View file @
659a101
| ... | ... | @@ -694,8 +694,25 @@ |
| 694 | 694 | bm.setExpVip(b.getExpVip()); |
| 695 | 695 | bm.setMremark(b.getMremark()); |
| 696 | 696 | bm.setDiagnose(JsonUtil.array2JsonString(b.getDiagnose())); |
| 697 | - bm.setLastDiagnose(JsonUtil.array2JsonString(b.getDiagnose())); | |
| 698 | 697 | |
| 698 | + if (b.getDiagnose() != null && b.getDiagnose().size() > 0) | |
| 699 | + { | |
| 700 | + BasicConfigQuery basicConfigQuery = new BasicConfigQuery(); | |
| 701 | + basicConfigQuery.setYn(YnEnums.YES.getId()); | |
| 702 | + basicConfigQuery.setParentId(SystemConfig.DIAGNOSE_TYPE_ID); | |
| 703 | + basicConfigQuery.setIds(b.getDiagnose()); | |
| 704 | + List<BasicConfig> datas = basicConfigService.queryBasicConfig(basicConfigQuery); | |
| 705 | + List<String> diagnoseNames = new ArrayList<>(); | |
| 706 | + if (datas != null) { | |
| 707 | + for (BasicConfig data : datas) { | |
| 708 | + diagnoseNames.add(data.getName()); | |
| 709 | + } | |
| 710 | + } | |
| 711 | + bm.setLastDiagnose(JsonUtil.array2JsonString(diagnoseNames)); | |
| 712 | + } | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 699 | 716 | if (b.getExpType() != null) { |
| 700 | 717 | if (b.getExpType() == ExpEnums.SGY.getId()) { |
| 701 | 718 | Date vipEndTime = DateUtil.addMonth(DateUtil.parseYMD(b.getBuildDate()), 3); |
| 702 | 719 | |
| ... | ... | @@ -1415,23 +1432,25 @@ |
| 1415 | 1432 | babyQuery.setBirthEnd(start); |
| 1416 | 1433 | } |
| 1417 | 1434 | |
| 1418 | - if (StringUtils.isNotEmpty(request.getDiagnose())) | |
| 1419 | - { | |
| 1420 | - BasicConfigQuery basicConfigQuery = new BasicConfigQuery(); | |
| 1421 | - basicConfigQuery.setYn(YnEnums.YES.getId()); | |
| 1422 | - basicConfigQuery.setParentId(SystemConfig.DIAGNOSE_TYPE_ID); | |
| 1423 | - basicConfigQuery.setKeyword(request.getDiagnose()); | |
| 1424 | - System.out.println(request.getDiagnose()); | |
| 1425 | - List<BasicConfig> datas = basicConfigService.queryBasicConfig(basicConfigQuery); | |
| 1426 | - List<String> diagnoseIds = new ArrayList<>(); | |
| 1427 | - if (datas != null) { | |
| 1428 | - for (BasicConfig data : datas) { | |
| 1429 | - diagnoseIds.add(data.getId()); | |
| 1430 | - } | |
| 1435 | +// if (StringUtils.isNotEmpty(request.getDiagnose())) | |
| 1436 | +// { | |
| 1437 | +// BasicConfigQuery basicConfigQuery = new BasicConfigQuery(); | |
| 1438 | +// basicConfigQuery.setYn(YnEnums.YES.getId()); | |
| 1439 | +// basicConfigQuery.setParentId(SystemConfig.DIAGNOSE_TYPE_ID); | |
| 1440 | +// basicConfigQuery.setKeyword("伤寒杆菌性败血症"); | |
| 1441 | +// System.out.println(request.getDiagnose()); | |
| 1442 | +// List<BasicConfig> datas = basicConfigService.queryBasicConfig(basicConfigQuery); | |
| 1443 | +// List<String> diagnoseIds = new ArrayList<>(); | |
| 1444 | +// if (datas != null) { | |
| 1445 | +// for (BasicConfig data : datas) { | |
| 1446 | +// diagnoseIds.add(data.getId()); | |
| 1447 | +// } | |
| 1448 | +// | |
| 1449 | +// } | |
| 1450 | +// babyQuery.setLastDiagnoses(diagnoseIds); | |
| 1451 | +// } | |
| 1431 | 1452 | |
| 1432 | - } | |
| 1433 | - babyQuery.setLastDiagnoses(diagnoseIds); | |
| 1434 | - } | |
| 1453 | + babyQuery.setLastDiagnose(request.getDiagnose()); | |
| 1435 | 1454 | |
| 1436 | 1455 | //预约时间 |
| 1437 | 1456 | if (StringUtils.isNotEmpty(request.getNextDate())) |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BabyCheckFacade.java
View file @
659a101
| ... | ... | @@ -80,7 +80,18 @@ |
| 80 | 80 | bm.setNextDate(DateUtil.parseYMD(request.getNextDate())); |
| 81 | 81 | if (CollectionUtils.isNotEmpty(request.getDiagnose())) |
| 82 | 82 | { |
| 83 | - bm.setLastDiagnose(JsonUtil.array2JsonString(request.getDiagnose())); | |
| 83 | + BasicConfigQuery basicConfigQuery = new BasicConfigQuery(); | |
| 84 | + basicConfigQuery.setYn(YnEnums.YES.getId()); | |
| 85 | + basicConfigQuery.setParentId(SystemConfig.DIAGNOSE_TYPE_ID); | |
| 86 | + basicConfigQuery.setIds(request.getDiagnose()); | |
| 87 | + List<BasicConfig> datas = basicConfigService.queryBasicConfig(basicConfigQuery); | |
| 88 | + List<String> diagnoseNames = new ArrayList<>(); | |
| 89 | + if (datas != null) { | |
| 90 | + for (BasicConfig data : datas) { | |
| 91 | + diagnoseNames.add(data.getName()); | |
| 92 | + } | |
| 93 | + } | |
| 94 | + bm.setLastDiagnose(JsonUtil.array2JsonString(diagnoseNames)); | |
| 84 | 95 | } |
| 85 | 96 | babyBookbuildingService.updateBabyBuild(bm, request.getBuildId()); |
| 86 | 97 | return new BaseResponse().setErrorcode(ErrorCodeConstants.SUCCESS).setErrormsg("成功"); |
| 87 | 98 | |
| 88 | 99 | |
| ... | ... | @@ -199,10 +210,24 @@ |
| 199 | 210 | } |
| 200 | 211 | |
| 201 | 212 | bm.setNextDate(DateUtil.parseYMD(request.getNextDate())); |
| 213 | + | |
| 214 | + | |
| 202 | 215 | if (CollectionUtils.isNotEmpty(request.getDiagnose())) |
| 203 | 216 | { |
| 204 | - bm.setLastDiagnose(JsonUtil.array2JsonString(request.getDiagnose())); | |
| 217 | + BasicConfigQuery basicConfigQuery = new BasicConfigQuery(); | |
| 218 | + basicConfigQuery.setYn(YnEnums.YES.getId()); | |
| 219 | + basicConfigQuery.setParentId(SystemConfig.DIAGNOSE_TYPE_ID); | |
| 220 | + basicConfigQuery.setIds(request.getDiagnose()); | |
| 221 | + List<BasicConfig> datas = basicConfigService.queryBasicConfig(basicConfigQuery); | |
| 222 | + List<String> diagnoseNames = new ArrayList<>(); | |
| 223 | + if (datas != null) { | |
| 224 | + for (BasicConfig data : datas) { | |
| 225 | + diagnoseNames.add(data.getName()); | |
| 226 | + } | |
| 227 | + } | |
| 228 | + bm.setLastDiagnose(JsonUtil.array2JsonString(diagnoseNames)); | |
| 205 | 229 | } |
| 230 | + | |
| 206 | 231 | babyBookbuildingService.updateBabyBuild(bm, request.getBuildId()); |
| 207 | 232 | |
| 208 | 233 | BabyCheckModel model = getBabyCheckModel(request); |