|
@@ -963,4 +963,157 @@ public class GanZhiServiceImpl extends ServiceImpl<GanZhiMapper, GanZhi> impleme
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 返回能量最强的天干
|
|
|
+ *
|
|
|
+ * @param ganZhiDto
|
|
|
+ * @return 1 天干 2月干 3时干
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public int getMaxTianGan(GanZhiDto ganZhiDto) {
|
|
|
+ /*-------------------能量最强天干---------------------*/
|
|
|
+ List<GanZhiRowVo> list = this.getGanZhiRowVoList(ganZhiDto);
|
|
|
+
|
|
|
+ //年干 得分
|
|
|
+// int yearGanQR = ShiShenConfig.generateRelationship(list.get(0).getFive(), list.get(0).getFive());
|
|
|
+ int yearZhiQR1 = ShiShenConfig.generateRelationship(list.get(0).getFive(), list.get(1).getFive());
|
|
|
+ int monthGanQR1 = ShiShenConfig.generateRelationship(list.get(0).getFive(), list.get(2).getFive());
|
|
|
+ int monthZhiQR1 = ShiShenConfig.generateRelationship(list.get(0).getFive(), list.get(3).getFive());
|
|
|
+ int dayGanQR1 = ShiShenConfig.generateRelationship(list.get(0).getFive(), list.get(4).getFive());
|
|
|
+ int dayZhiQR1 = ShiShenConfig.generateRelationship(list.get(0).getFive(), list.get(5).getFive());
|
|
|
+ int timeGanQR1 = ShiShenConfig.generateRelationship(list.get(0).getFive(), list.get(6).getFive());
|
|
|
+ int timeZhiQR1 = ShiShenConfig.generateRelationship(list.get(0).getFive(), list.get(7).getFive());
|
|
|
+
|
|
|
+ int yearGanScore = 0;
|
|
|
+ if (yearZhiQR1 > 0) {
|
|
|
+ yearGanScore += 12;
|
|
|
+ }
|
|
|
+ if (monthGanQR1 > 0) {
|
|
|
+ yearGanScore += 12;
|
|
|
+ }
|
|
|
+ if (monthZhiQR1 > 0) {
|
|
|
+ yearGanScore += 40;
|
|
|
+ }
|
|
|
+ if (dayGanQR1 > 0) {
|
|
|
+ yearGanScore += 12;
|
|
|
+ }
|
|
|
+ if (dayZhiQR1 > 0) {
|
|
|
+ yearGanScore += 12;
|
|
|
+ }
|
|
|
+ if (timeGanQR1 > 0) {
|
|
|
+ yearGanScore += 8;
|
|
|
+ }
|
|
|
+ if (timeZhiQR1 > 0) {
|
|
|
+ yearGanScore += 4;
|
|
|
+ }
|
|
|
+
|
|
|
+ /*-------------------能量最强天干---------------------*/
|
|
|
+
|
|
|
+ //月干 得分
|
|
|
+ int yearGanQR2 = ShiShenConfig.generateRelationship(list.get(2).getFive(), list.get(0).getFive());
|
|
|
+ int yearZhiQR2 = ShiShenConfig.generateRelationship(list.get(2).getFive(), list.get(1).getFive());
|
|
|
+// int monthGanQR2 = ShiShenConfig.generateRelationship(list.get(2).getFive(), list.get(2).getFive());
|
|
|
+ int monthZhiQR2 = ShiShenConfig.generateRelationship(list.get(2).getFive(), list.get(3).getFive());
|
|
|
+ int dayGanQR2 = ShiShenConfig.generateRelationship(list.get(2).getFive(), list.get(4).getFive());
|
|
|
+ int dayZhiQR2 = ShiShenConfig.generateRelationship(list.get(2).getFive(), list.get(5).getFive());
|
|
|
+ int timeGanQR2 = ShiShenConfig.generateRelationship(list.get(2).getFive(), list.get(6).getFive());
|
|
|
+ int timeZhiQR2 = ShiShenConfig.generateRelationship(list.get(2).getFive(), list.get(7).getFive());
|
|
|
+
|
|
|
+ int monthGanScore = 0;
|
|
|
+ if (yearGanQR2 > 0) {
|
|
|
+ monthGanScore += 12;
|
|
|
+ }
|
|
|
+ if (yearZhiQR2 > 0) {
|
|
|
+ monthGanScore += 12;
|
|
|
+ }
|
|
|
+ if (monthZhiQR2 > 0) {
|
|
|
+ monthGanScore += 40;
|
|
|
+ }
|
|
|
+ if (dayGanQR2 > 0) {
|
|
|
+ monthGanScore += 12;
|
|
|
+ }
|
|
|
+ if (dayZhiQR2 > 0) {
|
|
|
+ monthGanScore += 12;
|
|
|
+ }
|
|
|
+ if (timeGanQR2 > 0) {
|
|
|
+ monthGanScore += 8;
|
|
|
+ }
|
|
|
+ if (timeZhiQR2 > 0) {
|
|
|
+ monthGanScore += 4;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ //时干 得分
|
|
|
+ int yearGanQR3 = ShiShenConfig.generateRelationship(list.get(6).getFive(), list.get(0).getFive());
|
|
|
+ int yearZhiQR3 = ShiShenConfig.generateRelationship(list.get(6).getFive(), list.get(1).getFive());
|
|
|
+ int monthGanQR3 = ShiShenConfig.generateRelationship(list.get(2).getFive(), list.get(2).getFive());
|
|
|
+ int monthZhiQR3 = ShiShenConfig.generateRelationship(list.get(6).getFive(), list.get(3).getFive());
|
|
|
+ int dayGanQR3 = ShiShenConfig.generateRelationship(list.get(6).getFive(), list.get(4).getFive());
|
|
|
+ int dayZhiQR3 = ShiShenConfig.generateRelationship(list.get(6).getFive(), list.get(5).getFive());
|
|
|
+ //int timeGanQR3 = ShiShenConfig.generateRelationship(list.get(6).getFive(), list.get(6).getFive());
|
|
|
+ int timeZhiQR3 = ShiShenConfig.generateRelationship(list.get(6).getFive(), list.get(7).getFive());
|
|
|
+
|
|
|
+ int timeGanScore = 0;
|
|
|
+ if (yearGanQR3 > 0) {
|
|
|
+ timeGanScore += 8;
|
|
|
+ }
|
|
|
+ if (yearZhiQR3 > 0) {
|
|
|
+ timeGanScore += 4;
|
|
|
+ }
|
|
|
+ if (monthGanQR3 > 0) {
|
|
|
+ timeGanScore += 40;
|
|
|
+ }
|
|
|
+ if (monthZhiQR3 > 0) {
|
|
|
+ timeGanScore += 12;
|
|
|
+ }
|
|
|
+ if (dayGanQR3 > 0) {
|
|
|
+ timeGanScore += 12;
|
|
|
+ }
|
|
|
+ if (dayZhiQR3 > 0) {
|
|
|
+ timeGanScore += 12;
|
|
|
+ }
|
|
|
+ if (timeZhiQR3 > 0) {
|
|
|
+ timeGanScore += 12;
|
|
|
+ }
|
|
|
+ int maxGan = ShiShenConfig.getMax(yearGanScore, monthGanScore, timeGanScore);
|
|
|
+ ganZhiDto.setMaxGan(maxGan);
|
|
|
+ return maxGan;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String,String> getGeJu(List<GanZhiRowVo> list,int maxTianGan, String qr) {
|
|
|
+
|
|
|
+ String yearGan = list.get(0).getShiShen1();
|
|
|
+ String monthGan = list.get(2).getShiShen1();
|
|
|
+ String timeGan = list.get(6).getShiShen1();
|
|
|
+
|
|
|
+
|
|
|
+ if (list.get(3).getShiShen1() != null && yearGan.contains(list.get(3).getShiShen1())) { //月令十神1在 年干透出
|
|
|
+
|
|
|
+ } else if (list.get(3).getShiShen1() != null && monthGan.contains(list.get(3).getShiShen1())) { //月令十神1在 月干透出
|
|
|
+
|
|
|
+ } else if (list.get(3).getShiShen1() != null && timeGan.contains(list.get(3).getShiShen1())) { //月令十神1在 时干透出
|
|
|
+
|
|
|
+ } else if (list.get(3).getShiShen2() != null && yearGan.contains(list.get(3).getShiShen2())) { //月令十神2在 年干透出
|
|
|
+
|
|
|
+ } else if (list.get(3).getShiShen2() != null && monthGan.contains(list.get(3).getShiShen2())) { //月令十神2在 月干透出
|
|
|
+
|
|
|
+ } else if (list.get(3).getShiShen2() != null && timeGan.contains(list.get(3).getShiShen2())) { //月令十神2在 时干透出
|
|
|
+
|
|
|
+ } else if (list.get(3).getShiShen3() != null && yearGan.contains(list.get(3).getShiShen3())) { //月令十神3在 年干透出
|
|
|
+
|
|
|
+ } else if (list.get(3).getShiShen3() != null && monthGan.contains(list.get(3).getShiShen3())) { //月令十神3在 月干透出
|
|
|
+
|
|
|
+ } else if (list.get(3).getShiShen3() != null && timeGan.contains(list.get(3).getShiShen3())) { //月令十神3在 时干透出
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|