zhangbin 1 سال پیش
والد
کامیت
af00cf77e4

+ 10 - 8
xpgx-admin/src/main/java/com/miaxis/app/controller/gan/GanZhiController.java

@@ -3,19 +3,23 @@ package com.miaxis.app.controller.gan;
 import com.miaxis.common.constant.Constants;
 import com.miaxis.common.core.controller.BaseController;
 import com.miaxis.common.core.domain.Response;
-import com.miaxis.common.core.page.ResponsePageInfo;
 import com.miaxis.common.utils.DateUtils;
 import com.miaxis.disease.domain.DiseasePart;
-import com.miaxis.gan.domain.GanZhi;
 import com.miaxis.gan.dto.GanZhiDto;
 import com.miaxis.gan.dto.LiuNianDto;
-import com.miaxis.gan.dto.LiuNianDto;
 import com.miaxis.gan.service.IGanZhiService;
-import com.miaxis.gan.vo.*;
+import com.miaxis.gan.vo.GanZhiKongWangVo;
+import com.miaxis.gan.vo.GanZhiNaYinVo;
+import com.miaxis.gan.vo.GanZhiRowVo;
+import com.miaxis.gan.vo.GanZhiVo;
 import com.nlf.calendar.Lunar;
-import io.swagger.annotations.*;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.ModelAttribute;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import java.util.List;
 import java.util.Map;
@@ -84,8 +88,6 @@ public class GanZhiController extends BaseController {
 
 
 
-
-
         Map<String, Integer> fiveCountMap = ganZhiService.getGanZhiRowVoCount(ganZhiDto);
         List<GanZhiNaYinVo> ganZhiNaYinVoList = ganZhiService.selectGanZhiNaYinList(ganZhiDto);
         List<GanZhiKongWangVo> ganZhiKongWangVoList = ganZhiService.selectGanZhiKongWangList(ganZhiDto);

+ 36 - 10
xpgx-service/src/main/java/com/miaxis/gan/service/impl/GanZhiServiceImpl.java

@@ -701,7 +701,7 @@ public class GanZhiServiceImpl extends ServiceImpl<GanZhiMapper, GanZhi> impleme
             int daYunCount = 0;
             double dayDiff = Math.abs(list.get(1).getDaysDifference());
             double qiYunSuiDB = (dayDiff / 3);  //计算起运岁数
-            int qiYunSui = (int)Math.ceil(qiYunSuiDB);
+            int qiYunSui = (int) Math.ceil(qiYunSuiDB);
             System.out.println("大运顺起运岁数:" + qiYunSui);
 
             int year = lunar.getYear() + qiYunSui;
@@ -738,7 +738,7 @@ public class GanZhiServiceImpl extends ServiceImpl<GanZhiMapper, GanZhi> impleme
             int daYunCount = 0;
             double dayDiff = Math.abs(list.get(0).getDaysDifference());
             double qiYunSuiDB = (dayDiff / 3);  //计算起运岁数
-            int qiYunSui = (int)Math.ceil(qiYunSuiDB);
+            int qiYunSui = (int) Math.ceil(qiYunSuiDB);
             System.out.println("大运顺起运岁数:" + qiYunSui);
 
             int year = lunar.getYear() + qiYunSui;
@@ -1094,24 +1094,50 @@ public class GanZhiServiceImpl extends ServiceImpl<GanZhiMapper, GanZhi> impleme
         String monthGan = list.get(2).getShiShen1();
         String timeGan = list.get(6).getShiShen1();
 
+        String geju = null;
 
         if (list.get(3).getShiShen1() != null && yearGan.contains(list.get(3).getShiShen1())) { //月令十神1在 年干透出
-
+            geju = list.get(3).getShiShen1();
         } else if (list.get(3).getShiShen1() != null && monthGan.contains(list.get(3).getShiShen1())) { //月令十神1在 月干透出
-
+            geju = list.get(3).getShiShen1();
         } else if (list.get(3).getShiShen1() != null && timeGan.contains(list.get(3).getShiShen1())) { //月令十神1在 时干透出
-
+            geju = list.get(3).getShiShen1();
         } else if (list.get(3).getShiShen2() != null && yearGan.contains(list.get(3).getShiShen2())) { //月令十神2在 年干透出
-
+            geju = list.get(3).getShiShen2();
         } else if (list.get(3).getShiShen2() != null && monthGan.contains(list.get(3).getShiShen2())) { //月令十神2在 月干透出
-
+            geju = list.get(3).getShiShen2();
         } else if (list.get(3).getShiShen2() != null && timeGan.contains(list.get(3).getShiShen2())) { //月令十神2在 时干透出
-
+            geju = list.get(3).getShiShen2();
         } else if (list.get(3).getShiShen3() != null && yearGan.contains(list.get(3).getShiShen3())) { //月令十神3在 年干透出
-
+            geju = list.get(3).getShiShen3();
         } else if (list.get(3).getShiShen3() != null && monthGan.contains(list.get(3).getShiShen3())) { //月令十神3在 月干透出
-
+            geju = list.get(3).getShiShen3();
         } else if (list.get(3).getShiShen3() != null && timeGan.contains(list.get(3).getShiShen3())) { //月令十神3在 时干透出
+            geju = list.get(3).getShiShen3();
+        } else {
+            geju = null;
+        }
+
+        if (geju == null) {
+            if (maxTianGan == 1) {
+                geju = yearGan;
+            } else if (maxTianGan == 2) {
+                geju = monthGan;
+            } else if (maxTianGan == 3) {
+                geju = timeGan;
+            }
+        }
+
+        if (qr.contains("强")) {
+
+        } else if (qr.contains("弱")) {
+
+        }
+
+        String sex = list.get(4).getShiShen1();
+        if ("元男".equals(sex)) {
+
+        } else if ("元女".equals(sex)) {
 
         }