|
@@ -420,7 +420,7 @@ public class GanZhiServiceImpl extends ServiceImpl<GanZhiMapper, GanZhi> impleme
|
|
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public List<DiseasePart> getJiBin(GanZhiDto ganZhiDto) {
|
|
|
|
|
|
+ public List<DiseasePart> getJiBing(GanZhiDto ganZhiDto) {
|
|
List<GanZhiRowVo> ganZhiRowVoList = this.selectGanZhiRowVoList(ganZhiDto);
|
|
List<GanZhiRowVo> ganZhiRowVoList = this.selectGanZhiRowVoList(ganZhiDto);
|
|
String sex = ganZhiRowVoList.get(4).getShiShen1();
|
|
String sex = ganZhiRowVoList.get(4).getShiShen1();
|
|
|
|
|
|
@@ -440,32 +440,32 @@ public class GanZhiServiceImpl extends ServiceImpl<GanZhiMapper, GanZhi> impleme
|
|
/*--------------------------年柱---------------------------*/
|
|
/*--------------------------年柱---------------------------*/
|
|
//天干 头
|
|
//天干 头
|
|
String yearGanShiShen = ganZhiRowVoList.get(0).getShiShen1();
|
|
String yearGanShiShen = ganZhiRowVoList.get(0).getShiShen1();
|
|
- if("七杀".indexOf(yearGanShiShen)>0) { //存在七杀
|
|
|
|
|
|
+ if ("七杀".contains(yearGanShiShen)) { //存在七杀
|
|
partZ.add("头");
|
|
partZ.add("头");
|
|
}
|
|
}
|
|
- if("偏印".indexOf(yearGanShiShen)>0) { //存在七杀
|
|
|
|
|
|
+ if ("偏印".contains(yearGanShiShen)) { //存在七杀
|
|
partQ.add("头");
|
|
partQ.add("头");
|
|
}
|
|
}
|
|
//地支 脖子
|
|
//地支 脖子
|
|
String yearZhiShiShen1 = ganZhiRowVoList.get(1).getShiShen1(); //脖子
|
|
String yearZhiShiShen1 = ganZhiRowVoList.get(1).getShiShen1(); //脖子
|
|
String yearZhiShiShen2 = ganZhiRowVoList.get(1).getShiShen2(); //脖子
|
|
String yearZhiShiShen2 = ganZhiRowVoList.get(1).getShiShen2(); //脖子
|
|
String yearZhiShiShen3 = ganZhiRowVoList.get(1).getShiShen3(); //脖子
|
|
String yearZhiShiShen3 = ganZhiRowVoList.get(1).getShiShen3(); //脖子
|
|
- if("七杀".indexOf(yearZhiShiShen1)>0) { //存在七杀
|
|
|
|
|
|
+ if (yearZhiShiShen1 != null && yearZhiShiShen1.contains("七杀")) { //存在七杀
|
|
partZ.add("脖子");
|
|
partZ.add("脖子");
|
|
}
|
|
}
|
|
- if("七杀".indexOf(yearZhiShiShen2)>0) { //存在七杀
|
|
|
|
|
|
+ if (yearZhiShiShen2 != null && yearZhiShiShen2.contains("七杀")) { //存在七杀
|
|
partZ.add("脖子");
|
|
partZ.add("脖子");
|
|
}
|
|
}
|
|
- if("七杀".indexOf(yearZhiShiShen3)>0) { //存在七杀
|
|
|
|
|
|
+ if (yearZhiShiShen3 != null && yearZhiShiShen3.contains("七杀")) { //存在七杀
|
|
partZ.add("脖子");
|
|
partZ.add("脖子");
|
|
}
|
|
}
|
|
- if("偏印".indexOf(yearZhiShiShen1)>0) { //存在偏印
|
|
|
|
|
|
+ if (yearZhiShiShen1.contains("偏印")) { //存在偏印
|
|
partQ.add("脖子");
|
|
partQ.add("脖子");
|
|
}
|
|
}
|
|
- if("偏印".indexOf(yearZhiShiShen2)>0) { //存在偏印
|
|
|
|
|
|
+ if (yearZhiShiShen2.contains("偏印")) { //存在偏印
|
|
partQ.add("脖子");
|
|
partQ.add("脖子");
|
|
}
|
|
}
|
|
- if("偏印".indexOf(yearZhiShiShen3)>0) { //存在偏印
|
|
|
|
|
|
+ if (yearZhiShiShen3.contains("偏印")) { //存在偏印
|
|
partQ.add("脖子");
|
|
partQ.add("脖子");
|
|
}
|
|
}
|
|
|
|
|
|
@@ -473,114 +473,138 @@ public class GanZhiServiceImpl extends ServiceImpl<GanZhiMapper, GanZhi> impleme
|
|
|
|
|
|
//天干 胸部
|
|
//天干 胸部
|
|
String monthGanShiShen = ganZhiRowVoList.get(2).getShiShen1();
|
|
String monthGanShiShen = ganZhiRowVoList.get(2).getShiShen1();
|
|
- if("七杀".indexOf(monthGanShiShen)>0) { //存在七杀
|
|
|
|
|
|
+ if (monthGanShiShen != null && monthGanShiShen.contains("七杀")) { //存在七杀
|
|
partZ.add("胸部");
|
|
partZ.add("胸部");
|
|
}
|
|
}
|
|
- if("偏印".indexOf(monthGanShiShen)>0) { //存在七杀
|
|
|
|
|
|
+ if (monthGanShiShen != null && monthGanShiShen.contains("偏印")) { //存在偏印
|
|
partQ.add("胸部");
|
|
partQ.add("胸部");
|
|
}
|
|
}
|
|
//地支 脖子
|
|
//地支 脖子
|
|
String monthZhiShiShen1 = ganZhiRowVoList.get(3).getShiShen1();
|
|
String monthZhiShiShen1 = ganZhiRowVoList.get(3).getShiShen1();
|
|
String monthZhiShiShen2 = ganZhiRowVoList.get(3).getShiShen2();
|
|
String monthZhiShiShen2 = ganZhiRowVoList.get(3).getShiShen2();
|
|
String monthZhiShiShen3 = ganZhiRowVoList.get(3).getShiShen3();
|
|
String monthZhiShiShen3 = ganZhiRowVoList.get(3).getShiShen3();
|
|
- if("七杀".indexOf(monthZhiShiShen1)>0) { //存在七杀
|
|
|
|
|
|
+ if (monthZhiShiShen1 != null && monthZhiShiShen1.contains("七杀")) { //存在七杀
|
|
partZ.add("腹部");
|
|
partZ.add("腹部");
|
|
}
|
|
}
|
|
- if("七杀".indexOf(monthZhiShiShen2)>0) { //存在七杀
|
|
|
|
|
|
+ if (monthZhiShiShen2 != null && monthZhiShiShen2.contains("七杀")) { //存在七杀
|
|
partZ.add("腹部");
|
|
partZ.add("腹部");
|
|
}
|
|
}
|
|
- if("七杀".indexOf(monthZhiShiShen3)>0) { //存在七杀
|
|
|
|
|
|
+ if (monthZhiShiShen3 != null && monthZhiShiShen3.contains("七杀")) { //存在七杀
|
|
partZ.add("腹部");
|
|
partZ.add("腹部");
|
|
}
|
|
}
|
|
- if("偏印".indexOf(monthZhiShiShen1)>0) { //存在偏印
|
|
|
|
|
|
+ if (monthZhiShiShen1 != null && monthZhiShiShen1.contains("偏印")) { //存在偏印
|
|
partQ.add("腹部");
|
|
partQ.add("腹部");
|
|
}
|
|
}
|
|
- if("偏印".indexOf(monthZhiShiShen2)>0) { //存在偏印
|
|
|
|
|
|
+ if (monthZhiShiShen2 != null && monthZhiShiShen2.contains("偏印")) { //存在偏印
|
|
partQ.add("腹部");
|
|
partQ.add("腹部");
|
|
}
|
|
}
|
|
- if("偏印".indexOf(monthZhiShiShen3)>0) { //存在偏印
|
|
|
|
|
|
+ if (monthZhiShiShen3 != null && monthZhiShiShen3.contains("偏印")) { //存在偏印
|
|
partQ.add("腹部");
|
|
partQ.add("腹部");
|
|
}
|
|
}
|
|
|
|
|
|
/*--------------------------日柱---------------------------*/
|
|
/*--------------------------日柱---------------------------*/
|
|
//天干
|
|
//天干
|
|
String dayGanShiShen = ganZhiRowVoList.get(4).getShiShen1();
|
|
String dayGanShiShen = ganZhiRowVoList.get(4).getShiShen1();
|
|
- if("七杀".indexOf(dayGanShiShen)>0) { //存在七杀
|
|
|
|
|
|
+ if ("七杀".indexOf(dayGanShiShen) > 0) { //存在七杀
|
|
partZ.add("小腹");
|
|
partZ.add("小腹");
|
|
}
|
|
}
|
|
- if("偏印".indexOf(dayGanShiShen)>0) { //存在七杀
|
|
|
|
|
|
+ if ("偏印".indexOf(dayGanShiShen) > 0) { //存在七杀
|
|
partQ.add("小腹");
|
|
partQ.add("小腹");
|
|
}
|
|
}
|
|
//地支 脖子
|
|
//地支 脖子
|
|
String dayZhiShiShen1 = ganZhiRowVoList.get(5).getShiShen1();
|
|
String dayZhiShiShen1 = ganZhiRowVoList.get(5).getShiShen1();
|
|
String dayZhiShiShen2 = ganZhiRowVoList.get(5).getShiShen2();
|
|
String dayZhiShiShen2 = ganZhiRowVoList.get(5).getShiShen2();
|
|
String dayZhiShiShen3 = ganZhiRowVoList.get(5).getShiShen3();
|
|
String dayZhiShiShen3 = ganZhiRowVoList.get(5).getShiShen3();
|
|
- if("七杀".indexOf(dayZhiShiShen1)>0) { //存在七杀
|
|
|
|
|
|
+ if (dayZhiShiShen1 != null && dayZhiShiShen1.contains("七杀")) { //存在七杀
|
|
partZ.add("屁股");
|
|
partZ.add("屁股");
|
|
}
|
|
}
|
|
- if("七杀".indexOf(dayZhiShiShen2)>0) { //存在七杀
|
|
|
|
|
|
+ if (dayZhiShiShen2 != null && dayZhiShiShen2.contains("七杀")) { //存在七杀
|
|
partZ.add("屁股");
|
|
partZ.add("屁股");
|
|
}
|
|
}
|
|
- if("七杀".indexOf(dayZhiShiShen3)>0) { //存在七杀
|
|
|
|
|
|
+ if (dayZhiShiShen3 != null && dayZhiShiShen3.contains("七杀")) { //存在七杀
|
|
partZ.add("屁股");
|
|
partZ.add("屁股");
|
|
}
|
|
}
|
|
- if("偏印".indexOf(dayZhiShiShen1)>0) { //存在偏印
|
|
|
|
|
|
+ if (dayZhiShiShen1 != null && dayZhiShiShen1.contains("偏印")) { //存在偏印
|
|
partQ.add("屁股");
|
|
partQ.add("屁股");
|
|
}
|
|
}
|
|
- if("偏印".indexOf(dayZhiShiShen2)>0) { //存在偏印
|
|
|
|
|
|
+ if (dayZhiShiShen2 != null && dayZhiShiShen2.contains("偏印")) { //存在偏印
|
|
partQ.add("屁股");
|
|
partQ.add("屁股");
|
|
}
|
|
}
|
|
- if("偏印".indexOf(dayZhiShiShen3)>0) { //存在偏印
|
|
|
|
|
|
+ if (dayZhiShiShen3 != null && dayZhiShiShen3.contains("偏印")) { //存在偏印
|
|
partQ.add("屁股");
|
|
partQ.add("屁股");
|
|
}
|
|
}
|
|
|
|
|
|
/*--------------------------时柱---------------------------*/
|
|
/*--------------------------时柱---------------------------*/
|
|
//天干
|
|
//天干
|
|
-// String timeGanShiShen = ganZhiRowVoList.get(6).getShiShen1();
|
|
|
|
-// if("七杀".indexOf(timeGanShiShen)>0) { //存在七杀
|
|
|
|
-// partZ.add("小腹");
|
|
|
|
-// }
|
|
|
|
-// if("偏印".indexOf(timeGanShiShen)>0) { //存在七杀
|
|
|
|
-// partQ.add("小腹");
|
|
|
|
-// }
|
|
|
|
-// //地支 脖子
|
|
|
|
-// String timeZhiShiShen1 = ganZhiRowVoList.get(7).getShiShen1();
|
|
|
|
-// String timeZhiShiShen2 = ganZhiRowVoList.get(7).getShiShen2();
|
|
|
|
-// String timeZhiShiShen3 = ganZhiRowVoList.get(7).getShiShen3();
|
|
|
|
-// if("七杀".indexOf(timeZhiShiShen1)>0) { //存在七杀
|
|
|
|
-// partZ.add("小腿");
|
|
|
|
-// }
|
|
|
|
-// if("七杀".indexOf(timeZhiShiShen2)>0) { //存在七杀
|
|
|
|
-// partZ.add("小腿");
|
|
|
|
-// }
|
|
|
|
-// if("七杀".indexOf(timeZhiShiShen3)>0) { //存在七杀
|
|
|
|
-// partZ.add("小腿");
|
|
|
|
-// }
|
|
|
|
-// if("偏印".indexOf(timeZhiShiShen1)>0) { //存在偏印
|
|
|
|
-// partQ.add("小腿");
|
|
|
|
-// }
|
|
|
|
-// if("偏印".indexOf(timeZhiShiShen2)>0) { //存在偏印
|
|
|
|
-// partQ.add("小腿");
|
|
|
|
-// }
|
|
|
|
-// if("偏印".indexOf(timeZhiShiShen3)>0) { //存在偏印
|
|
|
|
-// partQ.add("小腿");
|
|
|
|
-// }
|
|
|
|
-//
|
|
|
|
-// DiseasePartDto diseasePartQDto = new DiseasePartDto();
|
|
|
|
-// diseasePartQDto.setSex(sex);
|
|
|
|
-// diseasePartQDto.setDegree("轻症");
|
|
|
|
-// diseasePartQDto.setParts(partQ);
|
|
|
|
-//
|
|
|
|
|
|
+ String timeGanShiShen = ganZhiRowVoList.get(6).getShiShen1();
|
|
|
|
+ if (timeGanShiShen != null && timeGanShiShen.contains("七杀")) { //存在七杀
|
|
|
|
+ partZ.add("小腹");
|
|
|
|
+ }
|
|
|
|
+ if (timeGanShiShen != null && timeGanShiShen.contains("偏印")) { //存在七杀
|
|
|
|
+ partQ.add("小腹");
|
|
|
|
+ }
|
|
|
|
+ //地支 脖子
|
|
|
|
+ String timeZhiShiShen1 = ganZhiRowVoList.get(7).getShiShen1();
|
|
|
|
+ String timeZhiShiShen2 = ganZhiRowVoList.get(7).getShiShen2();
|
|
|
|
+ String timeZhiShiShen3 = ganZhiRowVoList.get(7).getShiShen3();
|
|
|
|
+ if (timeZhiShiShen1 != null && timeZhiShiShen1.contains("七杀")) { //存在七杀
|
|
|
|
+ partZ.add("小腿");
|
|
|
|
+ }
|
|
|
|
+ if (timeZhiShiShen2 != null && timeZhiShiShen2.contains("七杀")) { //存在七杀
|
|
|
|
+ partZ.add("小腿");
|
|
|
|
+ }
|
|
|
|
+ if (timeZhiShiShen3 != null && timeZhiShiShen3.contains("七杀")) { //存在七杀
|
|
|
|
+ partZ.add("小腿");
|
|
|
|
+ }
|
|
|
|
+ if (timeZhiShiShen1 != null && timeZhiShiShen1.contains("偏印")) { //存在偏印
|
|
|
|
+ partQ.add("小腿");
|
|
|
|
+ }
|
|
|
|
+ if (timeZhiShiShen2 != null && timeZhiShiShen2.contains("偏印")) { //存在偏印
|
|
|
|
+ partQ.add("小腿");
|
|
|
|
+ }
|
|
|
|
+ if (timeZhiShiShen3 != null && timeZhiShiShen3.contains("偏印")) { //存在偏印
|
|
|
|
+ partQ.add("小腿");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ DiseasePartDto diseasePartQDto = new DiseasePartDto();
|
|
|
|
+ diseasePartQDto.setSex(sex);
|
|
|
|
+ diseasePartQDto.setDegree("轻症");
|
|
|
|
+ diseasePartQDto.setParts(partQ);
|
|
|
|
+
|
|
DiseasePartDto diseasePartZDto = new DiseasePartDto();
|
|
DiseasePartDto diseasePartZDto = new DiseasePartDto();
|
|
diseasePartZDto.setSex(sex);
|
|
diseasePartZDto.setSex(sex);
|
|
diseasePartZDto.setDegree("严重");
|
|
diseasePartZDto.setDegree("严重");
|
|
diseasePartZDto.setParts(partZ);
|
|
diseasePartZDto.setParts(partZ);
|
|
-//
|
|
|
|
-// List<DiseasePart> diseasePartQList = diseasePartMapper.selectDiseasePartList(diseasePartZDto);
|
|
|
|
-// List<DiseasePart> diseasePartZList = diseasePartMapper.selectDiseasePartList(diseasePartZDto);
|
|
|
|
-// diseasePartQList.addAll(diseasePartZList);
|
|
|
|
|
|
|
|
- return null;
|
|
|
|
|
|
+ List<DiseasePart> diseasePartQList = new ArrayList<DiseasePart>();
|
|
|
|
+ List<DiseasePart> diseasePartZList = new ArrayList<DiseasePart>();
|
|
|
|
+ List<DiseasePart> diseasePartAllList = new ArrayList<DiseasePart>();
|
|
|
|
+ if (partQ.size() > 0) {
|
|
|
|
+ diseasePartQList = diseasePartMapper.selectDiseasePartList(diseasePartQDto);
|
|
|
|
+ diseasePartAllList.addAll(diseasePartQList);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (partZ.size() > 0) {
|
|
|
|
+ diseasePartZList = diseasePartMapper.selectDiseasePartList(diseasePartZDto);
|
|
|
|
+ diseasePartAllList.addAll(diseasePartZList);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //五行得出疾病
|
|
|
|
+ List<DiseasePart> fivePartList = new ArrayList<DiseasePart>();
|
|
|
|
+ Map<String,Integer> fiveCount = this.getGanZhiRowVoCount(ganZhiDto);
|
|
|
|
+ for (String key : fiveCount.keySet()) {
|
|
|
|
+ int count = fiveCount.get(key);
|
|
|
|
+ if(count>=3) {
|
|
|
|
+ List<String> partList = shiShenConfig.getFiveBuWei().get(key);
|
|
|
|
+ DiseasePartDto fivePartDto = new DiseasePartDto();
|
|
|
|
+ fivePartDto.setSex(sex);
|
|
|
|
+ fivePartDto.setParts(partList);
|
|
|
|
+ fivePartList = diseasePartMapper.selectDiseasePartList(fivePartDto);
|
|
|
|
+ diseasePartAllList.addAll(fivePartList);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return diseasePartAllList;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -749,13 +773,13 @@ public class GanZhiServiceImpl extends ServiceImpl<GanZhiMapper, GanZhi> impleme
|
|
if ("土".equals(five)) {
|
|
if ("土".equals(five)) {
|
|
if (huoCount > shuiCount) {
|
|
if (huoCount > shuiCount) {
|
|
String name = list.get(i).getName();
|
|
String name = list.get(i).getName();
|
|
- if("戌".equals(name) || "未".equals(name)) {
|
|
|
|
|
|
+ if ("戌".equals(name) || "未".equals(name)) {
|
|
Integer fiveC = fiveCount.get("火") + 1;
|
|
Integer fiveC = fiveCount.get("火") + 1;
|
|
fiveCount.put("火", fiveC);
|
|
fiveCount.put("火", fiveC);
|
|
}
|
|
}
|
|
} else if (huoCount < shuiCount) {
|
|
} else if (huoCount < shuiCount) {
|
|
String name = list.get(i).getName();
|
|
String name = list.get(i).getName();
|
|
- if("辰".equals(name) || "丑".equals(name)) {
|
|
|
|
|
|
+ if ("辰".equals(name) || "丑".equals(name)) {
|
|
Integer fiveC = fiveCount.get("水") + 1;
|
|
Integer fiveC = fiveCount.get("水") + 1;
|
|
fiveCount.put("水", fiveC);
|
|
fiveCount.put("水", fiveC);
|
|
}
|
|
}
|
|
@@ -770,20 +794,20 @@ public class GanZhiServiceImpl extends ServiceImpl<GanZhiMapper, GanZhi> impleme
|
|
int huoCount2 = fiveCount.get("火");
|
|
int huoCount2 = fiveCount.get("火");
|
|
int shuiCoun2 = fiveCount.get("水");
|
|
int shuiCoun2 = fiveCount.get("水");
|
|
|
|
|
|
- Map<String,Object> zaoShiMap = new TreeMap<String,Object>();
|
|
|
|
|
|
+ Map<String, Object> zaoShiMap = new TreeMap<String, Object>();
|
|
zaoShiMap.putAll(fiveCount);
|
|
zaoShiMap.putAll(fiveCount);
|
|
|
|
|
|
|
|
|
|
- if(huoCount2-shuiCoun2>=2) { //火过旺
|
|
|
|
- zaoShiMap.put("jieshi","过于干燥,火特别多,性情比较暴躁,容易上火,内心上火容易产生无名火,容易被“点燃”生气,身体也容易上火。");
|
|
|
|
- } else if (huoCount2-shuiCoun2==1) { //火轻微过旺
|
|
|
|
- zaoShiMap.put("jieshi","偏干燥,火特别多,性情相对比较急躁。");
|
|
|
|
- } else if (huoCount2-shuiCoun2<=-2) {
|
|
|
|
- zaoShiMap.put("jieshi","过于湿润,大便不成形,湿气太重了,比较会容易肚子,手脚冰凉,气血不活。");
|
|
|
|
- } else if (huoCount2-shuiCoun2==-1) {
|
|
|
|
- zaoShiMap.put("jieshi","偏湿润,大便不成形,湿气较重,气血不活。");
|
|
|
|
- } else if (huoCount2-shuiCoun2==0){
|
|
|
|
- zaoShiMap.put("jieshi","各个宫位,燥湿达到平衡。不会过湿,过燥。");
|
|
|
|
|
|
+ if (huoCount2 - shuiCoun2 >= 2) { //火过旺
|
|
|
|
+ zaoShiMap.put("jieshi", "过于干燥,火特别多,性情比较暴躁,容易上火,内心上火容易产生无名火,容易被“点燃”生气,身体也容易上火。");
|
|
|
|
+ } else if (huoCount2 - shuiCoun2 == 1) { //火轻微过旺
|
|
|
|
+ zaoShiMap.put("jieshi", "偏干燥,火特别多,性情相对比较急躁。");
|
|
|
|
+ } else if (huoCount2 - shuiCoun2 <= -2) {
|
|
|
|
+ zaoShiMap.put("jieshi", "过于湿润,大便不成形,湿气太重了,比较会容易肚子,手脚冰凉,气血不活。");
|
|
|
|
+ } else if (huoCount2 - shuiCoun2 == -1) {
|
|
|
|
+ zaoShiMap.put("jieshi", "偏湿润,大便不成形,湿气较重,气血不活。");
|
|
|
|
+ } else if (huoCount2 - shuiCoun2 == 0) {
|
|
|
|
+ zaoShiMap.put("jieshi", "各个宫位,燥湿达到平衡。不会过湿,过燥。");
|
|
}
|
|
}
|
|
|
|
|
|
return zaoShiMap;
|
|
return zaoShiMap;
|