22285461@qq.com 3 месяцев назад
Сommit
8f48632c61
73 измененных файлов с 12213 добавлено и 0 удалено
  1. BIN
      .DS_Store
  2. BIN
      .idea/.DS_Store
  3. 8 0
      .idea/.gitignore
  4. 12 0
      .idea/dataSources.xml
  5. 10 0
      .idea/inspectionProfiles/Project_Default.xml
  6. 6 0
      .idea/inspectionProfiles/profiles_settings.xml
  7. 7 0
      .idea/misc.xml
  8. 8 0
      .idea/modules.xml
  9. 30 0
      .idea/yixue_gzh_dj.iml
  10. 0 0
      db.sqlite3
  11. 22 0
      manage.py
  12. 0 0
      myapp/__init__.py
  13. 3 0
      myapp/admin.py
  14. 6 0
      myapp/apps.py
  15. 0 0
      myapp/migrations/__init__.py
  16. 10 0
      myapp/models.py
  17. 9 0
      myapp/serializers.py
  18. 3 0
      myapp/tests.py
  19. 6 0
      myapp/urls.py
  20. 23 0
      myapp/views.py
  21. 1 0
      static/MP_verify_I9ioRqipbykfNMHO.txt
  22. 49 0
      tools.py
  23. BIN
      wx/.DS_Store
  24. 3 0
      wx/LocalModels.py
  25. 0 0
      wx/__init__.py
  26. 3 0
      wx/admin.py
  27. 6 0
      wx/apps.py
  28. 309 0
      wx/dbTools.py
  29. 130 0
      wx/logic.py
  30. 0 0
      wx/migrations/__init__.py
  31. 3 0
      wx/models.py
  32. 17 0
      wx/parsers.py
  33. 14 0
      wx/templates/wx/user_view.html
  34. 3 0
      wx/tests.py
  35. 19 0
      wx/urls.py
  36. 519 0
      wx/views.py
  37. 204 0
      wx/wxModels.py
  38. BIN
      yixue/.DS_Store
  39. 5393 0
      yixue/Configs.py
  40. 14 0
      yixue/DataCenter.py
  41. 386 0
      yixue/GeJuLogic.py
  42. 509 0
      yixue/Models.py
  43. 144 0
      yixue/QuShiLogic.py
  44. 186 0
      yixue/SiZhuLogic.py
  45. 164 0
      yixue/ZhenDuanLogic.py
  46. 252 0
      yixue/geju/CalcXiongJi.py
  47. 21 0
      yixue/other/CalcNongLi.py
  48. 250 0
      yixue/sizhu/CalcDaYun.py
  49. 79 0
      yixue/sizhu/CalcGaoNeng.py
  50. 157 0
      yixue/sizhu/CalcLiuNian.py
  51. 215 0
      yixue/sizhu/CalcLiuRi.py
  52. 152 0
      yixue/sizhu/CalcLiuYue.py
  53. 117 0
      yixue/sizhu/CalcPower.py
  54. 106 0
      yixue/sizhu/CalcShenSha.py
  55. 183 0
      yixue/sizhu/CalcSiZhu.py
  56. 114 0
      yixue/sizhu/CalcSiZhuByTexts.py
  57. 176 0
      yixue/sizhu/CalcYinYuan.py
  58. 41 0
      yixue/sizhu/CheckMuKu.py
  59. 337 0
      yixue/zhenduan/AboutDaYun.py
  60. 310 0
      yixue/zhenduan/AboutGaoNeng.py
  61. 289 0
      yixue/zhenduan/AboutGeJu.py
  62. 105 0
      yixue/zhenduan/AboutJianKang.py
  63. 103 0
      yixue/zhenduan/AboutMenHu.py
  64. 396 0
      yixue/zhenduan/AboutQingGan.py
  65. 30 0
      yixue/zhenduan/AboutShenSha.py
  66. 225 0
      yixue/zhenduan/AboutWuXingShiShenZuoZhi.py
  67. 103 0
      yixue/zhenduan/AboutYinYuan.py
  68. 0 0
      yixue_gzh_dj/__init__.py
  69. 16 0
      yixue_gzh_dj/asgi.py
  70. 153 0
      yixue_gzh_dj/settings.py
  71. 27 0
      yixue_gzh_dj/urls.py
  72. 1 0
      yixue_gzh_dj/views.py
  73. 16 0
      yixue_gzh_dj/wsgi.py

BIN
.idea/.DS_Store


+ 8 - 0
.idea/.gitignore

@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml

+ 12 - 0
.idea/dataSources.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="DataSourceManagerImpl" format="xml" multifile-model="true">
+    <data-source source="LOCAL" name="remote_yixue_gzh" uuid="9c3a036f-f729-4da8-8d14-ceaed9659f18">
+      <driver-ref>mysql.8</driver-ref>
+      <synchronize>true</synchronize>
+      <jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
+      <jdbc-url>jdbc:mysql://test.db.cxhy.cn:3306/yixue_gzh</jdbc-url>
+      <working-dir>$ProjectFileDir$</working-dir>
+    </data-source>
+  </component>
+</project>

+ 10 - 0
.idea/inspectionProfiles/Project_Default.xml

@@ -0,0 +1,10 @@
+<component name="InspectionProjectProfileManager">
+  <profile version="1.0">
+    <option name="myName" value="Project Default" />
+    <inspection_tool class="DuplicatedCode" enabled="true" level="WEAK WARNING" enabled_by_default="true">
+      <Languages>
+        <language minSize="139" name="Python" />
+      </Languages>
+    </inspection_tool>
+  </profile>
+</component>

+ 6 - 0
.idea/inspectionProfiles/profiles_settings.xml

@@ -0,0 +1,6 @@
+<component name="InspectionProjectProfileManager">
+  <settings>
+    <option name="USE_PROJECT_PROFILE" value="false" />
+    <version value="1.0" />
+  </settings>
+</component>

+ 7 - 0
.idea/misc.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Black">
+    <option name="sdkName" value="Python 3.8 (yixue_gzh_dj)" />
+  </component>
+  <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (yixue_gzh_dj)" project-jdk-type="Python SDK" />
+</project>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/yixue_gzh_dj.iml" filepath="$PROJECT_DIR$/.idea/yixue_gzh_dj.iml" />
+    </modules>
+  </component>
+</project>

+ 30 - 0
.idea/yixue_gzh_dj.iml

@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+  <component name="FacetManager">
+    <facet type="django" name="Django">
+      <configuration>
+        <option name="rootFolder" value="$MODULE_DIR$" />
+        <option name="settingsModule" value="yixue_gzh_dj/settings.py" />
+        <option name="manageScript" value="$MODULE_DIR$/manage.py" />
+        <option name="environment" value="&lt;map/&gt;" />
+        <option name="doNotUseTestRunner" value="false" />
+        <option name="trackFilePattern" value="migrations" />
+      </configuration>
+    </facet>
+  </component>
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$">
+      <excludeFolder url="file://$MODULE_DIR$/.venv" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+  <component name="TemplatesService">
+    <option name="TEMPLATE_CONFIGURATION" value="Django" />
+    <option name="TEMPLATE_FOLDERS">
+      <list>
+        <option value="$MODULE_DIR$/templates" />
+      </list>
+    </option>
+  </component>
+</module>

+ 0 - 0
db.sqlite3


+ 22 - 0
manage.py

@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+"""Django's command-line utility for administrative tasks."""
+import os
+import sys
+
+
+def main():
+    """Run administrative tasks."""
+    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'yixue_gzh_dj.settings')
+    try:
+        from django.core.management import execute_from_command_line
+    except ImportError as exc:
+        raise ImportError(
+            "Couldn't import Django. Are you sure it's installed and "
+            "available on your PYTHONPATH environment variable? Did you "
+            "forget to activate a virtual environment?"
+        ) from exc
+    execute_from_command_line(sys.argv)
+
+
+if __name__ == '__main__':
+    main()

+ 0 - 0
myapp/__init__.py


+ 3 - 0
myapp/admin.py

@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.

+ 6 - 0
myapp/apps.py

@@ -0,0 +1,6 @@
+from django.apps import AppConfig
+
+
+class MyappConfig(AppConfig):
+    default_auto_field = 'django.db.models.BigAutoField'
+    name = 'myapp'

+ 0 - 0
myapp/migrations/__init__.py


+ 10 - 0
myapp/models.py

@@ -0,0 +1,10 @@
+from django.db import models
+
+# Create your models here.
+class MyRequest(models.Model):
+    id = models.IntegerField(primary_key=True)
+    name = models.CharField(max_length=10)
+    sexy = models.BooleanField(default=False)
+
+    def __str__(self):
+        return self.name +" "+ str(self.sexy)

+ 9 - 0
myapp/serializers.py

@@ -0,0 +1,9 @@
+from rest_framework import serializers
+
+from myapp.models import MyRequest
+
+
+class RequestSerializer(serializers.ModelSerializer):
+    class Meta:
+        model = MyRequest
+        fields = '__all__'

+ 3 - 0
myapp/tests.py

@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.

+ 6 - 0
myapp/urls.py

@@ -0,0 +1,6 @@
+from django.urls import path
+from .views import GetInfo
+
+urlpatterns = [
+    path("info", GetInfo.as_view(), name="info"),
+]

+ 23 - 0
myapp/views.py

@@ -0,0 +1,23 @@
+from django.shortcuts import render
+from rest_framework import generics, status
+from rest_framework.response import Response
+from rest_framework.views import APIView
+
+from myapp.models import MyRequest
+from myapp.serializers import RequestSerializer
+
+
+# Create your views here.
+class GetInfo(APIView):
+    def get(self, request):
+        data = {
+            "message": "Hello World get"
+        }
+        return Response(data)
+
+    def post(self, request):
+        data = {
+            "message": "Hello World post",
+            "received": request.data
+        }
+        return Response(data)

+ 1 - 0
static/MP_verify_I9ioRqipbykfNMHO.txt

@@ -0,0 +1 @@
+I9ioRqipbykfNMHO

+ 49 - 0
tools.py

@@ -0,0 +1,49 @@
+import json
+import xml.etree.ElementTree as ET
+
+import aiohttp
+import requests
+
+
+def _xml_to_dict(element):
+    if len(element) == 0:
+        return element.text
+    return {child.tag: _xml_to_dict(child) for child in element}
+
+
+def xml_parser(xml_str: str):
+    xml_root = ET.fromstring(xml_str)
+    obj = _xml_to_dict(xml_root)
+    return obj
+
+
+def xml_build(root_text: str, data: object):
+    root = ET.Element(root_text)
+    for key in data.__dir__():
+        if not key.startswith('__'):
+            value = getattr(data, key)
+            if not callable(value) and value is not None:
+                item = ET.SubElement(root, key)
+                item.text = str(value)
+    return root
+
+
+def xml_to_string(root: ET.Element):
+    return ET.tostring(root, encoding='utf-8').decode('utf-8')
+
+
+def __get_access_token__():
+    url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=wxf01ec97b45a4bc49&secret=ee1681fc5d4bfe8797de9c61ff15f08b"
+    rsp = requests.get(url)
+    obj = json.loads(rsp.text)
+    return obj['access_token']
+
+
+def sync_post(url: str, body: object):
+    return requests.post(url=url, json=body)
+
+
+async def post_as_normal(url: str, headers: object, body: object):
+    async with aiohttp.ClientSession() as session:
+        async with session.post(url, headers=headers, json=body) as response:
+            return await response.text()


+ 3 - 0
wx/LocalModels.py

@@ -0,0 +1,3 @@
+
+
+

+ 0 - 0
wx/__init__.py


+ 3 - 0
wx/admin.py

@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.

+ 6 - 0
wx/apps.py

@@ -0,0 +1,6 @@
+from django.apps import AppConfig
+
+
+class WxConfig(AppConfig):
+    default_auto_field = 'django.db.models.BigAutoField'
+    name = 'wx'

+ 309 - 0
wx/dbTools.py

@@ -0,0 +1,309 @@
+from typing import Any, Dict, Callable
+
+from sqlalchemy import create_engine, Integer, Column, String, Boolean, Float, DateTime, Date
+from sqlalchemy.ext.declarative import declarative_base
+from sqlalchemy.orm import sessionmaker
+
+engine = create_engine('mysql+pymysql://yixue_gzh:Lai123@test.db.cxhy.cn/yixue_gzh', pool_pre_ping=True)
+
+Base = declarative_base()
+
+
+def not_none_of_all(*args: Any):
+    result = True
+    for arg in args:
+        if arg is None:
+            result = False
+            break
+    return result
+
+
+class DBBase(Base):
+    __abstract__ = True
+
+    def __repr__(self):
+        result = self.__class__.__name__ + "("
+        for attr in self.__dict__:
+            if attr.startswith("_") or attr.startswith("__") or attr == "__tablename__":
+                continue
+            result += attr + "=" + str(getattr(self, attr)) + " "
+        result += ")"
+        return result
+
+    def to_json_object(self, **kwargs: Any):
+        obj = {}
+        for attr in self.__dict__:
+            if attr.startswith("_") or attr.startswith("__") or attr == "__tablename__":
+                continue
+            obj[attr] = getattr(self, attr)
+        for key, value in kwargs.items():
+            obj[key] = value
+        return obj
+
+    @classmethod
+    def new_session(cls):
+        Session = sessionmaker(bind=engine)
+        session = Session()
+        return session
+
+    @classmethod
+    def insert(cls, **kwargs: Any):
+        ss = cls.new_session()
+        try:
+            obj = cls()
+            for key in kwargs.keys():
+                if hasattr(obj, key):
+                    setattr(obj, key, kwargs[key])
+            ss.add(obj)
+            ss.commit()
+        finally:
+            ss.close()
+
+    @classmethod
+    def insert_all(cls, items: []):
+        ss = cls.new_session()
+        try:
+            lst = []
+            for item in items:
+                obj = cls()
+                for key in item.keys():
+                    if hasattr(obj, key):
+                        setattr(obj, key, item[key])
+                lst.append(obj)
+            ss.add_all(lst)
+            ss.commit()
+        finally:
+            ss.close()
+
+    @classmethod
+    def delete_by(cls, **kwargs: Any):
+        ss = cls.new_session()
+        try:
+            data = ss.query(cls).filter_by(**kwargs).all()
+            for dt in data:
+                ss.delete(dt)
+            ss.commit()
+        finally:
+            ss.close()
+
+    @classmethod
+    def query_by(cls, **kwargs: Any):
+        ss = cls.new_session()
+        try:
+            data = ss.query(cls).filter_by(**kwargs).all()
+            return data
+        finally:
+            ss.close()
+
+    @classmethod
+    def query_first_by(cls, **kwargs: Any):
+        ss = cls.new_session()
+        try:
+            data = ss.query(cls).filter_by(**kwargs).first()
+            return data
+        finally:
+            ss.close()
+
+    @classmethod
+    def check_exist(cls, **kwargs: Any):
+        return cls.query_first_by(**kwargs) is not None
+
+    @classmethod
+    def update(cls, conditions: Callable, values: Dict[str, Any]):
+        # DBSysUser.update(conditions=(DBSysUser.id == user.id), values={"finger": finger})
+        session = cls.new_session()
+        try:
+            session.query(cls).filter(conditions).update(values)
+            session.commit()
+        finally:
+            session.close()
+
+
+class DB_WX_GZH_User(DBBase):
+    __tablename__ = 'wx_gzh_user'
+    id = Column(Integer, primary_key=True)
+    open_id = Column(String)
+    user_name = Column(String)
+    is_man = Column(Boolean)
+    date_mode = Column(Integer)
+    born_year = Column(Integer)
+    born_month = Column(Integer)
+    born_day = Column(Integer)
+    born_hour = Column(Integer)
+    born_minute = Column(Integer)
+    know_time = Column(Integer)
+    born_sheng = Column(String)
+    born_shi = Column(String)
+    born_qu = Column(String)
+    nian_gan = Column(String)
+    nian_zhi = Column(String)
+    yue_gan = Column(String)
+    yue_zhi = Column(String)
+    ri_gan = Column(String)
+    ri_zhi = Column(String)
+    shi_gan = Column(String)
+    shi_zhi = Column(String)
+    nian_cang1 = Column(String)
+    nian_cang2 = Column(String)
+    nian_cang3 = Column(String)
+    yue_cang1 = Column(String)
+    yue_cang2 = Column(String)
+    yue_cang3 = Column(String)
+    ri_cang1 = Column(String)
+    ri_cang2 = Column(String)
+    ri_cang3 = Column(String)
+    shi_cang1 = Column(String)
+    shi_cang2 = Column(String)
+    shi_cang3 = Column(String)
+
+    def is_know_time(self):
+        return self.know_time == 0
+
+    def has_sizhu(self):
+        return not_none_of_all(
+            self.nian_gan, self.nian_zhi,
+            self.yue_gan, self.yue_zhi,
+            self.ri_gan, self.ri_zhi,
+            self.shi_gan, self.shi_zhi)
+
+    def get_sizhu_text(self):
+        return self.nian_gan + self.nian_zhi + " " + self.yue_gan + self.yue_zhi + " " + self.ri_gan + self.ri_zhi + " " + self.shi_gan + self.shi_zhi
+
+
+class DBWanNianLi(DBBase):
+    __tablename__ = 'wan_nian_li'
+    id = Column(Integer, primary_key=True)
+    nian = Column(Integer)
+    yue = Column(Integer)
+    ri = Column(Integer)
+    nian_gan = Column(String)
+    nian_zhi = Column(String)
+    yue_gan = Column(String)
+    yue_zhi = Column(String)
+    ri_gan = Column(String)
+    ri_zhi = Column(String)
+
+
+class DBJieQi(DBBase):
+    __tablename__ = 'jie_qi'
+    id = Column(Integer, primary_key=True)
+    nian = Column(Integer)
+    chuxi = Column(String)
+    lichun = Column(String)
+    jingzhe = Column(String)
+    qingming = Column(String)
+    lixia = Column(String)
+    mangzhong = Column(String)
+    xiaoshu = Column(String)
+    liqiu = Column(String)
+    bailu = Column(String)
+    hanlu = Column(String)
+    lidong = Column(String)
+    daxue = Column(String)
+    xiaohan = Column(String)
+    yiyue = Column(String)
+    yiri = Column(String)
+
+
+class DBTaiYangShi(DBBase):
+    __tablename__ = 'tai_yang_shi'
+    id = Column(Integer, primary_key=True)
+    month = Column(Integer)
+    day = Column(Integer)
+    diff = Column(Integer)
+
+
+class DBAreaInfo(DBBase):
+    __tablename__ = 'area_info'
+    id = Column(Integer, primary_key=True)
+    sheng = Column(String)
+    shi = Column(String)
+    qu = Column(String)
+    weidu = Column(Float)
+    jingdu = Column(Float)
+    hour = Column(Integer)
+    minute = Column(Integer)
+    second = Column(Integer)
+    shi_pinyin = Column(String)
+    qu_pinyin = Column(String)
+
+
+class DBDaYunNan(DBBase):
+    __tablename__ = 'dayun_nan'
+    id = Column(Integer, primary_key=True)
+    time = Column(DateTime)
+    year = Column(Integer)
+    month = Column(Integer)
+    day = Column(Integer)
+    hour = Column(Integer)
+    sign = Column(String)
+
+
+class DBDaYunNv(DBBase):
+    __tablename__ = 'dayun_nv'
+    id = Column(Integer, primary_key=True)
+    time = Column(DateTime)
+    year = Column(Integer)
+    month = Column(Integer)
+    day = Column(Integer)
+    hour = Column(Integer)
+    sign = Column(String)
+
+
+class DBNongLi(DBBase):
+    __tablename__ = 'nong_li'
+    id = Column(Integer, primary_key=True)
+    new_date = Column(Date)
+    month = Column(String)
+    day = Column(String)
+    year = Column(Integer)
+
+
+class DBYiXueUser(DBBase):
+    __tablename__ = 'yixue_user'
+    id = Column(Integer, primary_key=True)
+    name = Column(String)
+    isMan = Column(Boolean)
+    dateMode = Column(Integer)
+    year = Column(Integer)
+    month = Column(Integer)
+    day = Column(Integer)
+    hourMode = Column(Integer)
+    hour = Column(Integer)
+    minute = Column(Integer)
+    areaMode = Column(Integer)
+    sheng = Column(String)
+    shi = Column(String)
+    qu = Column(String)
+    extra = Column(String)
+    nongli_year = Column(Integer)
+    nongli_month = Column(String)
+    nongli_day = Column(String)
+    req_nian_gan = Column(String)
+    req_nian_zhi = Column(String)
+    req_yue_gan = Column(String)
+    req_yue_zhi = Column(String)
+    req_ri_gan = Column(String)
+    req_ri_zhi = Column(String)
+    req_shi_gan = Column(String)
+    req_shi_zhi = Column(String)
+    rsp_nian_gan = Column(String)
+    rsp_nian_zhi = Column(String)
+    rsp_yue_gan = Column(String)
+    rsp_yue_zhi = Column(String)
+    rsp_ri_gan = Column(String)
+    rsp_ri_zhi = Column(String)
+    rsp_shi_gan = Column(String)
+    rsp_shi_zhi = Column(String)
+    owner_id = Column(Integer)
+
+
+class DBSysUser(DBBase):
+    __tablename__ = 'sys_user'
+    id = Column(Integer, primary_key=True)
+    name = Column(String)
+    account = Column(String)
+    password = Column(String)
+    finger = Column(String)
+    dev_change = Column(Integer)
+    allow_change_dev = Column(Boolean)

+ 130 - 0
wx/logic.py

@@ -0,0 +1,130 @@
+from wx.dbTools import DB_WX_GZH_User
+from yixue import SiZhuLogic, GeJuLogic, ZhenDuanLogic
+from yixue.Models import BaZi, SiZhuResult
+from yixue.other import CalcNongLi
+from yixue.sizhu import CalcSiZhuByTexts
+
+
+def get_lucky_day(openid: str):
+    dt = DB_WX_GZH_User.query_first_by(open_id=openid)
+    if dt is None:
+        return "未找到您的信息,请先补充个人信息。https://yixuegzhweb.cxhy.cn/applyUserInfo/?user=" + openid
+    else:
+        # 没有四柱信息则先计算四柱并保存
+        if not dt.has_sizhu():
+            sizhuResult = SiZhuLogic.calc_si_zhu(dt.born_year, dt.born_month, dt.born_day,
+                                                 dt.is_know_time(), dt.born_hour, dt.born_minute,
+                                                 dt.born_sheng, dt.born_shi, dt.born_qu)
+            # test
+            # sizhuTexts = ["甲", "子", "甲", "寅", "甲", "丑", "甲", "未"]
+            print(sizhuResult)
+
+            try:
+                bazi = BaZi.build(sizhuResult)
+                bazi.is_man = dt.is_man
+                SiZhuLogic.calc_wu_xing(bazi)
+                SiZhuLogic.calc_yin_yang(bazi)
+                SiZhuLogic.calc_shi_shen(bazi)
+                SiZhuLogic.calc_cang_gans(bazi)
+                SiZhuLogic.calc_zhang_shengs(bazi)
+                SiZhuLogic.calc_da_yun(bazi)
+
+                SiZhuLogic.calc_gao_nengs(bazi)
+                SiZhuLogic.calc_counter_and_steps(bazi)
+                SiZhuLogic.calc_wang_shuai(bazi)
+                SiZhuLogic.check_muku(bazi)
+
+                # 大运流年
+
+                # 高能:大运流年
+                # 高能:冲穿的力量对比
+                # 神煞
+                # 凶吉
+                # 性格诊断,链接、页面、分享
+                # 运势、链接、页面、分享
+                # 接口独立出来
+                # 前端拿不到openid的处理:链接有误,转客服
+                print(bazi)
+            except Exception as e:
+                print(e)
+
+            # 计算藏干
+            ss = DB_WX_GZH_User.new_session()
+            user = ss.query(DB_WX_GZH_User).filter_by(open_id=openid).first()
+            if user is not None:
+                pass
+                # user.set_sizhu_texts(sizhuTexts)
+                # ss.commit()
+            ss.close()
+
+        # 有四柱信息,则根据当前的年月日计算高能关系
+        msg = "您的四柱是: "
+        return msg
+
+
+def calc_si_zhu(year: int, month: int, day: int, hour: int, minute: int, sheng: str, shi: str, qu: str):
+    know_time = hour is not None
+    result = SiZhuLogic.calc_si_zhu(year, month, day, know_time, hour, minute, sheng, shi, qu)
+    return result
+
+
+def calc_nong_li(year: int, month: str, day: str):
+    return CalcNongLi.run(year, month, day)
+
+
+def check_date_by_texts(niangan: str, nianzhi: str, yuegan: str, yuezhi: str, rigan: str, rizhi: str, shigan: str,
+                        shizhi: str):
+    return CalcSiZhuByTexts.run(niangan, nianzhi, yuegan, yuezhi, rigan, rizhi, shigan, shizhi)
+
+
+def build_bazi(sizhuResult: SiZhuResult, isMan: bool):
+    bazi = BaZi.build(sizhuResult)
+    bazi.is_man = isMan
+    SiZhuLogic.calc_wu_xing(bazi)
+    SiZhuLogic.calc_yin_yang(bazi)
+    SiZhuLogic.calc_shi_shen(bazi)
+    SiZhuLogic.calc_cang_gans(bazi)
+    SiZhuLogic.calc_zhang_shengs(bazi)
+    # 禄神是在神煞里面有,这里不单独再看了
+    SiZhuLogic.calc_da_yun(bazi)
+    SiZhuLogic.calc_liu_nian(bazi)
+    SiZhuLogic.calc_liu_yue(bazi)
+    SiZhuLogic.calc_liu_ri(bazi)
+
+    SiZhuLogic.calc_gao_nengs(bazi)
+    SiZhuLogic.calc_counter_and_steps(bazi)
+    SiZhuLogic.calc_wang_shuai(bazi)
+    SiZhuLogic.check_muku(bazi)
+    SiZhuLogic.check_shen_sha(bazi)
+
+    GeJuLogic.calc_tian_gan(bazi)
+    GeJuLogic.calc_di_zhi(bazi)
+    GeJuLogic.count_geju_score(bazi)
+    GeJuLogic.count_dayun_geju_score(bazi)
+    GeJuLogic.count_liunian_geju_score(bazi)
+    GeJuLogic.check_xiong_ji(bazi)
+
+    SiZhuLogic.calc_dayun_gaoneng(bazi)
+    SiZhuLogic.calc_dayun_shensha(bazi)
+    SiZhuLogic.calc_liunian_gaoneng(bazi)
+    SiZhuLogic.calc_liunian_shensha(bazi)
+    SiZhuLogic.calc_liuyue_gaoneng(bazi)
+    SiZhuLogic.calc_liuyue_shensha(bazi)
+    SiZhuLogic.calc_liuri_gaoneng(bazi)
+    SiZhuLogic.calc_liuri_shensha(bazi)
+    SiZhuLogic.calc_yinyuan(bazi)
+
+    ZhenDuanLogic.calc_power_percentages(bazi)
+    ZhenDuanLogic.about_wuxing_shishen_zuozhi(bazi)
+    ZhenDuanLogic.about_menhu(bazi)
+    ZhenDuanLogic.about_shen_sha(bazi)
+    ZhenDuanLogic.about_geju(bazi)
+    ZhenDuanLogic.about_gaoneng(bazi)
+    ZhenDuanLogic.about_jiankang(bazi)
+    ZhenDuanLogic.about_qinggan(bazi)
+    ZhenDuanLogic.about_dayun(bazi)
+    ZhenDuanLogic.about_yinyuan(bazi)
+
+    # QuShiLogic.calc_qushi(bazi)
+
+    return bazi

+ 0 - 0
wx/migrations/__init__.py


+ 3 - 0
wx/models.py

@@ -0,0 +1,3 @@
+from django.db import models
+
+# Create your models here.

+ 17 - 0
wx/parsers.py

@@ -0,0 +1,17 @@
+from rest_framework.parsers import BaseParser
+
+
+class GZHParser(BaseParser):
+    media_type = "text/xml"
+
+    def parse(self, stream, media_type=None, parser_context=None):
+        cont = stream.read().decode('utf-8')
+        return cont
+
+
+class JsonParser(BaseParser):
+    media_type = "application/json"
+
+    def parse(self, stream, media_type=None, parser_context=None):
+        cont = stream.read().decode('utf-8')
+        return cont

+ 14 - 0
wx/templates/wx/user_view.html

@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>请填写信息</title>
+    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
+    <link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css">
+    <script src="https://unpkg.com/element-plus@2.7.5/dist/index.full.js"></script>
+</head>
+<body>
+<h3>欢迎</h3>
+<el-button type="success">OK</el-button>
+</body>
+</html>

+ 3 - 0
wx/tests.py

@@ -0,0 +1,3 @@
+from django.test import TestCase
+
+# Create your tests here.

+ 19 - 0
wx/urls.py

@@ -0,0 +1,19 @@
+from django.urls import path
+
+from wx.views import *
+
+urlpatterns = [
+    path("token", GetAccessToken.as_view(), name="token"),
+    path("msg", UserMsg.as_view(), name="user_msg"),
+    path("", UrlCheck.as_view(), name="url_check"),
+    path("addMenu", UpdateMenu.as_view(), name="add_menu"),
+    path("applyUserInfo", ApplyUserInfo.as_view(), name="apply_user_info"),
+    path("login", LoginSystem.as_view(), name="login_system"),
+    path("getSiZhu", GetSiZhu.as_view(), name="get_si_zhu"),
+    path("getSiZhuByNongLi", GetSiZhuByNongLi.as_view(), name="get_si_zhu_by_nong_li"),
+    path("getSiZhuByTexts", GetSiZhuByTexts.as_view(), name="get_si_zhu_by_texts"),
+    path("calcNongLi", CalcNongLi.as_view(), name="calc_nong_li"),
+    path("saveUser", SaveUser.as_view(), name="save_user"),
+    path("loadUser", LoadUser.as_view(), name="load_user"),
+    path("deleteUser", DeleteUser.as_view(), name="delete_user"),
+]

+ 519 - 0
wx/views.py

@@ -0,0 +1,519 @@
+import base64
+import datetime
+import json
+import time
+import traceback
+
+from django.http import JsonResponse
+from rest_framework.request import Request
+from rest_framework.response import Response
+from rest_framework.views import APIView
+
+import tools
+from wx import logic
+from wx.dbTools import DB_WX_GZH_User, DBYiXueUser, DBSysUser
+from wx.parsers import GZHParser, JsonParser
+from wx.wxModels import WXUserMsg, WXMenu, UserRequest, CalcNongLiRequest, GetSiZhuRequest, GetSiZhuByNongLiRequest, \
+    GetSiZhuByTextsRequest, SaveUserRequest, LoadUserRequest, DeleteUserRequest, LoginRequest
+from yixue import Models, DataCenter
+from yixue.Models import BaseInfo
+
+
+def is_empty(s: str):
+    return s is None or len(s) == 0
+
+
+# Create your views here.
+class GetAccessToken(APIView):
+
+    def get(self, request):
+        return Response(tools.__get_access_token__())
+
+
+class UpdateMenu(APIView):
+
+    def post(self, request: Request):
+        menu = WXMenu()
+        menu.add_click_button("jinriyunshi", "jin_ri_yun_shi")
+        tk = tools.__get_access_token__()
+        print(tk)
+        url = " https://api.weixin.qq.com/cgi-bin/menu/create?access_token=" + tk
+        print(url)
+        body = json.dumps(menu.obj, ensure_ascii=False)
+        print(body)
+        rsp = tools.sync_post(url, menu.obj)
+        print(rsp.text)
+        return Response(rsp.text)
+
+
+class RemoveMenu(APIView):
+    pass
+
+
+# def user_view(request: Request):
+#     return render(request, "wx/user_view.html")
+
+
+class UserMsg(APIView):
+    parser_classes = [GZHParser]
+
+    def post(self, request: Request):
+        obj = json.loads(request.data)
+        bean = WXUserMsg()
+        for key in obj:
+            if len(key) > 0:
+                value = obj[key]
+                setattr(bean, key, value)
+        return Response(obj)
+
+
+class UrlCheck(APIView):
+    parser_classes = [GZHParser]
+
+    def get(self, request: Request):
+        sign = request.GET.get("signature")
+        echo_str = request.GET.get("echostr")
+        timestamp = request.GET.get("timestamp")
+        nonce = request.GET.get("nonce")
+        token = "deanlai"
+        # list = [token, timestamp, nonce]
+        # list.sort()
+        # sha1 = hashlib.sha1()
+        # map(sha1.update, list)
+        # hashcode = sha1.hexdigest()
+        return Response(int(echo_str))
+
+    def post(self, request: Request):
+        obj = tools.xml_parser(request.data)
+        bean = WXUserMsg.build_from(obj)
+        content = ""
+        try:
+            if bean.Content == "今日运势":
+                content = logic.get_lucky_day(bean.FromUserName)
+        except Exception as e:
+            print(e)
+            print(bean)
+        reply = WXUserMsg()
+        reply.ToUserName = bean.FromUserName
+        reply.FromUserName = bean.ToUserName
+        reply.MsgType = bean.MsgType
+        reply.CreateTime = int(time.time())
+        reply.Content = content
+        xml_data = tools.xml_build("xml", reply)
+        xml_str = tools.xml_to_string(xml_data)
+        print(xml_str)
+        return Response(xml_str)
+
+
+class ApplyUserInfo(APIView):
+
+    def post(self, request: Request):
+        bean = UserRequest.build_from(request.data)
+        msg = "您的信息已记录,请退出页面后再次点击【今日运势】"
+        code = 0
+        if is_empty(bean.open_id):
+            code = -100
+            msg = "未获取到用户信息,请退出页面重试或联系客服"
+        elif is_empty(bean.user_name):
+            code = -1
+            msg = "用户姓名未填写"
+        else:
+            if DB_WX_GZH_User.check_exist(
+                    open_id=bean.open_id
+            ):
+                code = -100
+                msg = "用户信息已存在,如需修改请联系客服"
+            else:
+                DB_WX_GZH_User.insert(
+                    open_id=bean.open_id,
+                    user_name=bean.user_name,
+                    is_man=bean.is_man,
+                    date_mode=bean.date_mode,
+                    born_year=bean.born_year,
+                    born_month=bean.born_month,
+                    born_day=bean.born_day,
+                    born_hour=bean.born_hour,
+                    born_minute=bean.born_minute,
+                    know_time=bean.know_time,
+                    born_sheng=bean.born_sheng,
+                    born_shi=bean.born_shi,
+                    born_qu=bean.born_qu,
+                )
+
+        return Response({"code": code, "msg": msg})
+
+
+def jia_mi(s: str):
+    return base64.b64encode(s.encode("utf-8")).decode("utf-8")
+
+
+def jie_mi(s: str):
+    return base64.b64decode(s).decode("utf-8")
+
+
+class LoginSystem(APIView):
+    parser_classes = [JsonParser]
+
+    def post(self, request):
+        dt = json.loads(request.data)
+        # print(dt)
+        req = LoginRequest.build_from(dt)
+        finger = req.userAgent + req.colorDepth + req.timezoneOffset + req.language
+        user = DBSysUser.query_first_by(account=req.account, password=req.password)
+        code = 200
+        rsp = {}
+        # 登录流程
+        # 1、账号密码比对
+        # 1-1、账号密码错误,直接返回
+        # 1-2、账号密码正确,取得当前设备指纹,换算成cur_token
+        # 1-2-1、数据库未记录设备指纹,更新设备指纹到数据库,在内存存入cur_token
+        # 1-2-2、数据库已记录设备指纹,提取数据库存的设备指纹,换算成db_token,对比db_token和cur_token
+        # 1-2-2-1、db_token 和 cur_token 不一致,表示更换了设备登录,此时要修改内存中的mem_token,确保旧的账号访问API失败
+        # 1-2-2-2、db_token 和 cur_token 一致,表示同一设备登录
+        if user is not None:
+            cur_token = jia_mi(finger)
+            if user.finger is None:
+                # 第一次,记录设备信息
+                DBSysUser.update(conditions=(DBSysUser.id == user.id), values={"finger": finger})
+                DataCenter.set_token(user.id, cur_token)
+            else:
+                # 已记录登录的设备,则提取指纹,换算成db_token
+                db_finger = user.finger
+                db_token = jia_mi(db_finger)
+
+                if db_token != cur_token:
+                    # 用户更换了登录设备,此时需要更新指纹,并记录更换设备的信息
+                    if user.allow_change_dev is True:
+                        ct = user.dev_change
+                        ct += 1
+                        DBSysUser.update(conditions=(DBSysUser.id == user.id),
+                                         values={"finger": finger, "dev_change": ct})
+                        print("用户:", user.name, " 更换了登录设备,更换次数:", user.dev_change)
+                        DataCenter.set_token(user.id, cur_token)
+                    else:
+                        return JsonResponse({"code": -100, "data": {}}, json_dumps_params={'ensure_ascii': False})
+                else:
+                    DataCenter.set_token(user.id, cur_token)
+            rsp = {
+                "name": user.name,
+                "token": cur_token,
+                "uid": user.id
+            }
+        else:
+            # 账号密码错误
+            code = -1
+
+        return JsonResponse({"code": code, "data": rsp}, json_dumps_params={'ensure_ascii': False})
+
+
+class GetSiZhu(APIView):
+    parser_classes = [JsonParser]
+
+    def post(self, request: Request):
+        '''
+        request:{
+            token:str
+            isMan:bool
+            year:int 年
+            month:int 月
+            day:int 日
+            hourMode:int 2=未知
+            hour:int 时
+            minute:int 分
+            areaMode:int
+            sheng:str 省
+            shi:str 市
+            qu:str 区
+        }
+        只接受新历(阳历)
+        '''
+        rsp = {}
+        tm1 = datetime.datetime.now()
+        print("receive request", tm1)
+        try:
+            dt = json.loads(request.data)
+            # print(dt)
+            req = GetSiZhuRequest.build_from(dt)
+            if req.token is None:
+                return JsonResponse({"code": -100, "data": {}})
+            else:
+                # 对比token是否发生了改变
+                mem_token = DataCenter.get_token(req.uid)
+                if mem_token is None:
+                    DataCenter.set_token(req.uid, req.token)
+                elif mem_token != req.token:
+                    return JsonResponse({"code": -200, "data": {}})
+
+            req.fix_data()
+            result = logic.calc_si_zhu(req.year, req.month, req.day, req.hour, req.minute, req.sheng, req.shi, req.qu)
+            tm13 = datetime.datetime.now()
+            print("calc sizhu use:", tm13 - tm1)
+            if result is not None:
+                bazi = logic.build_bazi(result, req.isMan)
+
+                bazi.base_info = BaseInfo()
+                bazi.base_info.date_mode = 0
+                bazi.base_info.year = req.year
+                bazi.base_info.month = req.month
+                bazi.base_info.day = req.day
+                bazi.base_info.hour_mode = req.hourMode
+                bazi.base_info.hour = req.hour
+                bazi.base_info.minute = req.minute
+                bazi.base_info.area_mode = req.areaMode
+                bazi.base_info.sheng = req.sheng
+                bazi.base_info.shi = req.shi
+                bazi.base_info.qu = req.qu
+
+                if req.hourMode == 2:
+                    bazi.tai_yang_shi = None
+                rsp = bazi.to_response()
+        except Exception as e:
+            print(e)
+            traceback.print_exc()
+        return JsonResponse({"code": 200, "data": rsp})
+
+
+class GetSiZhuByNongLi(APIView):
+    parser_classes = [JsonParser]
+
+    def post(self, request: Request):
+        '''
+        request:{
+            uid:int
+            token:str
+            isMan:bool
+            year:int 年
+            month:string 月 注意是字符串
+            day:string 日 注意是字符串
+            hourMode:int 2=未知
+            hour:int 时
+            minute:int 分
+            areaMode:int
+            sheng:str 省
+            shi:str 市
+            qu:str 区
+        }
+        只接受农历(阴历)
+        '''
+        rsp = {}
+        try:
+            dt = json.loads(request.data)
+            req = GetSiZhuByNongLiRequest.build_from(dt)
+
+            if req.token is None:
+                return JsonResponse({"code": -100, "data": {}})
+            else:
+                # 对比token是否发生了改变
+                mem_token = DataCenter.get_token(req.uid)
+                if mem_token is None:
+                    DataCenter.set_token(req.uid, req.token)
+                elif mem_token != req.token:
+                    return JsonResponse({"code": -200, "data": {}})
+
+            req.fix_data()
+            xinli = logic.calc_nong_li(req.year, req.month, req.day)
+            print("对应阳历:", xinli)
+            result = logic.calc_si_zhu(req.year, xinli.month, xinli.day, req.hour, req.minute, req.sheng, req.shi,
+                                       req.qu)
+            if result is not None:
+                bazi = logic.build_bazi(result, req.isMan)
+
+                bazi.base_info = BaseInfo()
+                bazi.base_info.date_mode = 1
+                bazi.base_info.nongli_year = req.year
+                bazi.base_info.nongli_month = req.month
+                bazi.base_info.nongli_day = req.day
+                bazi.base_info.hour_mode = req.hourMode
+                bazi.base_info.hour = req.hour
+                bazi.base_info.minute = req.minute
+                bazi.base_info.area_mode = req.areaMode
+                bazi.base_info.sheng = req.sheng
+                bazi.base_info.shi = req.shi
+                bazi.base_info.qu = req.qu
+
+                if req.hourMode == 2:
+                    bazi.tai_yang_shi = None
+                rsp = bazi.to_response()
+        except Exception as e:
+            print(e)
+            traceback.print_exc()
+        return JsonResponse({"code": 200, "data": rsp})
+
+
+class GetSiZhuByTexts(APIView):
+    parser_classes = [JsonParser]
+
+    def post(self, request: Request):
+        '''
+        request:{
+            uid:int
+            token:str
+            isMan:bool
+            niangan:str
+            nianzhi:str
+            yuegan:str
+            yuezhi:str
+            rigan:str
+            rizhi:str
+            shigan:str
+            shizhi:str
+            hourMode:int 1=未知
+        }
+        '''
+        rsp = {}
+        code = 200
+        try:
+            dt = json.loads(request.data)
+            req = GetSiZhuByTextsRequest.build_from(dt)
+
+            if req.token is None:
+                return JsonResponse({"code": -100, "data": {}})
+            else:
+                # 对比token是否发生了改变
+                mem_token = DataCenter.get_token(req.uid)
+                if mem_token is None:
+                    DataCenter.set_token(req.uid, req.token)
+                elif mem_token != req.token:
+                    return JsonResponse({"code": -200, "data": {}})
+
+            sizhu_checker = logic.check_date_by_texts(req.niangan, req.nianzhi, req.yuegan, req.yuezhi, req.rigan,
+                                                      req.rizhi,
+                                                      req.shigan, req.shizhi)
+            # print(sizhu_checker)
+            result = Models.SiZhuResult()
+            result.nian_gan = req.niangan
+            result.nian_zhi = req.nianzhi
+            result.yue_gan = req.yuegan
+            result.yue_zhi = req.yuezhi
+            result.ri_gan = req.rigan
+            result.ri_zhi = req.rizhi
+            result.shi_gan = req.shigan
+            result.shi_zhi = req.shizhi
+            result.sheng = "未知地区"
+            result.shi = "-"
+            result.qu = "-"
+            result.tai_yang_shi = None
+            if sizhu_checker.error:
+                code = -1
+                rsp = sizhu_checker.to_response()
+                if req.ignoreError:
+                    pass
+                else:
+                    pass
+            else:
+                if req.hourMode == 0:
+                    # print(sizhu_checker.adv_date[0])
+                    result.tai_yang_shi = datetime.datetime.strptime(sizhu_checker.adv_date[0], "%Y-%m-%d %H:%M")
+                else:
+                    result.tai_yang_shi = datetime.datetime.strptime(sizhu_checker.adv_date[0] + " 0:00",
+                                                                     "%Y-%m-%d %H:%M")
+                    result.shi_gan = "无"
+                    result.shi_zhi = "无"
+                bazi = logic.build_bazi(result, req.isMan)
+
+                bazi.base_info = BaseInfo()
+                bazi.base_info.date_mode = 2
+                bazi.base_info.nian_gan = req.niangan
+                bazi.base_info.nian_zhi = req.nianzhi
+                bazi.base_info.yue_gan = req.yuegan
+                bazi.base_info.yue_zhi = req.yuezhi
+                bazi.base_info.ri_gan = req.rigan
+                bazi.base_info.ri_zhi = req.rizhi
+                bazi.base_info.shi_gan = req.shigan
+                bazi.base_info.shi_zhi = req.shizhi
+                if req.hourMode == 1:
+                    bazi.tai_yang_shi = None
+                rsp = bazi.to_response()
+        except Exception as e:
+            print(e)
+            traceback.print_exc()
+        return Response({"code": code, "data": rsp})
+
+
+class CalcNongLi(APIView):
+    parser_classes = [JsonParser]
+
+    def post(self, request: Request):
+        '''
+        request:{
+            year:int
+            month:str 农历月
+            day:str 农历日
+        }
+        '''
+        result = None
+        try:
+            dt = json.loads(request.data)
+            req = CalcNongLiRequest.build_from(dt)
+            result = logic.calc_nong_li(req.year, req.month, req.day)
+        except Exception as e:
+            print(e)
+            traceback.print_exc()
+        return Response({"code": 200, "data": result})
+
+
+class SaveUser(APIView):
+    parser_classes = [JsonParser]
+
+    def post(self, request: Request):
+        rsp = []
+        try:
+            dt = json.loads(request.data)
+            req = SaveUserRequest.build_from(dt)
+            DBYiXueUser.insert(
+                name=req.name, isMan=req.isMan, dateMode=req.dateMode, extra=req.extra, owner_id=req.owner_id,
+                year=req.year, month=req.month, day=req.day,
+                hourMode=req.hourMode, hour=req.hour, minute=req.minute,
+                areaMode=req.areaMode, sheng=req.sheng, shi=req.shi, qu=req.qu,
+                nongli_year=req.nongli_year, nongli_month=req.nongli_month, nongli_day=req.nongli_day,
+                req_nian_gan=req.req_nian_gan, req_nian_zhi=req.req_nian_zhi,
+                req_yue_gan=req.req_yue_gan, req_yue_zhi=req.req_yue_zhi,
+                req_ri_gan=req.req_ri_gan, req_ri_zhi=req.req_ri_zhi,
+                req_shi_gan=req.req_shi_gan, req_shi_zhi=req.req_shi_zhi,
+                rsp_nian_gan=req.rsp_nian_gan, rsp_nian_zhi=req.rsp_nian_zhi,
+                rsp_yue_gan=req.rsp_yue_gan, rsp_yue_zhi=req.rsp_yue_zhi,
+                rsp_ri_gan=req.rsp_ri_gan, rsp_ri_zhi=req.rsp_ri_zhi,
+                rsp_shi_gan=req.rsp_shi_gan, rsp_shi_zhi=req.rsp_shi_zhi,
+            )
+            data = DBYiXueUser.query_by(owner_id=req.owner_id)
+            for dt in data:
+                rsp.append(dt.to_json_object())
+        except Exception as e:
+            print(e)
+            traceback.print_exc()
+        return Response({"code": 200, "data": rsp})
+
+
+class LoadUser(APIView):
+    parser_classes = [JsonParser]
+
+    def post(self, request: Request):
+        rsp = []
+        try:
+            dt = json.loads(request.data)
+            req = LoadUserRequest.build_from(dt)
+            data = DBYiXueUser.query_by(owner_id=req.owner_id)
+            for dt in data:
+                rsp.append(dt.to_json_object())
+        except Exception as e:
+            print(e)
+            traceback.print_exc()
+        return Response({"code": 200, "data": rsp})
+
+
+class DeleteUser(APIView):
+    parser_classes = [JsonParser]
+
+    def post(self, request: Request):
+        rsp = []
+        try:
+            dt = json.loads(request.data)
+            req = DeleteUserRequest.build_from(dt)
+            DBYiXueUser.delete_by(id=req.user_id, owner_id=req.owner_id)
+            data = DBYiXueUser.query_by(owner_id=req.owner_id)
+            for dt in data:
+                rsp.append(dt.to_json_object())
+        except Exception as e:
+            print(e)
+            traceback.print_exc()
+        return Response({"code": 200, "data": rsp})

+ 204 - 0
wx/wxModels.py

@@ -0,0 +1,204 @@
+class WXBean(object):
+
+    def __repr__(self):
+        result = self.__class__.__name__ + "\n"
+        for key in self.__dir__():
+            if not key.startswith('__'):
+                value = getattr(self, key)
+                if not callable(value):
+                    result += "  " + key + " = " + str(value) + "\n"
+        return result
+
+    @classmethod
+    def build_from(cls, obj: {}):
+        bean = cls()
+        for key in obj:
+            if len(key) > 0:
+                value = obj[key]
+                setattr(bean, key, value)
+        return bean
+
+
+class WXUserMsg(WXBean):
+    URL: str
+    ToUserName: str
+    FromUserName: str
+    CreateTime: int
+    MsgType: str
+    Content: str
+    MsgId: int
+
+
+class WXMenu(WXBean):
+    obj: {}
+
+    def __init__(self):
+        self.obj = {
+            "button": []
+        }
+
+    def add_click_button(self, text: str, key: str):
+        temp = {
+            "type": "click",
+            "name": text,
+            "key": key,
+        }
+        self.obj["button"].append(temp)
+
+    def add_view_button(self, text: str, url: str):
+        temp = {
+            "type": "view",
+            "name": text,
+            "url": url,
+        }
+        self.obj["button"].append(temp)
+
+
+class UserRequest(WXBean):
+    user_name: str
+    is_man: bool
+    date_mode: int
+    born_year: int
+    born_month: int
+    born_day: int
+    know_time: int
+    born_hour: int
+    born_minute: int
+    born_sheng: str
+    born_shi: str
+    born_qu: str
+    open_id: str
+
+
+class LoginRequest(WXBean):
+    account: str
+    password: str
+    userAgent: str
+    screenResolution: str
+    colorDepth: str
+    timezoneOffset: str
+    language: str
+
+
+class GetSiZhuRequest(WXBean):
+    uid: int
+    token: str
+    isMan: bool
+    year: int
+    month: int
+    day: int
+    hourMode: int
+    hour: int
+    minute: int
+    areaMode: int
+    sheng: str
+    shi: str
+    qu: str
+
+    def __init__(self):
+        self.hour = None
+        self.minute = None
+        self.sheng = "未知地区"
+        self.shi = "-"
+        self.qu = "-"
+
+    def fix_data(self):
+        if self.hour is None or self.minute is None:
+            self.hour = None
+            self.minute = None
+
+
+class CalcNongLiRequest(WXBean):
+    year: int
+    month: str
+    day: str
+
+
+class GetSiZhuByNongLiRequest(WXBean):
+    uid: int
+    token: str
+    isMan: bool
+    year: int
+    month: str
+    day: str
+    hourMode: int
+    hour: int
+    minute: int
+    areaMode: int
+    sheng: str
+    shi: str
+    qu: str
+
+    def __init__(self):
+        self.hour = None
+        self.minute = None
+        self.sheng = "未知地区"
+        self.shi = "-"
+        self.qu = "-"
+
+    def fix_data(self):
+        if self.hour is None or self.minute is None:
+            self.hour = None
+            self.minute = None
+
+
+class GetSiZhuByTextsRequest(WXBean):
+    uid: int
+    token: str
+    isMan: bool
+    niangan: str
+    nianzhi: str
+    yuegan: str
+    yuezhi: str
+    rigan: str
+    rizhi: str
+    shigan: str
+    shizhi: str
+    ignoreError: bool
+
+
+class SaveUserRequest(WXBean):
+    name: str
+    isMan: bool
+    dateMode: int
+    year: int = None
+    month: str = None
+    day: str = None
+    hourMode: int = None
+    hour: int = None
+    minute: int = None
+    areaMode: int = None
+    sheng: str = None
+    shi: str = None
+    qu: str = None
+    extra: str = None
+    nongli_year: int = None
+    nongli_month: str = None
+    nongli_day: str = None
+    req_nian_gan: str = None
+    req_nian_zhi: str = None
+    req_yue_gan: str = None
+    req_yue_zhi: str = None
+    req_ri_gan: str = None
+    req_ri_zhi: str = None
+    req_shi_gan: str = None
+    req_shi_zhi: str = None
+
+    rsp_nian_gan: str
+    rsp_nian_zhi: str
+    rsp_yue_gan: str
+    rsp_yue_zhi: str
+    rsp_ri_gan: str
+    rsp_ri_zhi: str
+    rsp_shi_gan: str
+    rsp_shi_zhi: str
+    owner_id: int
+
+
+class LoadUserRequest(WXBean):
+    owner_id: int
+
+
+class DeleteUserRequest(WXBean):
+    owner_id: int
+    user_id: int

BIN
yixue/.DS_Store


+ 5393 - 0
yixue/Configs.py

@@ -0,0 +1,5393 @@
+const_nian_gan = 1
+const_yue_gan = 2
+const_ri_gan = 3
+const_shi_gan = 4
+const_nian_zhi = 5
+const_yue_zhi = 6
+const_ri_zhi = 7
+const_shi_zhi = 8
+const_dayun_gan = 11
+const_dayun_zhi = 12
+const_liunian_gan = 13
+const_liunian_zhi = 14
+const_liuyue_gan = 15
+const_liuyue_zhi = 16
+const_liuri_gan = 17
+const_liuri_zhi = 18
+const_liushi_gan = 19
+const_liushi_zhi = 20
+const_zengbu1_gan = 21
+const_zengbu1_zhi = 22
+
+config_tiangan_list = ["甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"]
+config_dizhi_list = ["子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"]
+config_wuxing_list = ["木", "火", "土", "金", "水"]
+config_shishen_list = ["官", "杀", "比", "劫", "食", "伤", "印", "枭", "财", "才"]
+config_muku_list = ["辰", "戌", "丑", "未"]
+config_tongdang_list = ["印", "枭", "比", "劫"]
+config_yidang_list = ["官", "杀", "财", "才"]
+config_wuxing = {
+    "甲": "木",
+    "乙": "木",
+    "丙": "火",
+    "丁": "火",
+    "戊": "土",
+    "己": "土",
+    "庚": "金",
+    "辛": "金",
+    "壬": "水",
+    "癸": "水",
+    "子": "水",
+    "丑": "土",
+    "寅": "木",
+    "卯": "木",
+    "辰": "土",
+    "巳": "火",
+    "午": "火",
+    "未": "土",
+    "申": "金",
+    "酉": "金",
+    "戌": "土",
+    "亥": "水",
+}
+config_canggan = {
+    "子": ["癸", None, None],
+    "丑": ["己", "辛", "癸"],
+    "寅": ["甲", "丙", "戊"],
+    "卯": ["乙", None, None],
+    "辰": ["戊", "癸", "乙"],
+    "巳": ["丙", "戊", "庚"],
+    "午": ["丁", "己", None],
+    "未": ["己", "乙", "丁"],
+    "申": ["庚", "壬", "戊"],
+    "酉": ["辛", None, None],
+    "戌": ["戊", "丁", "辛"],
+    "亥": ["壬", "甲", None],
+}
+config_shishen = {
+    "甲": {
+        "甲": "比",
+        "乙": "劫",
+        "丙": "食",
+        "丁": "伤",
+        "戊": "才",
+        "己": "财",
+        "庚": "杀",
+        "辛": "官",
+        "壬": "枭",
+        "癸": "印",
+        "子": "印",
+        "丑": "财",
+        "寅": "比",
+        "卯": "劫",
+        "辰": "才",
+        "巳": "食",
+        "午": "伤",
+        "未": "财",
+        "申": "杀",
+        "酉": "官",
+        "戌": "才",
+        "亥": "枭",
+    },
+    "乙": {
+        "甲": "劫",
+        "乙": "比",
+        "丙": "伤",
+        "丁": "食",
+        "戊": "财",
+        "己": "才",
+        "庚": "官",
+        "辛": "杀",
+        "壬": "印",
+        "癸": "枭",
+        "子": "枭",
+        "丑": "才",
+        "寅": "劫",
+        "卯": "比",
+        "辰": "财",
+        "巳": "伤",
+        "午": "食",
+        "未": "才",
+        "申": "官",
+        "酉": "杀",
+        "戌": "财",
+        "亥": "印",
+    },
+    "丙": {
+        "甲": "枭",
+        "乙": "印",
+        "丙": "比",
+        "丁": "劫",
+        "戊": "食",
+        "己": "伤",
+        "庚": "才",
+        "辛": "财",
+        "壬": "杀",
+        "癸": "官",
+        "子": "官",
+        "丑": "伤",
+        "寅": "枭",
+        "卯": "印",
+        "辰": "食",
+        "巳": "比",
+        "午": "劫",
+        "未": "伤",
+        "申": "才",
+        "酉": "财",
+        "戌": "食",
+        "亥": "杀",
+    },
+    "丁": {
+        "甲": "印",
+        "乙": "枭",
+        "丙": "劫",
+        "丁": "比",
+        "戊": "伤",
+        "己": "食",
+        "庚": "财",
+        "辛": "才",
+        "壬": "官",
+        "癸": "杀",
+        "子": "杀",
+        "丑": "食",
+        "寅": "印",
+        "卯": "枭",
+        "辰": "伤",
+        "巳": "劫",
+        "午": "比",
+        "未": "食",
+        "申": "财",
+        "酉": "才",
+        "戌": "伤",
+        "亥": "官",
+    },
+    "戊": {
+        "甲": "杀",
+        "乙": "官",
+        "丙": "枭",
+        "丁": "印",
+        "戊": "比",
+        "己": "劫",
+        "庚": "食",
+        "辛": "伤",
+        "壬": "才",
+        "癸": "财",
+        "子": "财",
+        "丑": "劫",
+        "寅": "杀",
+        "卯": "官",
+        "辰": "比",
+        "巳": "枭",
+        "午": "印",
+        "未": "劫",
+        "申": "食",
+        "酉": "伤",
+        "戌": "比",
+        "亥": "才",
+    },
+    "己": {
+        "甲": "官",
+        "乙": "杀",
+        "丙": "印",
+        "丁": "枭",
+        "戊": "劫",
+        "己": "比",
+        "庚": "伤",
+        "辛": "食",
+        "壬": "财",
+        "癸": "才",
+        "子": "才",
+        "丑": "比",
+        "寅": "官",
+        "卯": "杀",
+        "辰": "劫",
+        "巳": "印",
+        "午": "枭",
+        "未": "比",
+        "申": "伤",
+        "酉": "食",
+        "戌": "劫",
+        "亥": "财",
+    },
+    "庚": {
+        "甲": "才",
+        "乙": "财",
+        "丙": "杀",
+        "丁": "官",
+        "戊": "枭",
+        "己": "印",
+        "庚": "比",
+        "辛": "劫",
+        "壬": "食",
+        "癸": "伤",
+        "子": "伤",
+        "丑": "印",
+        "寅": "才",
+        "卯": "财",
+        "辰": "枭",
+        "巳": "杀",
+        "午": "官",
+        "未": "印",
+        "申": "比",
+        "酉": "劫",
+        "戌": "枭",
+        "亥": "食",
+    },
+    "辛": {
+        "甲": "财",
+        "乙": "才",
+        "丙": "官",
+        "丁": "杀",
+        "戊": "印",
+        "己": "枭",
+        "庚": "劫",
+        "辛": "比",
+        "壬": "伤",
+        "癸": "食",
+        "子": "食",
+        "丑": "枭",
+        "寅": "财",
+        "卯": "才",
+        "辰": "印",
+        "巳": "官",
+        "午": "杀",
+        "未": "枭",
+        "申": "劫",
+        "酉": "比",
+        "戌": "印",
+        "亥": "伤",
+    },
+    "壬": {
+        "甲": "食",
+        "乙": "伤",
+        "丙": "才",
+        "丁": "财",
+        "戊": "杀",
+        "己": "官",
+        "庚": "枭",
+        "辛": "印",
+        "壬": "比",
+        "癸": "劫",
+        "子": "劫",
+        "丑": "官",
+        "寅": "食",
+        "卯": "伤",
+        "辰": "杀",
+        "巳": "才",
+        "午": "财",
+        "未": "官",
+        "申": "枭",
+        "酉": "印",
+        "戌": "杀",
+        "亥": "比",
+    },
+    "癸": {
+        "甲": "伤",
+        "乙": "食",
+        "丙": "财",
+        "丁": "才",
+        "戊": "官",
+        "己": "杀",
+        "庚": "印",
+        "辛": "枭",
+        "壬": "劫",
+        "癸": "比",
+        "子": "比",
+        "丑": "杀",
+        "寅": "伤",
+        "卯": "食",
+        "辰": "官",
+        "巳": "财",
+        "午": "才",
+        "未": "杀",
+        "申": "印",
+        "酉": "枭",
+        "戌": "官",
+        "亥": "劫",
+    },
+    "子": {
+        "甲": "伤",
+        "乙": "食",
+        "丙": "财",
+        "丁": "才",
+        "戊": "官",
+        "己": "杀",
+        "庚": "印",
+        "辛": "枭",
+        "壬": "劫",
+        "癸": "比",
+        "子": "比",
+        "丑": "杀",
+        "寅": "伤",
+        "卯": "食",
+        "辰": "官",
+        "巳": "财",
+        "午": "才",
+        "未": "杀",
+        "申": "印",
+        "酉": "枭",
+        "戌": "官",
+        "亥": "劫",
+    },
+    "丑": {
+        "甲": "官",
+        "乙": "杀",
+        "丙": "印",
+        "丁": "枭",
+        "戊": "劫",
+        "己": "比",
+        "庚": "伤",
+        "辛": "食",
+        "壬": "财",
+        "癸": "才",
+        "子": "才",
+        "丑": "比",
+        "寅": "官",
+        "卯": "杀",
+        "辰": "劫",
+        "巳": "印",
+        "午": "枭",
+        "未": "比",
+        "申": "伤",
+        "酉": "食",
+        "戌": "劫",
+        "亥": "财",
+    },
+    "寅": {
+        "甲": "比",
+        "乙": "劫",
+        "丙": "食",
+        "丁": "伤",
+        "戊": "才",
+        "己": "财",
+        "庚": "杀",
+        "辛": "官",
+        "壬": "枭",
+        "癸": "印",
+        "子": "印",
+        "丑": "财",
+        "寅": "比",
+        "卯": "劫",
+        "辰": "才",
+        "巳": "食",
+        "午": "伤",
+        "未": "财",
+        "申": "杀",
+        "酉": "官",
+        "戌": "才",
+        "亥": "枭",
+    },
+    "卯": {
+        "甲": "劫",
+        "乙": "比",
+        "丙": "伤",
+        "丁": "食",
+        "戊": "财",
+        "己": "才",
+        "庚": "官",
+        "辛": "杀",
+        "壬": "印",
+        "癸": "枭",
+        "子": "枭",
+        "丑": "才",
+        "寅": "劫",
+        "卯": "比",
+        "辰": "财",
+        "巳": "伤",
+        "午": "食",
+        "未": "才",
+        "申": "官",
+        "酉": "杀",
+        "戌": "财",
+        "亥": "印",
+    },
+    "辰": {
+        "甲": "杀",
+        "乙": "官",
+        "丙": "枭",
+        "丁": "印",
+        "戊": "比",
+        "己": "劫",
+        "庚": "食",
+        "辛": "伤",
+        "壬": "才",
+        "癸": "财",
+        "子": "财",
+        "丑": "劫",
+        "寅": "杀",
+        "卯": "官",
+        "辰": "比",
+        "巳": "枭",
+        "午": "印",
+        "未": "劫",
+        "申": "食",
+        "酉": "伤",
+        "戌": "比",
+        "亥": "才",
+    },
+    "巳": {
+        "甲": "枭",
+        "乙": "印",
+        "丙": "比",
+        "丁": "劫",
+        "戊": "食",
+        "己": "伤",
+        "庚": "才",
+        "辛": "财",
+        "壬": "杀",
+        "癸": "官",
+        "子": "官",
+        "丑": "伤",
+        "寅": "枭",
+        "卯": "印",
+        "辰": "食",
+        "巳": "比",
+        "午": "劫",
+        "未": "伤",
+        "申": "才",
+        "酉": "财",
+        "戌": "食",
+        "亥": "杀",
+    },
+    "午": {
+        "甲": "印",
+        "乙": "枭",
+        "丙": "劫",
+        "丁": "比",
+        "戊": "伤",
+        "己": "食",
+        "庚": "财",
+        "辛": "才",
+        "壬": "官",
+        "癸": "杀",
+        "子": "杀",
+        "丑": "食",
+        "寅": "印",
+        "卯": "枭",
+        "辰": "伤",
+        "巳": "劫",
+        "午": "比",
+        "未": "食",
+        "申": "财",
+        "酉": "才",
+        "戌": "伤",
+        "亥": "官",
+    },
+    "未": {
+        "甲": "官",
+        "乙": "杀",
+        "丙": "印",
+        "丁": "枭",
+        "戊": "劫",
+        "己": "比",
+        "庚": "伤",
+        "辛": "食",
+        "壬": "财",
+        "癸": "才",
+        "子": "才",
+        "丑": "比",
+        "寅": "官",
+        "卯": "杀",
+        "辰": "劫",
+        "巳": "印",
+        "午": "枭",
+        "未": "比",
+        "申": "伤",
+        "酉": "食",
+        "戌": "劫",
+        "亥": "财",
+    },
+    "申": {
+        "甲": "才",
+        "乙": "财",
+        "丙": "杀",
+        "丁": "官",
+        "戊": "枭",
+        "己": "印",
+        "庚": "比",
+        "辛": "劫",
+        "壬": "食",
+        "癸": "伤",
+        "子": "伤",
+        "丑": "印",
+        "寅": "才",
+        "卯": "财",
+        "辰": "枭",
+        "巳": "杀",
+        "午": "官",
+        "未": "印",
+        "申": "比",
+        "酉": "劫",
+        "戌": "枭",
+        "亥": "食",
+    },
+    "酉": {
+        "甲": "财",
+        "乙": "才",
+        "丙": "官",
+        "丁": "杀",
+        "戊": "印",
+        "己": "枭",
+        "庚": "劫",
+        "辛": "比",
+        "壬": "伤",
+        "癸": "食",
+        "子": "食",
+        "丑": "枭",
+        "寅": "财",
+        "卯": "才",
+        "辰": "印",
+        "巳": "官",
+        "午": "官",
+        "未": "杀",
+        "申": "劫",
+        "酉": "比",
+        "戌": "印",
+        "亥": "伤",
+    },
+    "戌": {
+        "甲": "杀",
+        "乙": "官",
+        "丙": "枭",
+        "丁": "印",
+        "戊": "比",
+        "己": "劫",
+        "庚": "食",
+        "辛": "伤",
+        "壬": "才",
+        "癸": "财",
+        "子": "财",
+        "丑": "劫",
+        "寅": "杀",
+        "卯": "官",
+        "辰": "比",
+        "巳": "枭",
+        "午": "印",
+        "未": "劫",
+        "申": "食",
+        "酉": "伤",
+        "戌": "比",
+        "亥": "才",
+    },
+    "亥": {
+        "甲": "食",
+        "乙": "伤",
+        "丙": "才",
+        "丁": "财",
+        "戊": "杀",
+        "己": "官",
+        "庚": "枭",
+        "辛": "印",
+        "壬": "比",
+        "癸": "劫",
+        "子": "劫",
+        "丑": "官",
+        "寅": "食",
+        "卯": "伤",
+        "辰": "杀",
+        "巳": "才",
+        "午": "财",
+        "未": "官",
+        "申": "枭",
+        "酉": "印",
+        "戌": "杀",
+        "亥": "比",
+    },
+}
+config_yinyang = {
+    "甲": "阳",
+    "乙": "阴",
+    "丙": "阳",
+    "丁": "阴",
+    "戊": "阳",
+    "己": "阴",
+    "庚": "阳",
+    "辛": "阴",
+    "壬": "阳",
+    "癸": "阴",
+    "子": "阴",
+    "丑": "阴",
+    "寅": "阳",
+    "卯": "阴",
+    "辰": "阳",
+    "巳": "阳",
+    "午": "阴",
+    "未": "阴",
+    "申": "阳",
+    "酉": "阴",
+    "戌": "阳",
+    "亥": "阳",
+}
+config_zhangsheng = {
+    "甲": {
+        "子": "沐",
+        "丑": "冠",
+        "寅": "临",
+        "卯": "帝",
+        "辰": "衰",
+        "巳": "病",
+        "午": "死",
+        "未": "墓",
+        "申": "绝",
+        "酉": "胎",
+        "戌": "养",
+        "亥": "生",
+    },
+    "乙": {
+        "子": "病",
+        "丑": "衰",
+        "寅": "帝",
+        "卯": "临",
+        "辰": "冠",
+        "巳": "沐",
+        "午": "生",
+        "未": "养",
+        "申": "胎",
+        "酉": "绝",
+        "戌": "墓",
+        "亥": "死",
+    },
+    "丙": {
+        "子": "胎",
+        "丑": "养",
+        "寅": "生",
+        "卯": "沐",
+        "辰": "冠",
+        "巳": "临",
+        "午": "帝",
+        "未": "衰",
+        "申": "病",
+        "酉": "死",
+        "戌": "墓",
+        "亥": "绝",
+    },
+    "丁": {
+        "子": "绝",
+        "丑": "墓",
+        "寅": "死",
+        "卯": "病",
+        "辰": "衰",
+        "巳": "帝",
+        "午": "临",
+        "未": "冠",
+        "申": "沐",
+        "酉": "生",
+        "戌": "养",
+        "亥": "胎",
+    },
+    "戊": {
+        "子": "胎",
+        "丑": "养",
+        "寅": "生",
+        "卯": "沐",
+        "辰": "冠",
+        "巳": "临",
+        "午": "帝",
+        "未": "衰",
+        "申": "病",
+        "酉": "死",
+        "戌": "墓",
+        "亥": "绝",
+    },
+    "己": {
+        "子": "绝",
+        "丑": "墓",
+        "寅": "死",
+        "卯": "病",
+        "辰": "衰",
+        "巳": "帝",
+        "午": "临",
+        "未": "冠",
+        "申": "沐",
+        "酉": "生",
+        "戌": "养",
+        "亥": "胎",
+    },
+    "庚": {
+        "子": "死",
+        "丑": "墓",
+        "寅": "绝",
+        "卯": "胎",
+        "辰": "养",
+        "巳": "生",
+        "午": "沐",
+        "未": "冠",
+        "申": "临",
+        "酉": "帝",
+        "戌": "衰",
+        "亥": "病",
+    },
+    "辛": {
+        "子": "生",
+        "丑": "养",
+        "寅": "胎",
+        "卯": "绝",
+        "辰": "墓",
+        "巳": "死",
+        "午": "病",
+        "未": "衰",
+        "申": "帝",
+        "酉": "临",
+        "戌": "冠",
+        "亥": "沐",
+    },
+    "壬": {
+        "子": "帝",
+        "丑": "衰",
+        "寅": "病",
+        "卯": "死",
+        "辰": "墓",
+        "巳": "绝",
+        "午": "胎",
+        "未": "养",
+        "申": "生",
+        "酉": "沐",
+        "戌": "冠",
+        "亥": "临",
+    },
+    "癸": {
+        "子": "临",
+        "丑": "冠",
+        "寅": "沐",
+        "卯": "生",
+        "辰": "养",
+        "巳": "胎",
+        "午": "绝",
+        "未": "墓",
+        "申": "死",
+        "酉": "病",
+        "戌": "衰",
+        "亥": "帝",
+    },
+}
+config_wuxing_shishen_guanxi = {
+    "木": {
+        "木": ["比", "劫"],
+        "火": ["食", "伤"],
+        "土": ["财", "才"],
+        "金": ["官", "杀"],
+        "水": ["印", "枭"],
+    },
+    "火": {
+        "木": ["印", "枭"],
+        "火": ["比", "劫"],
+        "土": ["食", "伤"],
+        "金": ["财", "才"],
+        "水": ["官", "杀"],
+    },
+    "土": {
+        "木": ["官", "杀"],
+        "火": ["印", "枭"],
+        "土": ["比", "劫"],
+        "金": ["食", "伤"],
+        "水": ["财", "才"],
+    },
+    "金": {
+        "木": ["财", "才"],
+        "火": ["官", "杀"],
+        "土": ["印", "枭"],
+        "金": ["比", "劫"],
+        "水": ["食", "伤"],
+    },
+    "水": {
+        "木": ["食", "伤"],
+        "火": ["财", "才"],
+        "土": ["官", "杀"],
+        "金": ["印", "枭"],
+        "水": ["比", "劫"],
+    },
+
+}
+config_wuxing_shishen_query = {
+    "木": {
+        "比": "木",
+        "劫": "木",
+        "食": "火",
+        "伤": "火",
+        "财": "土",
+        "才": "土",
+        "官": "金",
+        "杀": "金",
+        "印": "水",
+        "枭": "水",
+    },
+    "火": {
+        "比": "火",
+        "劫": "火",
+        "食": "土",
+        "伤": "土",
+        "财": "金",
+        "才": "金",
+        "官": "水",
+        "杀": "水",
+        "印": "木",
+        "枭": "木",
+    },
+    "土": {
+        "比": "土",
+        "劫": "土",
+        "食": "金",
+        "伤": "金",
+        "财": "水",
+        "才": "水",
+        "官": "木",
+        "杀": "木",
+        "印": "火",
+        "枭": "火",
+    },
+    "金": {
+        "比": "金",
+        "劫": "金",
+        "食": "水",
+        "伤": "水",
+        "财": "木",
+        "才": "木",
+        "官": "火",
+        "杀": "火",
+        "印": "土",
+        "枭": "土",
+    },
+    "水": {
+        "比": "水",
+        "劫": "水",
+        "食": "木",
+        "伤": "木",
+        "财": "火",
+        "才": "火",
+        "官": "土",
+        "杀": "土",
+        "印": "金",
+        "枭": "金",
+    },
+
+}
+config_gaoneng = {
+    "甲己合": {
+        "name": "甲己合",
+        "guanxi": "合",
+        "father": None,
+        "leibie": "天干合",
+        "hehua": "土",
+        "tip": None,
+        "fangxiang": "己",
+    },
+    "乙庚合": {
+        "name": "乙庚合",
+        "guanxi": "合",
+        "father": None,
+        "leibie": "天干合",
+        "hehua": "金",
+        "tip": None,
+        "fangxiang": "庚",
+    },
+    "丙辛合": {
+        "name": "丙辛合",
+        "guanxi": "合",
+        "father": None,
+        "leibie": "天干合",
+        "hehua": "水",
+        "tip": None,
+        "fangxiang": "辛",
+    },
+    "丁壬合": {
+        "name": "丁壬合",
+        "guanxi": "合",
+        "father": None,
+        "leibie": "天干合",
+        "hehua": "木",
+        "tip": None,
+        "fangxiang": "壬",
+    },
+    "戊癸合": {
+        "name": "戊癸合",
+        "guanxi": "合",
+        "father": None,
+        "leibie": "天干合",
+        "hehua": "火",
+        "tip": None,
+        "fangxiang": "戊",
+    },
+    "甲庚冲": {
+        "name": "甲庚冲",
+        "guanxi": "冲",
+        "father": None,
+        "leibie": "天干冲",
+        "hehua": None,
+        "tip": None,
+        "fangxiang": None,
+    },
+    "乙辛冲": {
+        "name": "乙辛冲",
+        "guanxi": "冲",
+        "father": None,
+        "leibie": "天干冲",
+        "hehua": None,
+        "tip": None,
+        "fangxiang": None,
+    },
+    "丙壬冲": {
+        "name": "丙壬冲",
+        "guanxi": "冲",
+        "father": None,
+        "leibie": "天干冲",
+        "hehua": None,
+        "tip": None,
+        "fangxiang": None,
+    },
+    "丁癸冲": {
+        "name": "丁癸冲",
+        "guanxi": "冲",
+        "father": None,
+        "leibie": "天干冲",
+        "hehua": None,
+        "tip": None,
+        "fangxiang": None,
+    },
+    "子丑合": {
+        "name": "子丑合",
+        "guanxi": "合",
+        "father": None,
+        "leibie": "地支合",
+        "hehua": "土",
+        "tip": None,
+        "fangxiang": "丑",
+    },
+    "寅亥合": {
+        "name": "寅亥合",
+        "guanxi": "合",
+        "father": None,
+        "leibie": "地支合",
+        "hehua": "木",
+        "tip": None,
+        "fangxiang": "寅",
+    },
+    "卯戌合": {
+        "name": "卯戌合",
+        "guanxi": "合",
+        "father": None,
+        "leibie": "地支合",
+        "hehua": "火",
+        "tip": None,
+        "fangxiang": "戌",
+    },
+    "酉辰合": {
+        "name": "酉辰合",
+        "guanxi": "合",
+        "father": None,
+        "leibie": "地支合",
+        "hehua": "金",
+        "tip": None,
+        "fangxiang": "酉",
+    },
+    "巳申合": {
+        "name": "巳申合",
+        "guanxi": "合",
+        "father": None,
+        "leibie": "地支合",
+        "hehua": "水",
+        "tip": None,
+        "fangxiang": "申",
+    },
+    "午未合": {
+        "name": "午未合",
+        "guanxi": "合",
+        "father": None,
+        "leibie": "地支合",
+        "hehua": "火",
+        "tip": None,
+        "fangxiang": "午",
+    },
+    "子午冲": {
+        "name": "子午冲",
+        "guanxi": "冲",
+        "father": None,
+        "leibie": "地支冲",
+        "hehua": None,
+        "tip": "表示无妄之灾,特点是突发、迅猛,但是后果不严重,或者当场消停,虚惊一场。对应在健康上,需有人陪伴。",
+        "fangxiang": None,
+    },
+    "巳亥冲": {
+        "name": "巳亥冲",
+        "guanxi": "冲",
+        "father": None,
+        "leibie": "地支冲",
+        "hehua": None,
+        "tip": "水火斗为主,伴随金木斗,影响肝脏、肺部健康,遇见应多去体检身体,确保健康,相对健康影响比较大",
+        "fangxiang": None,
+    },
+    "卯酉冲": {
+        "name": "卯酉冲",
+        "guanxi": "冲",
+        "father": None,
+        "leibie": "地支冲",
+        "hehua": None,
+        "tip": "主血光之灾(比如开刀),影响肝胆、肺部、食道、呼吸道、肠道健康",
+        "fangxiang": None,
+    },
+    "申寅冲": {
+        "name": "申寅冲",
+        "guanxi": "冲",
+        "father": None,
+        "leibie": "地支冲",
+        "hehua": None,
+        "tip": "主内伤,多作用在肾脏、心脑血管,多急症。",
+        "fangxiang": None,
+    },
+    "辰戌冲": {
+        "name": "辰戌冲",
+        "guanxi": "冲",
+        "father": None,
+        "leibie": "地支冲",
+        "hehua": None,
+        "tip": "主开库,开库后引发乙辛冲、丁癸冲",
+        "fangxiang": None,
+    },
+    "丑未冲": {
+        "name": "丑未冲",
+        "guanxi": "冲",
+        "father": None,
+        "leibie": "地支冲",
+        "hehua": None,
+        "tip": "主开库,开库后引发乙辛冲、丁癸冲",
+        "fangxiang": None,
+    },
+    "寅丑暗合": {
+        "name": "寅丑暗合",
+        "guanxi": "暗合",
+        "father": None,
+        "leibie": "地支暗合",
+        "hehua": "土",
+        "tip": None,
+        "fangxiang": "丑",
+    },
+    "午亥暗合": {
+        "name": "午亥暗合",
+        "guanxi": "暗合",
+        "father": None,
+        "leibie": "地支暗合",
+        "hehua": "木",
+        "tip": None,
+        "fangxiang": "亥",
+    },
+    "申卯暗合": {
+        "name": "申卯暗合",
+        "guanxi": "暗合",
+        "father": None,
+        "leibie": "地支暗合",
+        "hehua": "金",
+        "tip": None,
+        "fangxiang": "申",
+    },
+    "子辰半合": {
+        "name": "子辰半合",
+        "guanxi": "半合",
+        "father": None,
+        "leibie": "地支三合",
+        "hehua": "水",
+        "tip": None,
+        "fangxiang": "子",
+    },
+    "申子半合": {
+        "name": "申子半合",
+        "guanxi": "半合",
+        "father": None,
+        "leibie": "地支三合",
+        "hehua": "水",
+        "tip": None,
+        "fangxiang": "子",
+    },
+    "亥卯半合": {
+        "name": "亥卯半合",
+        "guanxi": "半合",
+        "father": None,
+        "leibie": "地支三合",
+        "hehua": "木",
+        "tip": None,
+        "fangxiang": "卯",
+    },
+    "卯未半合": {
+        "name": "卯未半合",
+        "guanxi": "半合",
+        "father": None,
+        "leibie": "地支三合",
+        "hehua": "木",
+        "tip": None,
+        "fangxiang": "卯",
+    },
+    "寅午半合": {
+        "name": "寅午半合",
+        "guanxi": "半合",
+        "father": None,
+        "leibie": "地支三合",
+        "hehua": "火",
+        "tip": None,
+        "fangxiang": "午",
+    },
+    "午戌半合": {
+        "name": "午戌半合",
+        "guanxi": "半合",
+        "father": None,
+        "leibie": "地支三合",
+        "hehua": "火",
+        "tip": None,
+        "fangxiang": "午",
+    },
+    "巳酉半合": {
+        "name": "巳酉半合",
+        "guanxi": "半合",
+        "father": None,
+        "leibie": "地支三合",
+        "hehua": "金",
+        "tip": None,
+        "fangxiang": "酉",
+    },
+    "酉丑半合": {
+        "name": "酉丑半合",
+        "guanxi": "半合",
+        "father": None,
+        "leibie": "地支三合",
+        "hehua": "金",
+        "tip": None,
+        "fangxiang": "酉",
+    },
+    "申辰拱合": {
+        "name": "申辰拱合",
+        "guanxi": "拱合",
+        "father": None,
+        "leibie": "地支三合",
+        "hehua": "水",
+        "tip": None,
+        "fangxiang": "子",
+    },
+    "亥未拱合": {
+        "name": "亥未拱合",
+        "guanxi": "拱合",
+        "father": None,
+        "leibie": "地支三合",
+        "hehua": "木",
+        "tip": None,
+        "fangxiang": "卯",
+    },
+    "寅戌拱合": {
+        "name": "寅戌拱合",
+        "guanxi": "拱合",
+        "father": None,
+        "leibie": "地支三合",
+        "hehua": "火",
+        "tip": None,
+        "fangxiang": "午",
+    },
+    "巳丑拱合": {
+        "name": "巳丑拱合",
+        "guanxi": "拱合",
+        "father": None,
+        "leibie": "地支三合",
+        "hehua": "金",
+        "tip": None,
+        "fangxiang": "酉",
+    },
+    "寅卯辰三会": {
+        "name": "寅卯辰三会",
+        "guanxi": "三会",
+        "father": None,
+        "leibie": "地支三会",
+        "hehua": "木",
+        "tip": None,
+        "fangxiang": "卯",
+    },
+    "巳午未三会": {
+        "name": "巳午未三会",
+        "guanxi": "三会",
+        "father": None,
+        "leibie": "地支三会",
+        "hehua": "火",
+        "tip": None,
+        "fangxiang": "午",
+    },
+    "申酉戌三会": {
+        "name": "申酉戌三会",
+        "guanxi": "三会",
+        "father": None,
+        "leibie": "地支三会",
+        "hehua": "金",
+        "tip": None,
+        "fangxiang": "酉",
+    },
+    "亥子丑三会": {
+        "name": "亥子丑三会",
+        "guanxi": "三会",
+        "father": None,
+        "leibie": "地支三会",
+        "hehua": "水",
+        "tip": None,
+        "fangxiang": "子",
+    },
+    "子卯刑": {
+        "name": "子卯刑",
+        "guanxi": "刑",
+        "father": None,
+        "leibie": "地支刑",
+        "hehua": None,
+        "tip": "一方付出,另一方不领情 ",
+        "fangxiang": None,
+    },
+    "寅巳刑": {
+        "name": "寅巳刑",
+        "guanxi": "刑",
+        "father": None,
+        "leibie": "地支刑",
+        "hehua": None,
+        "tip": None,
+        "fangxiang": None,
+    },
+    "巳申刑": {
+        "name": "巳申刑",
+        "guanxi": "刑",
+        "father": None,
+        "leibie": "地支刑",
+        "hehua": None,
+        "tip": None,
+        "fangxiang": None,
+    },
+    "戌未刑": {
+        "name": "戌未刑",
+        "guanxi": "刑",
+        "father": None,
+        "leibie": "地支刑",
+        "hehua": None,
+        "tip": None,
+        "fangxiang": None,
+    },
+    "丑戌刑": {
+        "name": "丑戌刑",
+        "guanxi": "刑",
+        "father": None,
+        "leibie": "地支刑",
+        "hehua": None,
+        "tip": "容易动刀,刑在年柱应期在0-15岁,往后每柱增加15岁应期,循环往复。也可能应在不同柱所代表的六亲身上。",
+        "fangxiang": None,
+    },
+    "辰辰自刑": {
+        "name": "辰辰自刑",
+        "guanxi": "自刑",
+        "father": None,
+        "leibie": "地支自刑",
+        "hehua": None,
+        "tip": "容易庸人自扰,念头不通畅,进入哲学思维模式",
+        "fangxiang": None,
+    },
+    "午午自刑": {
+        "name": "午午自刑",
+        "guanxi": "自刑",
+        "father": None,
+        "leibie": "地支自刑",
+        "hehua": None,
+        "tip": "容易口舌是非、空想,产生自我心理幻觉,无中生有又以此与人争执,或者喜欢没完没了的抱怨吐槽",
+        "fangxiang": None,
+    },
+    "酉酉自刑": {
+        "name": "酉酉自刑",
+        "guanxi": "自刑",
+        "father": None,
+        "leibie": "地支自刑",
+        "hehua": None,
+        "tip": "容易神神叨叨,为金钱烦恼,喜欢抬扛",
+        "fangxiang": None,
+    },
+    "亥亥自刑": {
+        "name": "亥亥自刑",
+        "guanxi": "自刑",
+        "father": None,
+        "leibie": "地支自刑",
+        "hehua": None,
+        "tip": "容易顾虑太多,选择困难",
+        "fangxiang": None,
+    },
+    "卯午破": {
+        "name": "卯午破",
+        "guanxi": "破",
+        "father": None,
+        "leibie": "地支破",
+        "hehua": None,
+        "tip": "才多识广,读书破万卷(有家学渊源才行);也指婚姻、感情破裂",
+        "fangxiang": None,
+    },
+    "午酉破": {
+        "name": "午酉破",
+        "guanxi": "破",
+        "father": None,
+        "leibie": "地支破",
+        "hehua": None,
+        "tip": "离婚、也指炒股、贷款、金融上的投资不利,也表示抵押、车祸",
+        "fangxiang": None,
+    },
+    "子酉破": {
+        "name": "子酉破",
+        "guanxi": "破",
+        "father": None,
+        "leibie": "地支破",
+        "hehua": None,
+        "tip": None,
+        "fangxiang": None,
+    },
+    "巳申破": {
+        "name": "巳申破",
+        "guanxi": "破",
+        "father": None,
+        "leibie": "地支破",
+        "hehua": None,
+        "tip": None,
+        "fangxiang": None,
+    },
+    "丑辰破": {
+        "name": "丑辰破",
+        "guanxi": "破",
+        "father": None,
+        "leibie": "地支破",
+        "hehua": None,
+        "tip": None,
+        "fangxiang": None,
+    },
+    "寅亥破": {
+        "name": "寅亥破",
+        "guanxi": "破",
+        "father": None,
+        "leibie": "地支破",
+        "hehua": None,
+        "tip": None,
+        "fangxiang": None,
+    },
+    "戌未破": {
+        "name": "戌未破",
+        "guanxi": "破",
+        "father": None,
+        "leibie": "地支破",
+        "hehua": None,
+        "tip": None,
+        "fangxiang": None,
+    },
+    "子未穿": {
+        "name": "子未穿",
+        "guanxi": "穿",
+        "father": None,
+        "leibie": "地支穿",
+        "hehua": None,
+        "tip": "不计代价的除掉对方",
+        "fangxiang": None,
+    },
+    "卯辰穿": {
+        "name": "卯辰穿",
+        "guanxi": "穿",
+        "father": None,
+        "leibie": "地支穿",
+        "hehua": None,
+        "tip": "凶险度很高的穿,慢性伤害,渗透后伤害",
+        "fangxiang": None,
+    },
+    "酉戌穿": {
+        "name": "酉戌穿",
+        "guanxi": "穿",
+        "father": None,
+        "leibie": "地支穿",
+        "hehua": None,
+        "tip": "凶险度很高的穿,突发伤害,同归于尽的决绝,也指舆情、爆炸性新闻。穿配偶宫一旦领证就容易互相伤害,直到老死不相往来",
+        "fangxiang": None,
+    },
+    "午丑穿": {
+        "name": "午丑穿",
+        "guanxi": "穿",
+        "father": None,
+        "leibie": "地支穿",
+        "hehua": None,
+        "tip": None,
+        "fangxiang": None,
+    },
+    "寅巳穿": {
+        "name": "寅巳穿",
+        "guanxi": "穿",
+        "father": None,
+        "leibie": "地支穿",
+        "hehua": None,
+        "tip": "容易以卵击石,以小搏大",
+        "fangxiang": None,
+    },
+    "申亥穿": {
+        "name": "申亥穿",
+        "guanxi": "穿",
+        "father": None,
+        "leibie": "地支穿",
+        "hehua": None,
+        "tip": "穿肠毒药,容易影响肠胃健康、出现肾病、宫寒、性病等",
+        "fangxiang": None,
+    },
+}
+
+config_gaoneng_query = {
+    "甲己": [config_gaoneng["甲己合"]],
+    "己甲": [config_gaoneng["甲己合"]],
+    "乙庚": [config_gaoneng["乙庚合"]],
+    "庚乙": [config_gaoneng["乙庚合"]],
+    "丙辛": [config_gaoneng["丙辛合"]],
+    "辛丙": [config_gaoneng["丙辛合"]],
+    "丁壬": [config_gaoneng["丁壬合"]],
+    "壬丁": [config_gaoneng["丁壬合"]],
+    "戊癸": [config_gaoneng["戊癸合"]],
+    "癸戊": [config_gaoneng["戊癸合"]],
+
+    "甲庚": [config_gaoneng["甲庚冲"]],
+    "庚甲": [config_gaoneng["甲庚冲"]],
+    "乙辛": [config_gaoneng["乙辛冲"]],
+    "辛乙": [config_gaoneng["乙辛冲"]],
+    "丙壬": [config_gaoneng["丙壬冲"]],
+    "壬丙": [config_gaoneng["丙壬冲"]],
+    "丁癸": [config_gaoneng["丁癸冲"]],
+    "癸丁": [config_gaoneng["丁癸冲"]],
+
+    "子丑": [config_gaoneng["子丑合"]],
+    "丑子": [config_gaoneng["子丑合"]],
+    "寅亥": [config_gaoneng["寅亥合"], config_gaoneng["寅亥破"]],
+    "亥寅": [config_gaoneng["寅亥合"], config_gaoneng["寅亥破"]],
+    "卯戌": [config_gaoneng["卯戌合"]],
+    "戌卯": [config_gaoneng["卯戌合"]],
+    "酉辰": [config_gaoneng["酉辰合"]],
+    "辰酉": [config_gaoneng["酉辰合"]],
+    "巳申": [config_gaoneng["巳申合"], config_gaoneng["巳申刑"], config_gaoneng["巳申破"]],
+    "申巳": [config_gaoneng["巳申合"], config_gaoneng["巳申刑"], config_gaoneng["巳申破"]],
+    "午未": [config_gaoneng["午未合"]],
+    "未午": [config_gaoneng["午未合"]],
+
+    "子午": [config_gaoneng["子午冲"]],
+    "午子": [config_gaoneng["子午冲"]],
+    "巳亥": [config_gaoneng["巳亥冲"]],
+    "亥巳": [config_gaoneng["巳亥冲"]],
+    "卯酉": [config_gaoneng["卯酉冲"]],
+    "酉卯": [config_gaoneng["卯酉冲"]],
+    "申寅": [config_gaoneng["申寅冲"]],
+    "寅申": [config_gaoneng["申寅冲"]],
+    "辰戌": [config_gaoneng["辰戌冲"]],
+    "戌辰": [config_gaoneng["辰戌冲"]],
+    "丑未": [config_gaoneng["丑未冲"]],
+    "未丑": [config_gaoneng["丑未冲"]],
+
+    "寅丑": [config_gaoneng["寅丑暗合"]],
+    "丑寅": [config_gaoneng["寅丑暗合"]],
+    "午亥": [config_gaoneng["午亥暗合"]],
+    "亥午": [config_gaoneng["午亥暗合"]],
+    "申卯": [config_gaoneng["申卯暗合"]],
+    "卯申": [config_gaoneng["申卯暗合"]],
+
+    "子辰": [config_gaoneng["子辰半合"]],
+    "辰子": [config_gaoneng["子辰半合"]],
+    "申子": [config_gaoneng["申子半合"]],
+    "子申": [config_gaoneng["申子半合"]],
+    "亥卯": [config_gaoneng["亥卯半合"]],
+    "卯亥": [config_gaoneng["亥卯半合"]],
+    "卯未": [config_gaoneng["卯未半合"]],
+    "未卯": [config_gaoneng["卯未半合"]],
+    "寅午": [config_gaoneng["寅午半合"]],
+    "午寅": [config_gaoneng["寅午半合"]],
+    "午戌": [config_gaoneng["午戌半合"]],
+    "戌午": [config_gaoneng["午戌半合"]],
+    "巳酉": [config_gaoneng["巳酉半合"]],
+    "酉巳": [config_gaoneng["巳酉半合"]],
+    "酉丑": [config_gaoneng["酉丑半合"]],
+    "丑酉": [config_gaoneng["酉丑半合"]],
+
+    "申辰": [config_gaoneng["申辰拱合"]],
+    "辰申": [config_gaoneng["申辰拱合"]],
+    "亥未": [config_gaoneng["亥未拱合"]],
+    "未亥": [config_gaoneng["亥未拱合"]],
+    "寅戌": [config_gaoneng["寅戌拱合"]],
+    "戌寅": [config_gaoneng["寅戌拱合"]],
+    "巳丑": [config_gaoneng["巳丑拱合"]],
+    "丑巳": [config_gaoneng["巳丑拱合"]],
+
+    "寅卯辰": [config_gaoneng["寅卯辰三会"]],
+    "寅辰卯": [config_gaoneng["寅卯辰三会"]],
+    "卯寅辰": [config_gaoneng["寅卯辰三会"]],
+    "卯辰寅": [config_gaoneng["寅卯辰三会"]],
+    "辰寅卯": [config_gaoneng["寅卯辰三会"]],
+    "辰卯寅": [config_gaoneng["寅卯辰三会"]],
+    "巳午未": [config_gaoneng["巳午未三会"]],
+    "巳未午": [config_gaoneng["巳午未三会"]],
+    "午巳未": [config_gaoneng["巳午未三会"]],
+    "午未巳": [config_gaoneng["巳午未三会"]],
+    "未巳午": [config_gaoneng["巳午未三会"]],
+    "未午巳": [config_gaoneng["巳午未三会"]],
+    "申酉戌": [config_gaoneng["申酉戌三会"]],
+    "申戌酉": [config_gaoneng["申酉戌三会"]],
+    "酉申戌": [config_gaoneng["申酉戌三会"]],
+    "酉戌申": [config_gaoneng["申酉戌三会"]],
+    "戌申酉": [config_gaoneng["申酉戌三会"]],
+    "戌酉申": [config_gaoneng["申酉戌三会"]],
+    "亥子丑": [config_gaoneng["亥子丑三会"]],
+    "亥丑子": [config_gaoneng["亥子丑三会"]],
+    "子亥丑": [config_gaoneng["亥子丑三会"]],
+    "子丑亥": [config_gaoneng["亥子丑三会"]],
+    "丑亥子": [config_gaoneng["亥子丑三会"]],
+    "丑子亥": [config_gaoneng["亥子丑三会"]],
+
+    "子卯": [config_gaoneng["子卯刑"]],
+    "卯子": [config_gaoneng["子卯刑"]],
+    "寅巳": [config_gaoneng["寅巳刑"], config_gaoneng["寅巳穿"]],
+    "巳寅": [config_gaoneng["寅巳刑"], config_gaoneng["寅巳穿"]],
+    "戌未": [config_gaoneng["戌未刑"], config_gaoneng["戌未破"]],
+    "未戌": [config_gaoneng["戌未刑"], config_gaoneng["戌未破"]],
+    "丑戌": [config_gaoneng["丑戌刑"]],
+    "戌丑": [config_gaoneng["丑戌刑"]],
+
+    "辰辰": [config_gaoneng["辰辰自刑"]],
+    "午午": [config_gaoneng["午午自刑"]],
+    "酉酉": [config_gaoneng["酉酉自刑"]],
+    "亥亥": [config_gaoneng["亥亥自刑"]],
+
+    "卯午": [config_gaoneng["卯午破"]],
+    "午卯": [config_gaoneng["卯午破"]],
+    "午酉": [config_gaoneng["午酉破"]],
+    "酉午": [config_gaoneng["午酉破"]],
+    "子酉": [config_gaoneng["子酉破"]],
+    "酉子": [config_gaoneng["子酉破"]],
+    "丑辰": [config_gaoneng["丑辰破"]],
+    "辰丑": [config_gaoneng["丑辰破"]],
+
+    "子未": [config_gaoneng["子未穿"]],
+    "未子": [config_gaoneng["子未穿"]],
+    "卯辰": [config_gaoneng["卯辰穿"]],
+    "辰卯": [config_gaoneng["卯辰穿"]],
+    "酉戌": [config_gaoneng["酉戌穿"]],
+    "戌酉": [config_gaoneng["酉戌穿"]],
+    "午丑": [config_gaoneng["午丑穿"]],
+    "丑午": [config_gaoneng["午丑穿"]],
+    "申亥": [config_gaoneng["申亥穿"]],
+    "亥申": [config_gaoneng["申亥穿"]],
+}
+config_gaoneng_key = {
+    "甲": [config_gaoneng["甲己合"], config_gaoneng["甲庚冲"]],
+    "乙": [config_gaoneng["乙庚合"], config_gaoneng["乙辛冲"]],
+    "丙": [config_gaoneng["丙辛合"], config_gaoneng["丙壬冲"]],
+    "丁": [config_gaoneng["丁壬合"], config_gaoneng["丁癸冲"]],
+    "戊": [config_gaoneng["戊癸合"]],
+    "己": [config_gaoneng["甲己合"]],
+    "庚": [config_gaoneng["乙庚合"], config_gaoneng["甲庚冲"]],
+    "辛": [config_gaoneng["丙辛合"], config_gaoneng["乙辛冲"]],
+    "壬": [config_gaoneng["丁壬合"], config_gaoneng["丙壬冲"]],
+    "癸": [config_gaoneng["戊癸合"], config_gaoneng["丁癸冲"]],
+    "子": [config_gaoneng["子丑合"], config_gaoneng["子午冲"], config_gaoneng["子午冲"], config_gaoneng["子酉破"],
+           config_gaoneng["子辰半合"], config_gaoneng["子卯刑"], config_gaoneng["申子半合"],
+           config_gaoneng["亥子丑三会"], config_gaoneng["子未穿"]],
+    "丑": [config_gaoneng["子丑合"], config_gaoneng["丑未冲"], config_gaoneng["午丑穿"], config_gaoneng["丑辰破"],
+           config_gaoneng["丑戌刑"], config_gaoneng["寅丑暗合"], config_gaoneng["酉丑半合"], config_gaoneng["巳丑拱合"],
+           config_gaoneng["亥子丑三会"]],
+    "寅": [config_gaoneng["寅亥合"], config_gaoneng["申寅冲"], config_gaoneng["寅巳穿"], config_gaoneng["寅亥破"],
+           config_gaoneng["寅巳刑"], config_gaoneng["寅丑暗合"], config_gaoneng["寅午半合"], config_gaoneng["寅戌拱合"],
+           config_gaoneng["寅卯辰三会"]],
+    "卯": [config_gaoneng["卯戌合"], config_gaoneng["卯酉冲"], config_gaoneng["卯辰穿"], config_gaoneng["卯午破"],
+           config_gaoneng["子卯刑"], config_gaoneng["卯未半合"], config_gaoneng["亥卯半合"], config_gaoneng["申卯暗合"],
+           config_gaoneng["寅卯辰三会"]],
+    "辰": [config_gaoneng["酉辰合"], config_gaoneng["辰戌冲"], config_gaoneng["卯辰穿"], config_gaoneng["丑辰破"],
+           config_gaoneng["辰辰自刑"], config_gaoneng["子辰半合"], config_gaoneng["申辰拱合"],
+           config_gaoneng["寅卯辰三会"]],
+    "巳": [config_gaoneng["巳申合"], config_gaoneng["巳亥冲"], config_gaoneng["寅巳穿"], config_gaoneng["巳申破"],
+           config_gaoneng["巳申刑"], config_gaoneng["巳酉半合"], config_gaoneng["巳丑拱合"], config_gaoneng["寅巳刑"],
+           config_gaoneng["巳午未三会"]],
+    "午": [config_gaoneng["午未合"], config_gaoneng["子午冲"], config_gaoneng["午丑穿"], config_gaoneng["卯午破"],
+           config_gaoneng["午酉破"], config_gaoneng["午午自刑"], config_gaoneng["午亥暗合"], config_gaoneng["午戌半合"],
+           config_gaoneng["寅午半合"], config_gaoneng["巳午未三会"]],
+    "未": [config_gaoneng["午未合"], config_gaoneng["丑未冲"], config_gaoneng["子未穿"], config_gaoneng["戌未破"],
+           config_gaoneng["戌未刑"], config_gaoneng["卯未半合"], config_gaoneng["亥未拱合"],
+           config_gaoneng["巳午未三会"]],
+    "申": [config_gaoneng["巳申合"], config_gaoneng["申寅冲"], config_gaoneng["申亥穿"], config_gaoneng["巳申破"],
+           config_gaoneng["巳申刑"], config_gaoneng["申子半合"], config_gaoneng["申卯暗合"], config_gaoneng["申辰拱合"],
+           config_gaoneng["申酉戌三会"]],
+    "酉": [config_gaoneng["酉辰合"], config_gaoneng["卯酉冲"], config_gaoneng["酉戌穿"], config_gaoneng["午酉破"],
+           config_gaoneng["子酉破"], config_gaoneng["酉酉自刑"], config_gaoneng["酉丑半合"], config_gaoneng["巳酉半合"],
+           config_gaoneng["申酉戌三会"]],
+    "戌": [config_gaoneng["卯戌合"], config_gaoneng["辰戌冲"], config_gaoneng["酉戌穿"], config_gaoneng["戌未破"],
+           config_gaoneng["丑戌刑"], config_gaoneng["午戌半合"], config_gaoneng["寅戌拱合"], config_gaoneng["戌未刑"],
+           config_gaoneng["申酉戌三会"]],
+    "亥": [config_gaoneng["寅亥合"], config_gaoneng["巳亥冲"], config_gaoneng["申亥穿"], config_gaoneng["寅亥破"],
+           config_gaoneng["亥亥自刑"], config_gaoneng["亥未拱合"], config_gaoneng["午亥暗合"],
+           config_gaoneng["亥卯半合"], config_gaoneng["亥子丑三会"]],
+}
+config_gaoneng_score = {
+    "合": {
+        "官": {
+            "官": 2,
+            "杀": 1,
+            "财": 8,
+            "才": 7,
+            "印": 10,
+            "枭": 9,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "杀": {
+            "官": 2,
+            "杀": 1,
+            "财": 8,
+            "才": 7,
+            "印": 10,
+            "枭": 9,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "财": {
+            "官": 8,
+            "杀": 7,
+            "财": 2,
+            "才": 1,
+            "印": 10,
+            "枭": 9,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "才": {
+            "官": 8,
+            "杀": 7,
+            "财": 2,
+            "才": 1,
+            "印": 10,
+            "枭": 9,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "印": {
+            "官": 9,
+            "杀": 10,
+            "财": 8,
+            "才": 7,
+            "印": 2,
+            "枭": 1,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "枭": {
+            "官": 9,
+            "杀": 10,
+            "财": 8,
+            "才": 7,
+            "印": 2,
+            "枭": 1,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "食": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 2,
+            "伤": 1,
+            "比": 4,
+            "劫": 3,
+        },
+        "伤": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 2,
+            "伤": 1,
+            "比": 4,
+            "劫": 3,
+        },
+        "比": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 4,
+            "伤": 3,
+            "比": 2,
+            "劫": 1,
+        },
+        "劫": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 4,
+            "伤": 3,
+            "比": 2,
+            "劫": 1,
+        },
+    },
+    "暗合": {
+        "官": {
+            "官": 2,
+            "杀": 1,
+            "财": 8,
+            "才": 7,
+            "印": 10,
+            "枭": 9,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "杀": {
+            "官": 2,
+            "杀": 1,
+            "财": 8,
+            "才": 7,
+            "印": 10,
+            "枭": 9,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "财": {
+            "官": 8,
+            "杀": 7,
+            "财": 2,
+            "才": 1,
+            "印": 10,
+            "枭": 9,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "才": {
+            "官": 8,
+            "杀": 7,
+            "财": 2,
+            "才": 1,
+            "印": 10,
+            "枭": 9,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "印": {
+            "官": 9,
+            "杀": 10,
+            "财": 8,
+            "才": 7,
+            "印": 2,
+            "枭": 1,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "枭": {
+            "官": 9,
+            "杀": 10,
+            "财": 8,
+            "才": 7,
+            "印": 2,
+            "枭": 1,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "食": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 2,
+            "伤": 1,
+            "比": 4,
+            "劫": 3,
+        },
+        "伤": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 2,
+            "伤": 1,
+            "比": 4,
+            "劫": 3,
+        },
+        "比": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 4,
+            "伤": 3,
+            "比": 2,
+            "劫": 1,
+        },
+        "劫": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 4,
+            "伤": 3,
+            "比": 2,
+            "劫": 1,
+        },
+    },
+    "半合": {
+        "官": {
+            "官": 2,
+            "杀": 1,
+            "财": 8,
+            "才": 7,
+            "印": 10,
+            "枭": 9,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "杀": {
+            "官": 2,
+            "杀": 1,
+            "财": 8,
+            "才": 7,
+            "印": 10,
+            "枭": 9,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "财": {
+            "官": 8,
+            "杀": 7,
+            "财": 2,
+            "才": 1,
+            "印": 10,
+            "枭": 9,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "才": {
+            "官": 8,
+            "杀": 7,
+            "财": 2,
+            "才": 1,
+            "印": 10,
+            "枭": 9,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "印": {
+            "官": 9,
+            "杀": 10,
+            "财": 8,
+            "才": 7,
+            "印": 2,
+            "枭": 1,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "枭": {
+            "官": 9,
+            "杀": 10,
+            "财": 8,
+            "才": 7,
+            "印": 2,
+            "枭": 1,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "食": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 2,
+            "伤": 1,
+            "比": 4,
+            "劫": 3,
+        },
+        "伤": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 2,
+            "伤": 1,
+            "比": 4,
+            "劫": 3,
+        },
+        "比": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 4,
+            "伤": 3,
+            "比": 2,
+            "劫": 1,
+        },
+        "劫": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 4,
+            "伤": 3,
+            "比": 2,
+            "劫": 1,
+        },
+    },
+    "拱合": {
+        "官": {
+            "官": 2,
+            "杀": 1,
+            "财": 8,
+            "才": 7,
+            "印": 10,
+            "枭": 9,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "杀": {
+            "官": 2,
+            "杀": 1,
+            "财": 8,
+            "才": 7,
+            "印": 10,
+            "枭": 9,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "财": {
+            "官": 8,
+            "杀": 7,
+            "财": 2,
+            "才": 1,
+            "印": 10,
+            "枭": 9,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "才": {
+            "官": 8,
+            "杀": 7,
+            "财": 2,
+            "才": 1,
+            "印": 10,
+            "枭": 9,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "印": {
+            "官": 9,
+            "杀": 10,
+            "财": 8,
+            "才": 7,
+            "印": 2,
+            "枭": 1,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "枭": {
+            "官": 9,
+            "杀": 10,
+            "财": 8,
+            "才": 7,
+            "印": 2,
+            "枭": 1,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "食": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 2,
+            "伤": 1,
+            "比": 4,
+            "劫": 3,
+        },
+        "伤": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 2,
+            "伤": 1,
+            "比": 4,
+            "劫": 3,
+        },
+        "比": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 4,
+            "伤": 3,
+            "比": 2,
+            "劫": 1,
+        },
+        "劫": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 4,
+            "伤": 3,
+            "比": 2,
+            "劫": 1,
+        },
+    },
+    "冲": {
+        "官": {
+            "官": 2,
+            "杀": 1,
+            "财": 10,
+            "才": 9,
+            "印": 4,
+            "枭": 3,
+            "食": 6,
+            "伤": 5,
+            "比": 8,
+            "劫": 7,
+        },
+        "杀": {
+            "官": 2,
+            "杀": 1,
+            "财": 10,
+            "才": 9,
+            "印": 4,
+            "枭": 3,
+            "食": 6,
+            "伤": 5,
+            "比": 8,
+            "劫": 7,
+        },
+        "财": {
+            "官": 8,
+            "杀": 7,
+            "财": 2,
+            "才": 1,
+            "印": 10,
+            "枭": 9,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "才": {
+            "官": 8,
+            "杀": 7,
+            "财": 2,
+            "才": 1,
+            "印": 10,
+            "枭": 9,
+            "食": 6,
+            "伤": 5,
+            "比": 4,
+            "劫": 3,
+        },
+        "印": {
+            "官": 4,
+            "杀": 3,
+            "财": 10,
+            "才": 9,
+            "印": 2,
+            "枭": 1,
+            "食": 8,
+            "伤": 7,
+            "比": 6,
+            "劫": 5,
+        },
+        "枭": {
+            "官": 4,
+            "杀": 3,
+            "财": 10,
+            "才": 9,
+            "印": 2,
+            "枭": 1,
+            "食": 8,
+            "伤": 7,
+            "比": 6,
+            "劫": 5,
+        },
+        "食": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 2,
+            "伤": 1,
+            "比": 4,
+            "劫": 3,
+        },
+        "伤": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 2,
+            "伤": 1,
+            "比": 4,
+            "劫": 3,
+        },
+        "比": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 4,
+            "伤": 3,
+            "比": 2,
+            "劫": 1,
+        },
+        "劫": {
+            "官": 8,
+            "杀": 7,
+            "财": 6,
+            "才": 5,
+            "印": 10,
+            "枭": 9,
+            "食": 4,
+            "伤": 3,
+            "比": 2,
+            "劫": 1,
+        },
+    },
+    "穿": {
+        "官": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "杀": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "财": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "才": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "印": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "枭": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "食": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "伤": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "比": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "劫": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+    },
+    "破": {
+        "官": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "杀": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "财": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "才": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "印": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "枭": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "食": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "伤": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "比": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "劫": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+    },
+    "刑": {
+        "官": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "杀": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "财": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "才": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "印": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "枭": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "食": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "伤": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "比": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+        "劫": {
+            "官": 3,
+            "杀": 4,
+            "财": 5,
+            "才": 6,
+            "印": 1,
+            "枭": 2,
+            "食": 7,
+            "伤": 8,
+            "比": 9,
+            "劫": 10,
+        },
+    },
+}
+config_gaoneng_guanxi_score = {
+    "合": 50,
+    "暗合": 40,
+    "半合": 0,
+    "拱合": 0,
+    "刑": -30,
+    "冲": -20,
+    "穿": -40,
+    "破": -35,
+}
+config_gaoneng_lushen_score = {
+    "合": 80,
+    "暗合": 70,
+    "冲": 10,
+    "刑": -10,
+    "破": -20,
+    "穿": -30,
+}
+
+# 这个配置是关于格局中财富来源的后续判断,比如财从印来,key就是印,然后看印被什么所穿所刑,去判断要预防哪些情况导致财富损失。
+# 前缀:但要小心
+config_gaoneng_hanyi_cai = {
+    "刑官": "容易背后遭人非议。",
+    "穿官": "背后的非议可能导致自己地位受损。",
+    "刑杀": "过多的机会、资源可能使自己无法专注,不能什么都要。",
+    "穿杀": "不是什么机会都是好的,要注意甄别。",
+    "刑财": "想要的太多有可能导致自己反而被困住。",
+    "穿财": "不该赚的钱不要去赚。",
+    "刑才": "过于激进和冒险容易让自己被困住。",
+    "穿才": "不该赚的钱不要去赚。",
+    "刑印": "不要过于依赖助力、权力。",
+    "穿印": "维护好贵人,保护自身根基。",
+    "刑枭": "不要过于依赖助力、要打好根基。",
+    "穿枭": "维护好贵人,保护自身根基。",
+    "刑食": "自身未必能尽展才华,情绪也容易陷入其中。",
+    "穿食": "决策上的错误可能导致财富受损。",
+    "刑伤": "做事情可能并不顺畅,行动成效低。",
+    "穿伤": "错误的行动可能导致财富受损。",
+    "刑比": "自身及团队容易被绑定其中,并不能按自己的期望行事。",
+    "穿比": "自我认同容易出问题,容易失去团队支持。",
+    "刑劫": "不要过于依赖他人的资源和能力。",
+    "穿劫": "不恰当的合作伙伴可能带来负面影响。",
+}
+
+# 关联主要是事业、健康、情感
+config_gaoneng_he = {
+    "官财": [
+        {
+            "解读": "名望地位带来财富。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "官才": [
+        {
+            "解读": "名望地位带来意外财富。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "官印": [
+        {
+            "解读": "得权得势,根基稳固。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "官食": [
+        {
+            "解读": "才华被认可,千里马遇伯乐。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "官伤": [
+        {
+            "解读": "为目标而努力,圈子有份量。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "官比": [
+        {
+            "解读": "极具个人魅力和领导力,团队一条心。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "官劫": [
+        {
+            "解读": "与人合作有保障,能化险为夷。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "杀财": [
+        {
+            "解读": "社会资源带来财富机会。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "杀才": [
+        {
+            "解读": "社会资源带来意外收获。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "杀枭": [
+        {
+            "解读": "容易得到帮助化解压力,但是这种助力并不稳定。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "杀食": [
+        {
+            "解读": "有足够的能力去应对压力,争取机会。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "杀伤": [
+        {
+            "解读": "常常要面临超过自己能力的挑战。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "杀比": [
+        {
+            "解读": "事务繁多,压力大,健康容易受影响。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "杀劫": [
+        {
+            "解读": "机会多助力少,处处救火,累自身。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "财官": [
+        {
+            "解读": "名望地位带来财富。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "财印": [
+        {
+            "解读": "根基牢固,事业带来稳定财富。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "财枭": [
+        {
+            "解读": "事业带来财富,但是事业多有波动。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "财食": [
+        {
+            "解读": "所学所知都能创造财富。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "财伤": [
+        {
+            "解读": "圈子、人脉带来财富机会。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "财比": [
+        {
+            "解读": "财富收入稳定。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "财劫": [
+        {
+            "解读": "与人合作赚钱,多依赖他人资源,要分出利益。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "才杀": [
+        {
+            "解读": "靠社会资源赚钱,财富波动大。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "才印": [
+        {
+            "解读": "事业上收入不稳定,波动大。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "才枭": [
+        {
+            "解读": "事业和收入都不稳定,波动大。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "才食": [
+        {
+            "解读": "靠一技之长赚钱,收入不稳定。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "才伤": [
+        {
+            "解读": "靠圈子、人脉赚钱,收入不稳定。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "才比": [
+        {
+            "解读": "财富波动大,不稳定。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "才劫": [
+        {
+            "解读": "多与人合作赚钱,收入波动大,需要分出利益。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "印官": [
+        {
+            "解读": "得权得势,根基稳固。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "印杀": [
+        {
+            "解读": "掌生杀大权,处于决策位置。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "印财": [
+        {
+            "解读": "根基牢固,事业带来稳定财富。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "印才": [
+        {
+            "解读": "事业上收入不稳定,波动大。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "印食": [
+        {
+            "解读": "规划的东西多能实现。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "印伤": [
+        {
+            "解读": "行动多能落地,承诺多能兑现。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "印劫": [
+        {
+            "解读": "与人合作有底气,游刃有余。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "枭官": [
+        {
+            "解读": "得权得势,权力可能会有波动。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "枭杀": [
+        {
+            "解读": "容易得到帮助化解压力,但是这种助力并不稳定。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "枭财": [
+        {
+            "解读": "事业带来财富,但是事业多有波动。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "枭才": [
+        {
+            "解读": "事业和收入都不稳定,波动大。。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "枭食": [
+        {
+            "解读": "擅长探索研究新领域,也容易沉迷其中。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "枭伤": [
+        {
+            "解读": "学习能力强,尤其对新领域得探索研究。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "枭比": [
+        {
+            "解读": "时不时能得到助力,贵人缘不错。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "食官": [
+        {
+            "解读": "才华被认可,千里马遇伯乐。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "食杀": [
+        {
+            "解读": "有足够的能力去应对压力,争取机会。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "食印": [
+        {
+            "解读": "规划的东西多能实现。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "食枭": [
+        {
+            "解读": "对信息的感知、处理能力强。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "食才": [
+        {
+            "解读": "靠一技之长赚钱,收入不稳定。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "食比": [
+        {
+            "解读": "学习能力强,善于表达。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "食劫": [
+        {
+            "解读": "个人魅力高,在朋友中多是中心点。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "伤官": [
+        {
+            "解读": "为目标而努力,圈子有份量。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "伤杀": [
+        {
+            "解读": "常常要面临超过自己能力的挑战。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "伤印": [
+        {
+            "解读": "行动多能落地,承诺多能兑现。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "伤枭": [
+        {
+            "解读": "学习能力强,尤其对新领域得探索研究。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "伤财": [
+        {
+            "解读": "圈子、人脉带来财富机会。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "伤比": [
+        {
+            "解读": "行动力很强,有一定人脉圈子。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "伤劫": [
+        {
+            "解读": "喜欢走动,交际广,多与人合作。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "比官": [
+        {
+            "解读": "极具个人魅力和领导力,团队一条心。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "比杀": [
+        {
+            "解读": "事务繁多,压力大,健康容易受影响。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "比印": [
+        {
+            "解读": "根基稳固,多有贵人相帮,容易得到助力。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "比枭": [
+        {
+            "解读": "时不时能得到助力,贵人缘不错。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "比财": [
+        {
+            "解读": "财富收入稳定。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "比才": [
+        {
+            "解读": "财富波动大,不稳定。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "比食": [
+        {
+            "解读": "学习能力强,善于表达。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "劫官": [
+        {
+            "解读": "与人合作有保障,能化险为夷。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "劫杀": [
+        {
+            "解读": "机会多助力少,处处救火,累自身。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "劫印": [
+        {
+            "解读": "与人合作有底气,游刃有余。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "劫枭": [
+        {
+            "解读": "关系多与利益绑定,不稳固。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "劫财": [
+        {
+            "解读": "与人合作赚钱,多依赖他人资源,要分出利益。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "劫才": [
+        {
+            "解读": "多与人合作赚钱,收入波动大,需要分出利益。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "劫伤": [
+        {
+            "解读": "喜欢走动,交际广,多与人合作。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+}
+
+# 关联主要是事业、健康、情感
+config_gaoneng_anhe = {
+    "官比": [
+        {
+            "解读": "被台面下的力量护持,做事阻碍少。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "官食": [
+        {
+            "解读": "一些关系无法摆台面上,需要低调隐忍。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "杀劫": [
+        {
+            "解读": "处处救火,但是功劳不能归属自己。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "杀伤": [
+        {
+            "解读": "担负巨大的责任,可能背锅。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "财枭": [
+        {
+            "解读": "得贵人相帮,可能存在不能放台面上的收入来源。",
+            "关联": "事业",
+            "类别": "参考",
+        }
+    ],
+    "财比": [
+        {
+            "解读": "可能存在不能放台面上的收入来源。",
+            "关联": "事业",
+            "类别": "参考",
+        }
+    ],
+    "才印": [
+        {
+            "解读": "得贵人相帮,可能存在不能放台面上的收入来源。",
+            "关联": "事业",
+            "类别": "参考",
+        }
+    ],
+    "才劫": [
+        {
+            "解读": "在合作中可能存在利益输送。",
+            "关联": "事业",
+            "类别": "参考",
+        }
+    ],
+    "印食": [
+        {
+            "解读": "存在无法放到台面上的关系,暗中得到帮助。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "印才": [
+        {
+            "解读": "得贵人相帮,可能存在不能放台面上的收入来源。",
+            "关联": "事业",
+            "类别": "参考",
+        }
+    ],
+    "枭伤": [
+        {
+            "解读": "存在无法放到台面上的关系,暗中得到帮助。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "枭财": [
+        {
+            "解读": "得贵人相帮,可能存在不能放台面上的收入来源。",
+            "关联": "事业",
+            "类别": "参考",
+        }
+    ],
+    "食印": [
+        {
+            "解读": "存在无法放到台面上的关系,暗中得到帮助。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "食官": [
+        {
+            "解读": "一些关系无法摆台面上,需要低调隐忍。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "伤枭": [
+        {
+            "解读": "存在无法放到台面上的关系,暗中得到帮助。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "伤杀": [
+        {
+            "解读": "担负巨大的责任,可能背锅。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "比官": [
+        {
+            "解读": "被台面下的力量护持,做事阻碍少。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "比财": [
+        {
+            "解读": "可能存在不能放台面上的收入来源。",
+            "关联": "事业",
+            "类别": "参考",
+        }
+    ],
+    "劫才": [
+        {
+            "解读": "在合作中可能存在利益输送。",
+            "关联": "事业",
+            "类别": "参考",
+        }
+    ],
+    "劫杀": [
+        {
+            "解读": "处处救火,但是功劳不能归属自己。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+}
+
+config_gaoneng_chong = {
+    "官劫": [
+        {
+            "解读": "与人相处多注意边界,注意保护自己",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",能力不足时不要去挑战权威。",
+            "负": ",越界行事容易过后被清算。",
+            "平": "。",
+        }
+    ],
+    "官伤": [
+        {
+            "解读": "容易与人冲突、顶撞上司,也擅长攻坚",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",能力不足时不要去挑战权威。",
+            "负": ",越界行事容易过后被清算。",
+            "平": "。",
+        }
+    ],
+    "杀比": [
+        {
+            "解读": "多面临竞争、挑战,身体、精神压力大",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",接不住的事情要学会拒绝,或者找人帮忙减轻压力。",
+            "负": ",但是自身能力不弱,助力也有,能扛下来就是个机会。",
+            "平": "。",
+        }
+    ],
+    "杀食": [
+        {
+            "解读": "情绪容易被压力左右",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",诸多事务缠身,经常闷闷不乐。",
+            "负": ",好在自身能力不弱,最终都能巧妙化解。",
+            "平": "。",
+        }
+    ],
+    "财印": [
+        {
+            "解读": "事业上有诸多机会可以去争取",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",但是自身根基不足,一些机会无法拿下。",
+            "负": ",自身根基稳固,机会也多能拿下。",
+            "平": "。",
+        }
+    ],
+    "财劫": [
+        {
+            "解读": "多与人合作赚钱,分润",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",但是目标可能定的有点大,导致一些财富拿不下,还可能倒贴。",
+            "负": ",能因此获得财富,但也不全是自己的。",
+            "平": "。",
+        }
+    ],
+    "才枭": [
+        {
+            "解读": "得贵人帮助,多有一些意外得际遇",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",但是助力并不稳定,有些财富看得到得不到。",
+            "负": ",有意外收获,波动比较大。",
+            "平": "。",
+        }
+    ],
+    "才比": [
+        {
+            "解读": "经常能遇到意外的际遇",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",但是自身力量稍有不足,不一定拿得下。",
+            "负": ",并因此得到一些意外的收获。",
+            "平": "。",
+        }
+    ],
+    "印伤": [
+        {
+            "解读": "为事业奔波,拓展人脉圈子",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",但是行动成效有点低,进展缓慢。",
+            "负": ",多能拿下机会,就是自身会比较辛苦。",
+            "平": "。",
+        }
+    ],
+    "印财": [
+        {
+            "解读": "事业上有诸多机会可以去争取",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",自身根基稳固,机会也多能拿下。",
+            "负": ",但是自身根基不足,一些机会无法拿下。",
+            "平": "。",
+        }
+    ],
+    "枭食": [
+        {
+            "解读": "为事业费尽心思,规划全局",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",但是自身能力稍有不足,决策容易失误。",
+            "负": ",自身能力很强,规划的东西多能落地。",
+            "平": "。",
+        }
+    ],
+    "枭才": [
+        {
+            "解读": "得贵人帮助,多有一些意外得际遇",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",有意外收获,波动比较大。",
+            "负": ",但是助力并不稳定,有些财富看得到得不到。",
+            "平": "。",
+        }
+    ],
+    "食枭": [
+        {
+            "解读": "为事业费尽心思,规划全局",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",自身能力很强,规划的东西多能落地。",
+            "负": ",但是自身能力稍有不足,决策容易失误。",
+            "平": "。",
+        }
+    ],
+    "食杀": [
+        {
+            "解读": "情绪容易被压力左右",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",好在自身能力不弱,最终都能巧妙化解。",
+            "负": ",诸多事务缠身,经常闷闷不乐。",
+            "平": "。",
+        }
+    ],
+    "伤印": [
+        {
+            "解读": "为事业奔波,拓展人脉圈子",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",多能拿下机会,就是自身会比较辛苦。",
+            "负": ",但是行动成效有点低,进展缓慢。",
+            "平": "。",
+        }
+    ],
+    "伤官": [
+        {
+            "解读": "容易与人冲突、顶撞上司,也擅长攻坚",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",越界行事容易过后被清算。",
+            "负": ",能力不足时不要去挑战权威。",
+            "平": "。",
+        }
+    ],
+    "比杀": [
+        {
+            "解读": "多面临竞争、挑战,身体、精神压力大",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",但是自身能力不弱,助力也有,能扛下来就是个机会。",
+            "负": ",接不住的事情要学会拒绝,或者找人帮忙减轻压力。",
+            "平": "。",
+        }
+    ],
+    "比才": [
+        {
+            "解读": "经常能遇到意外的际遇",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",并因此得到一些意外的收获。",
+            "负": ",但是自身力量稍有不足,不一定拿得下。",
+            "平": "。",
+        }
+    ],
+    "劫官": [
+        {
+            "解读": "与人相处多注意边界,注意保护自己",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",越界行事容易过后被清算。",
+            "负": ",能力不足时不要去挑战权威。",
+            "平": "。",
+        }
+    ],
+    "劫财": [
+        {
+            "解读": "多与人合作赚钱,分润",
+            "关联": "事业",
+            "类别": "建议",
+            "胜": ",能因此获得财富,但也不全是自己的。",
+            "负": ",但是目标可能定的有点大,导致一些财富拿不下,还可能倒贴。",
+            "平": "。",
+        }
+    ],
+}
+
+config_gaoneng_xing = {
+    "寅巳刑": {
+        "刑出": ["丙", "戊"],
+        "刑冲": ["甲庚冲"]
+    },
+    "巳申刑": {
+        "刑出": ["庚", "戊"],
+        "刑冲": ["丙壬冲"]
+    },
+    "戌未刑": {
+        "刑出": ["丁"],
+        "刑冲": ["乙辛冲"]
+    },
+    "丑戌刑": {
+        "刑出": ["辛"],
+        "刑冲": ["丁癸冲"]
+    },
+}
+
+config_gaoneng_chuan = {
+    "官才": [
+        {
+            "解读": "冒险的行动容易破财,甚至影响自己的名誉地位。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "官印": [
+        {
+            "解读": "地位容易被挑战,权力容易被架空。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "官伤": [
+        {
+            "解读": "不当的行为容易让自己失去名誉地位,应注意行事的边界。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "官比": [
+        {
+            "解读": "容易钻牛角尖,挑战规则不服权威。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "杀财": [
+        {
+            "解读": "要谨慎甄别机会,有些机会拿不下反而破财。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "杀枭": [
+        {
+            "解读": "不能过于依赖外力,有些助力的获得是有代价的。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "杀食": [
+        {
+            "解读": "容易因错误的决策错失机会,白忙一场。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "杀劫": [
+        {
+            "解读": "面对机会,要谨慎评估合作伙伴及自身的能力,接不住可能人脉关系都收到损失。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "财官": [
+        {
+            "解读": "事业容易动荡,收入不稳定。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "财枭": [
+        {
+            "解读": "容易失去助力导致财富动荡。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "财食": [
+        {
+            "解读": "容易因欲望破财。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "财劫": [
+        {
+            "解读": "要谨慎与人合作,容易因财失义。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "才杀": [
+        {
+            "解读": "过于冒险激进容易破财。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "才印": [
+        {
+            "解读": "财富上过于激进冒险容易让自己人财两空,伤自己根基。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "才伤": [
+        {
+            "解读": "容易因冒险求快钱而破财。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "才比": [
+        {
+            "解读": "涉足风险投资领域容易破财。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "印杀": [
+        {
+            "解读": "要警惕有些机会不但拿不下,还会伤自己根基。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "印财": [
+        {
+            "解读": "权力容易被架空,事业动荡,财富受损。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "印食": [
+        {
+            "解读": "容易因错误的决策导致事业受损。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "印劫": [
+        {
+            "解读": "要谨慎甄别合作伙伴,错误的选择容易伤自己根基。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "枭官": [
+        {
+            "解读": "容易站错队而导致自己名望地位受损。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "枭才": [
+        {
+            "解读": "要警惕受人鼓动去冒险,会导致破财。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "枭伤": [
+        {
+            "解读": "要谨慎甄别别人承诺的帮助,太当真可能让自己白白投入时间精力。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "枭比": [
+        {
+            "解读": "要警惕有些看似帮助的力量,在危难时反而是落井下石的推手。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "食官": [
+        {
+            "解读": "容易跟领导不对付,容易怀才不遇。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "食杀": [
+        {
+            "解读": "容易因错误的决策导致错失机会,资源流失。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "食才": [
+        {
+            "解读": "容易因过于激进的想法导致破财。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "食劫": [
+        {
+            "解读": "容易和同伴意见不合,各有主张,甚至损害彼此的关系。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "伤杀": [
+        {
+            "解读": "容易挑战超过自己能力的事情,白忙一场。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "伤印": [
+        {
+            "解读": "容易因错误的行动导致事业受损,根基被伤。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "伤财": [
+        {
+            "解读": "容易因错误的行动导致财富受损。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "伤比": [
+        {
+            "解读": "忙碌但行动成效低,容易白忙活。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "比杀": [
+        {
+            "解读": "警惕压力过大影响自己健康。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "比印": [
+        {
+            "解读": "事业容易动荡,助力不稳,根基不牢。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "比财": [
+        {
+            "解读": "财富容易动荡。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "比食": [
+        {
+            "解读": "容易情绪化,受外界影响严重。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "劫官": [
+        {
+            "解读": "与人合作要注意合法合规。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "劫枭": [
+        {
+            "解读": "要谨慎选择合作伙伴,事情做不成还可能关系破裂。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "劫才": [
+        {
+            "解读": "过于冒险的合作要谨慎,容易人财两空。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "劫伤": [
+        {
+            "解读": "跟合作伙伴容易意见相左,事情做不成还导致关系破裂。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+}
+
+config_gaoneng_po = {
+    "官杀": [
+        {
+            "解读": "容易被非议,名声受损。",
+            "关联": "事业",
+            "类别": "参考",
+        }
+    ],
+    "官财": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "官印": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "官劫": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "杀官": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "参考",
+        }
+    ],
+    "杀才": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "杀枭": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "杀比": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "财官": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "财才": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "参考",
+        }
+    ],
+    "财印": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "财伤": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "才官": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "才财": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "参考",
+        }
+    ],
+    "才枭": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "才食": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "印官": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "印枭": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "参考",
+        }
+    ],
+    "印伤": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "印劫": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "枭杀": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "枭印": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "参考",
+        }
+    ],
+    "枭食": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "枭比": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "食杀": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "食才": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "食伤": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "参考",
+        }
+    ],
+    "食比": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "伤官": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "伤财": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "伤食": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "参考",
+        }
+    ],
+    "伤劫": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "比才": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "比枭": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "比食": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "比劫": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "参考",
+        }
+    ],
+    "劫财": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "劫印": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "劫伤": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "建议",
+        }
+    ],
+    "劫比": [
+        {
+            "解读": "。",
+            "关联": "事业",
+            "类别": "参考",
+        }
+    ],
+}
+
+config_zheng_he = {
+    "官": {
+        "财": "正财争合,财富机会多,但是可能需要取舍。",
+        "才": "偏财争合,财富机会多,但是可能需要取舍。",
+        "印": "正印争合,容易分心,两头下注,两边讨好。",
+        "食": "食神争合,才华横溢,路不只一条,但要注意不要自傲。",
+        "伤": "伤官争合,才华横溢,路不只一条,但要注意不要自傲。",
+        "比": "比肩争合,需要与人竞争才能获得。",
+        "劫": "劫财争合,合作机会多,需要做好取舍。",
+    },
+    "杀": {
+        "财": "正财争合,财富机会多,但是可能需要取舍。",
+        "才": "偏财争合,财富机会多,但是可能需要取舍。",
+        "枭": "偏印争合,容易分心,两头下注,两边讨好。",
+        "食": "食神争合,才华横溢,路不只一条,但要注意不要自傲。",
+        "伤": "伤官争合,才华横溢,路不只一条,但要注意不要自傲。",
+        "比": "比肩争合,需要与人竞争才能获得。",
+        "劫": "劫财争合,合作机会多,需要做好取舍。",
+    },
+    "财": {
+        "官": "正官争合,存在多个机会,需要做出取舍。",
+        "印": "正印争合,容易分心,两头下注,两边讨好。",
+        "枭": "偏印争合,容易分心,两头下注,两边讨好。",
+        "食": "食神争合,规划很多,注意不要互相干扰。",
+        "伤": "伤官争合,规划很多,注意不要互相干扰。",
+        "比": "比肩争合,需要与人竞争才能获得。",
+        "劫": "劫财争合,容易破财,交友要谨慎。",
+    },
+    "才": {
+        "杀": "七杀争合,存在多个机会,需要做出取舍。",
+        "印": "正印争合,容易分心,两头下注,两边讨好。",
+        "枭": "偏印争合,容易分心,两头下注,两边讨好。",
+        "食": "食神争合,规划很多,注意不要互相干扰。",
+        "伤": "伤官争合,规划很多,注意不要互相干扰。",
+        "比": "比肩争合,需要与人竞争才能获得。",
+        "劫": "劫财争合,容易破财,交友要谨慎。",
+    },
+    "印": {
+        "官": "正官争合,适合自己的机会很多,需要做取舍。",
+        "杀": "七杀争合,适合自己的机会很多,需要做取舍。",
+        "财": "正财争合,财富机会多,但是可能需要取舍。",
+        "才": "偏财争合,财富机会多,但是可能需要取舍。",
+        "食": "食神争合,规划很多,注意不要互相干扰。",
+        "伤": "伤官争合,规划很多,注意不要互相干扰。",
+        "劫": "劫财争合,合作机会多,需要做好取舍。",
+    },
+    "枭": {
+        "官": "正官争合,适合自己的机会很多,需要做取舍。",
+        "杀": "七杀争合,适合自己的机会很多,需要做取舍。",
+        "财": "正财争合,财富机会多,但是可能需要取舍。",
+        "才": "偏财争合,财富机会多,但是可能需要取舍。",
+        "食": "食神争合,规划很多,注意不要互相干扰。",
+        "伤": "伤官争合,规划很多,注意不要互相干扰。",
+        "比": "比肩争合,需要与人竞争才能获得。",
+    },
+    "食": {
+        "官": "正官争合,适合自己的机会很多,需要做取舍。",
+        "杀": "七杀争合,适合自己的机会很多,需要做取舍。",
+        "印": "正印争合,容易分心,两头下注,两边讨好。",
+        "枭": "偏印争合,容易分心,两头下注,两边讨好。",
+        "才": "偏财争合,财富机会多,但是可能需要取舍。",
+        "比": "比肩争合,需要选择适合的合作伙伴。",
+        "劫": "劫财争合,合作机会多,需要做好取舍。",
+    },
+    "伤": {
+        "官": "正官争合,适合自己的机会很多,需要做取舍。",
+        "杀": "七杀争合,适合自己的机会很多,需要做取舍。",
+        "印": "正印争合,容易分心,两头下注,两边讨好。",
+        "枭": "偏印争合,容易分心,两头下注,两边讨好。",
+        "财": "正财争合,财富机会多,但是可能需要取舍。",
+        "比": "比肩争合,需要选择适合的合作伙伴。",
+        "劫": "劫财争合,合作机会多,需要做好取舍。",
+    },
+    "比": {
+        "官": "正官争合,适合自己的机会很多,需要做取舍。",
+        "杀": "七杀争合,适合自己的机会很多,需要做取舍。",
+        "印": "正印争合,容易分心,两头下注,两边讨好。",
+        "枭": "偏印争合,容易分心,两头下注,两边讨好。",
+        "食": "食神争合,容易分心导致掌握的东西都不精通。",
+        "财": "正财争合,财富机会多,但是可能需要取舍。",
+        "才": "偏财争合,财富机会多,但是可能需要取舍。",
+    },
+    "劫": {
+        "官": "正官争合,限定太多可能反而误事,有时候需要适当降低要求。",
+        "杀": "七杀争合,过多的压力被传递过来,自身会疲于应对。",
+        "印": "正印争合,容易分心,两头下注,两边讨好。",
+        "枭": "偏印争合,容易分心,两头下注,两边讨好。",
+        "伤": "伤官争合,构想太多,容易浪费精力。",
+        "财": "正财争合,财富机会多,但是可能需要取舍。",
+        "才": "偏财争合,财富机会多,但是可能需要取舍。",
+    },
+}
+
+config_muku = {
+    "辰": {
+        "chong": "辰戌冲",
+        "lock": "酉辰合",
+        "zixing": "辰辰自刑",
+        "sanhui": "寅卯辰三会",
+        "gonghe": "申辰拱合",
+        "anhe": None,
+        "fangxiang": "癸",
+    },
+    "戌": {
+        "chong": "辰戌冲",
+        "lock": "卯戌合",
+        "zixing": None,
+        "sanhui": "申酉戌三会",
+        "gonghe": "寅戌拱合",
+        "anhe": None,
+        "fangxiang": "丁",
+    },
+    "丑": {
+        "chong": "丑未冲",
+        "lock": "子丑合",
+        "zixing": None,
+        "sanhui": "亥子丑三会",
+        "gonghe": "巳丑拱合",
+        "anhe": "寅丑暗合",
+        "fangxiang": "辛",
+    },
+    "未": {
+        "chong": "丑未冲",
+        "lock": "午未合",
+        "zixing": None,
+        "sanhui": "巳午未三会",
+        "gonghe": "亥未拱合",
+        "anhe": None,
+        "fangxiang": "乙",
+    },
+}
+config_zhu = {
+    1: 11,
+    2: 12,
+    3: 13,
+    4: 14,
+    5: 11,
+    6: 12,
+    7: 13,
+    8: 14,
+}
+congfig_wangshuai = {
+    "木": ["木", "火", "水", "金", "土"],
+    "火": ["火", "土", "木", "水", "金"],
+    "土": ["土", "金", "火", "木", "水"],
+    "金": ["金", "水", "土", "火", "木"],
+    "水": ["水", "木", "金", "土", "火"],
+}
+config_xingge = {
+    "木": {
+        "level": 0,
+        "low": "内向保守,悲观压抑,情绪不稳",
+        "middle": "温和慈悲,适应力强,积极自信,乐于接受新事物",
+        "strong": "强势固执自负,容易善恶不分",
+    },
+    "火": {
+        "level": 0,
+        "low": "消极悲观,缺乏热情,难以表达情感",
+        "middle": "热情开朗,充满激情,善于表达,行动力强",
+        "strong": "冲动自负,过度兴奋、易焦虑,易与人冲突",
+    },
+    "土": {
+        "level": 0,
+        "low": "缺乏安全感,容易依赖别人,情绪容易波动,容易焦虑不安",
+        "middle": "稳定可靠,富有包容心,诚实守信,执着有毅力,喜欢旧物",
+        "strong": "固执保守,思虑过重,有时候会导致想得太多而难以行动",
+    },
+    "金": {
+        "level": 0,
+        "low": "缺乏纪律组织性,敏感,多愁善感,依赖性强",
+        "middle": "重视规则纪律,决断力强,客观理性,独立性强,富有正义感、是非观、道德观,容易招惹是非",
+        "strong": "严肃刻板,容易自我抑制情感,疏远别人导致孤独,控制欲强",
+    },
+    "水": {
+        "level": 0,
+        "low": "刚硬,缺少变通,难以深入理解自己和他人,行动容易缺少谋略",
+        "middle": "灵活性、适应性强,富有智慧和直觉力,冷静,性格稳定,生理欲望强",
+        "strong": "缺乏坚定的方向感,容易随波逐流,情感上过于敏感丰富,容易陷入过分的内省和感性而导致难以把握现实,给人冷漠、不好靠近的感觉",
+    },
+    "印绶": {
+        "level": 0,
+        "low": "较少得到外界的帮助",
+        "middle": "贵人缘好,容易得到帮助;原则性强,重视口碑;为人谦虚低调,具有格局眼光;不爱操心,容易懒惰;",
+        "strong": "容易过度依赖他人的帮助导致自立能力可能不够强",
+    },
+    "正印": {
+        "level": 0,
+        "low": "学习知识容易遇到困难,需要更多的努力;精神和心灵层面的成长相对缓慢,需要更多时间去磨练自身",
+        "middle": "富有智慧,学习能力强,容易走自我创业路线",
+        "strong": "容易自信自满,忽视持续性的努力",
+    },
+    "偏印": {
+        "level": 0,
+        "low": "创新能力相对受限,思想和知识倾向主流和传统",
+        "middle": "擅长独立思考和创新,容易对非传统学识感兴趣,容易走个性化成长和发展路线,喜欢搞副业",
+        "strong": "难以融入传统环境,容易过度追求非主流,容易和常规知识体系脱节,有时候思想过于前卫而导致不被理解",
+    },
+    "官杀": {
+        "level": 0,
+        "low": "难以聚焦理想",
+        "middle": "有理想有追求,悟性高,具备辩证思维,重视口碑,会强迫自己去奋斗,容易操劳,容易为欲望破财",
+        "strong": "身弱容易想入非非,性格怯弱;容易追求过多而导致分心",
+    },
+    "正官": {
+        "level": 0,
+        "low": "容易受到挑战,不易被认可",
+        "middle": "重视规则和权威,事业运强,喜欢稳定",
+        "strong": "过于严格刻板,自身容易因为过度的责任感和管理压力感到疲惫,男命控制欲过强",
+    },
+    "七杀": {
+        "level": 0,
+        "low": "缺乏变革的动力,容易犹豫不决,容易因为不够积极主动错失机会",
+        "middle": "具备自我变革和突破精神,有勇气有毅力有冒险精神,生活中多与他人竞争",
+        "strong": "生活中存在过多变化和不确定性,缺乏安全感。容易因为过于冒险导致轻率的决策行为,容易与人冲突",
+    },
+    "财星": {
+        "level": 0,
+        "low": "低欲望、淡泊名利",
+        "middle": "物质、现实主义,对财富的掌控欲强",
+        "strong": "过度追求物质,容易忽略精神层面的发展与满足;容易忽略个人成长、家庭和人际关系中的非物质价值;容易过度消费,缺乏对财富的合理管理",
+    },
+    "正财": {
+        "level": 0,
+        "low": "容易在财富积累上遇到障碍,长期稳定的收入来源易受到冲击",
+        "middle": "以工作和事业提供的稳定财富收入为主,物质上追求安全和满足感,财富管理上以安全稳定为首要目标",
+        "strong": "过度追求财富稳定性容易失去一些机会",
+    },
+    "偏财": {
+        "level": 0,
+        "low": "财富观念比较保守,财富的积累相对慢,更多依赖稳定的积累",
+        "middle": "财富获取的方式比较灵活和创新,喜好风险投资和快速获得收益",
+        "strong": "财富波动较大,容易忽略长期规划;容易过度追求快速致富,容易涉足高风险投资",
+    },
+    "食伤": {
+        "level": 0,
+        "low": "难以表达想法和感受,性格随和不喜争斗,容易怀才不遇,做事容易拖拉",
+        "middle": "执行力强,好胜心强,喜欢操作,亲力亲为,有才华,好表现自己",
+        "strong": "容易过度表现而得罪他人",
+    },
+    "食神": {
+        "level": 0,
+        "low": "不太注重生活品质,喜欢走动、行动,多对抗",
+        "middle": "喜欢享受生活,追求岁月静好,善于做规划,自我精神世界富足",
+        "strong": "过度依赖言辞表达,可能给人夸张不真诚的感觉",
+    },
+    "伤官": {
+        "level": 0,
+        "low": "思想倾向保守,遵循传统,对新事物持保留态度,喜欢慢生活",
+        "middle": "喜欢社交,多与人互动,具备创新思维,见解独到,喜欢刺激性的充满挑战的事物,自身会比较辛苦",
+        "strong": "过度的创新容易挑战规则,从而导致冲突。情绪容易波动,情感表达过于直接,易冲动鲁莽",
+    },
+    "比劫": {
+        "level": 0,
+        "low": "难以与他人协作",
+        "middle": "好客、仗义、朋友多,具有领导力",
+        "strong": "容易拉帮结派,仗势欺人;容易过度竞争从而影响和他人的关系",
+    },
+    "比肩": {
+        "level": 0,
+        "low": "缺少竞争的动力和欲望,倾向依赖他人或环境提供的机会",
+        "middle": "个人独立性强,协同能力强",
+        "strong": "容易以自我为中心,忽略团队价值;容易给自己过多压力,不利于身心健康;",
+    },
+    "劫财": {
+        "level": 0,
+        "low": "人际关系中较少遇到竞争和挑战,独立性强,较少依赖他人,但也容易因此错失合作带来的机会",
+        "middle": "和朋友伙伴间多存在利益关系,善于利用他人的资源,有较强的对个人资源、财富的管理能力和控制力",
+        "strong": "容易因资源、利益的分配导致和朋友关系紧张;容易面临财富和资源被他人争夺或流失的风险",
+    },
+}
+config_lushen_tip = {
+    "年禄": "祖上积蓄多,出生环境好,被冲被害容易家道中落,背井离乡",
+    "建禄": "家资丰厚,但容易与父亲关系不好,被冲被害容易与兄弟姐妹关系不好,朋友少,易破财",
+    "专禄": "身体健康,人容易自私,克妻。被冲被害容易有慢性病,容易被利益主导想法和行动",
+    "归禄": "子女孝顺,晚年幸福,被冲被害则意思相反。",
+    "半禄": "自身留太多财容易过盈反损,可以多做慈善,福泽子孙",
+}
+config_genqi = {
+    "木": {
+        "真": ["木", "水"],
+        "假": ["金", "土"],
+    },
+    "火": {
+        "真": ["火", "木"],
+        "假": ["水", "金"],
+    },
+    "土": {
+        "真": ["土", "火"],
+        "假": ["水", "木"],
+    },
+    "金": {
+        "真": ["金", "土"],
+        "假": ["木", "火"],
+    },
+    "水": {
+        "真": ["水", "金"],
+        "假": ["火", "土"],
+    },
+}
+config_zhenjia = {
+    "官": {
+        "真": "有名有权",
+        "假": "有名无权,容易被架空",
+    },
+    "杀": {
+        "真": "有名有权",
+        "假": "有名无权,容易被架空",
+    },
+    "比": {
+        "真": "朋友相帮",
+        "假": "看着朋友很多,多是点头之交",
+    },
+    "劫": {
+        "真": "朋友相帮",
+        "假": "看着朋友很多,多是点头之交",
+    },
+    "食": {
+        "真": "切实的落于行动",
+        "假": "说的多,做的少",
+    },
+    "伤": {
+        "真": "切实的落于行动",
+        "假": "说的多,做的少",
+    },
+    "财": {
+        "真": "看得到,拿的到",
+        "假": "看得到,得不到",
+    },
+    "才": {
+        "真": "看得到,拿的到",
+        "假": "看得到,得不到",
+    },
+    "印": {
+        "真": "得到贵人相助",
+        "假": "得到的承诺多,兑现的少",
+    },
+    "枭": {
+        "真": "得到贵人相助",
+        "假": "得到的承诺多,兑现的少",
+    },
+}
+config_lushen = {
+    "甲": {
+        "禄神": "寅",
+        "半禄": ["卯"],
+    },
+    "乙": {
+        "禄神": "卯",
+        "半禄": ["寅", "辰"],
+    },
+    "丙": {
+        "禄神": "巳",
+        "半禄": ["午"],
+    },
+    "丁": {
+        "禄神": "午",
+        "半禄": ["巳", "未"],
+    },
+    "戊": {
+        "禄神": "巳",
+        "半禄": ["午"],
+    },
+    "己": {
+        "禄神": "午",
+        "半禄": ["巳", "未"],
+    },
+    "庚": {
+        "禄神": "申",
+        "半禄": ["酉"],
+    },
+    "辛": {
+        "禄神": "酉",
+        "半禄": ["申", "戌"],
+    },
+    "壬": {
+        "禄神": "亥",
+        "半禄": ["子"],
+    },
+    "癸": {
+        "禄神": "子",
+        "半禄": ["亥", "丑"],
+    },
+}
+config_wenchang = {
+    "甲": "寅",
+    "乙": "卯",
+    "丙": "申",
+    "丁": "酉",
+    "戊": "巳",
+    "己": "午",
+    "庚": "申",
+    "辛": "酉",
+    "壬": "亥",
+    "癸": "子",
+}
+config_kuigang = [
+    "庚戌", "庚辰", "戊戌", "壬辰"
+]
+config_yima = {
+    "子": "寅",
+    "丑": "亥",
+    "寅": "申",
+    "卯": "巳",
+    "辰": "寅",
+    "巳": "亥",
+    "午": "申",
+    "未": "巳",
+    "申": "寅",
+    "酉": "亥",
+    "戌": "申",
+    "亥": "巳",
+}
+config_yangren = {
+    "甲": "卯",
+    "乙": "寅",
+    "丙": "午",
+    "丁": "巳",
+    "戊": "午",
+    "己": "巳",
+    "庚": "酉",
+    "辛": "申",
+    "壬": "子",
+    "癸": "亥",
+}
+
+config_xiongji = {
+    "劫财见财": {
+        "eft": "容易失去财富、被人借钱、被人骗、被人利用、帮人做担保、劳动成果被窃取、被人欠款,保不住财,容易给人打工,财富格局受限",
+        "solve": "谨慎投资,谨慎与人合伙,可以通过购买固定资产等方式主动花钱消灾。落大运上可以买房买保险等方式形成月固定支出化解。",
+    },
+    "劫财合七杀": {
+        "eft": "比较凶的相,容易破财且身败名裂。",
+        "solve": "引食神化杀",
+    },
+    "伤官见官": {
+        "eft": "容易顶撞、口角、说话冒犯别人,如果进一步升级就容易造成是非、官非,从而导致牢狱之灾。当官杀强盛或是伤官受伤时容易被清算。对女命是离婚或分居的信号,易导致离婚。",
+        "solve": "身旺可治官得官,治杀得杀。未触发前,可动居住环境、工作环境、装修房屋等方式把过剩的伤官泄出。如果已触发,破财消灾。女命怀孕生儿子也可解。",
+    },
+    "枭神夺食": {
+        "eft": "身旺得帮扶,身弱有灾。易出现自闭、心理疾病。婴儿遇此相易早夭,青少年时期易自残或社恐,青年时期易流产,中年时期易身体有恙或官非不断,晚年易殒命。枭和食神的力量越接近越凶险,犯此相与女儿关系不佳。如果关系是合,就变成食神配印,贵不可言。",
+        "solve": "补禄神,增加比肩,增加正印",
+    },
+    "七杀攻身": {
+        "eft": "耗费自身的精力金钱,造成阻碍,也表示犯小人,影响自身健康,子女易叛逆,男命易被子女克,女命易遇渣男。",
+        "solve": "正印化七杀,食神有力可制七杀,伤官强可迎合七杀,不被针对",
+    },
+    "财损印": {
+        "eft": "工作、业务、固定资产容易受到损失。常见于收了不该收的小钱被停职,或是小钱博大运博输了,在官场常见打点关系,礼太少又想办大事。也表示父母离婚、夫妻离婚,容易竹篮打水一场空。如果财大印小则是好事,用大预算做小事情,成功率自然高。",
+        "solve": "补财,增加预算。或是官星来帮,通过自我让利止损。",
+    },
+    "伤官合七杀": {
+        "eft": "在伤官力量小于七杀时触发。容易做出对自己不利的行动而导致自身受损,或是主动去做自己不擅长的事情,导致在自我挑战中容易搬起石头砸自己的脚。如果伤官力量大于七杀,反而能制杀得名望地位。",
+        "solve": "增强伤官力量,或者用正印制七杀",
+    },
+    "杀枭相杀": {
+        "eft": "七杀攻身叠加枭神夺食,对自己身体、心理健康产生极大的负面影响,严重会危及生命,是很凶的相。",
+        "solve": "分别化解七杀攻身和枭神夺食",
+    },
+    "独刃逢冲": {
+        "eft": "极度影响健康,容易犯大事,冲在坐支容易犯生死关,辰戌丑未的冲不在此列。月上犯冲应在兄弟姐妹,年上犯冲多是家道中落,时上犯冲子女多忤逆。",
+        "solve": "地支六合可化解,重点是保护禄神和羊刃",
+    },
+    "印禄相随": {
+        "eft": "东山再起,事业逢贵人,增加固定资产,得贵人、父母、朋友相助,能担官担财,利于健康、事业",
+        "solve": "能化七杀,化解枭神夺食",
+    },
+    "食神制杀": {
+        "eft": "保护自身不受小人侵害,生财",
+        "solve": "能否制的住看双方力量对比",
+    },
+    "食伤合印": {
+        "eft": "想做的事情能做成,合食神以想为主,合伤官以做为主,更劳累些,合正印为佳,通常带来事业上升、固定资产增加,八字原局带此相也会带来有利影响。",
+        "solve": "食神合正印,贵不可言",
+    },
+    "财合印": {
+        "eft": "容易花钱办成事,合正印旺事业,合偏印旺副业。对投资、创业有利。花小钱办大事,或是花大钱办小事,总之事能成",
+        "solve": "这里和正财偏财无关,总之是花钱",
+    },
+    "官制劫财": {
+        "eft": "护财,使得劫财无法生效。能否护住取决于双方力量高低,即使不能完全护住,也能减少自身损失。",
+        "solve": "跟劫财相关的负面的相也会被缓解",
+    },
+    "官印相生": {
+        "eft": "获得权力、官职、贵不可言,主要指文官类的权力",
+        "solve": "这个相不看八字旺衰,合正印更佳",
+    },
+    "杀印相生": {
+        "eft": "获得权力、官职、地位,贵不可言,为官容易掌军权,在职业上多从事公检法武警消防领域,社会职业多为医生、理科老师",
+        "solve": "这个相不看八字旺衰,合正印更佳",
+    },
+    "自合财官": {
+        "eft": "合财得财,合官升职,好处是见效快,但是比较累自身,所得的规模也会相对弱一些",
+        "solve": "指的日元合财官,阳干合财,阴干合官",
+    },
+}
+
+config_jie_qi_list = ["小寒", "立春", "惊蛰", "清明", "立夏", "芒种", "小暑", "立秋", "白露", "寒露", "立冬", "大雪"]
+
+config_jie_qi = {
+    1901: {'除夕': '2.18', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '戊子',
+           '一日': '己卯'},
+    1902: {'除夕': '2.7', '立春': '2.5', '惊蛰': '3.6', '清明': '4.6', '立夏': '5.6', '芒种': '6.7', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '庚子',
+           '一日': '甲申'},
+    1903: {'除夕': '1.28', '立春': '2.5', '惊蛰': '3.7', '清明': '4.6', '立夏': '5.7', '芒种': '6.7', '小暑': '7.8',
+           '立秋': '8.9', '白露': '9.9', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.7', '一月': '壬子',
+           '一日': '己丑'},
+    1904: {'除夕': '2.15', '立春': '2.5', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '甲子',
+           '一日': '甲午'},
+    1905: {'除夕': '2.3', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '丙子',
+           '一日': '庚子'},
+    1906: {'除夕': '1.24', '立春': '2.5', '惊蛰': '3.6', '清明': '4.6', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '戊子',
+           '一日': '乙巳'},
+    1907: {'除夕': '2.12', '立春': '2.5', '惊蛰': '3.7', '清明': '4.6', '立夏': '5.7', '芒种': '6.7', '小暑': '7.8',
+           '立秋': '8.9', '白露': '9.9', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.7', '一月': '庚子',
+           '一日': '庚戌'},
+    1908: {'除夕': '2.1', '立春': '2.5', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '壬子',
+           '一日': '乙卯'},
+    1909: {'除夕': '1.21', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '甲子',
+           '一日': '辛酉'},
+    1910: {'除夕': '2.9', '立春': '2.5', '惊蛰': '3.6', '清明': '4.6', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '丙子',
+           '一日': '丙寅'},
+    1911: {'除夕': '1.29', '立春': '2.5', '惊蛰': '3.7', '清明': '4.6', '立夏': '5.7', '芒种': '6.7', '小暑': '7.8',
+           '立秋': '8.9', '白露': '9.9', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.7', '一月': '戊子',
+           '一日': '辛未'},
+    1912: {'除夕': '2.17', '立春': '2.5', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '庚子',
+           '一日': '丙子'},
+    1913: {'除夕': '2.5', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '壬子',
+           '一日': '壬午'},
+    1914: {'除夕': '1.25', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '甲子',
+           '一日': '丁亥'},
+    1915: {'除夕': '2.13', '立春': '2.5', '惊蛰': '3.6', '清明': '4.6', '立夏': '5.6', '芒种': '6.7', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.9', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '丙子',
+           '一日': '壬辰'},
+    1916: {'除夕': '2.2', '立春': '2.5', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '戊子',
+           '一日': '丁酉'},
+    1917: {'除夕': '1.22', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '庚子',
+           '一日': '癸卯'},
+    1918: {'除夕': '2.10', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '壬子',
+           '一日': '戊申'},
+    1919: {'除夕': '1.31', '立春': '2.5', '惊蛰': '3.6', '清明': '4.6', '立夏': '5.6', '芒种': '6.7', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.9', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '甲子',
+           '一日': '癸丑'},
+    1920: {'除夕': '2.19', '立春': '2.5', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '丙子',
+           '一日': '戊午'},
+    1921: {'除夕': '2.7', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '戊子',
+           '一日': '甲子'},
+    1922: {'除夕': '1.27', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '庚子',
+           '一日': '己巳'},
+    1923: {'除夕': '2.15', '立春': '2.5', '惊蛰': '3.6', '清明': '4.6', '立夏': '5.6', '芒种': '6.7', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.9', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '壬子',
+           '一日': '甲戌'},
+    1924: {'除夕': '2.4', '立春': '2.5', '惊蛰': '3.6', '清明': '4.6', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '甲子',
+           '一日': '己卯'},
+    1925: {'除夕': '1.23', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '丙子',
+           '一日': '乙酉'},
+    1926: {'除夕': '2.12', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '戊子',
+           '一日': '庚寅'},
+    1927: {'除夕': '2.1', '立春': '2.5', '惊蛰': '3.6', '清明': '4.6', '立夏': '5.6', '芒种': '6.7', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '庚子',
+           '一日': '乙未'},
+    1928: {'除夕': '1.22', '立春': '2.5', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '壬子',
+           '一日': '庚子'},
+    1929: {'除夕': '2.9', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '甲子',
+           '一日': '丙午'},
+    1930: {'除夕': '1.29', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '丙子',
+           '一日': '辛亥'},
+    1931: {'除夕': '2.16', '立春': '2.5', '惊蛰': '3.6', '清明': '4.6', '立夏': '5.6', '芒种': '6.7', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '戊子',
+           '一日': '丙辰'},
+    1932: {'除夕': '2.5', '立春': '2.5', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '庚子',
+           '一日': '辛酉'},
+    1933: {'除夕': '1.25', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '壬子',
+           '一日': '丁卯'},
+    1934: {'除夕': '2.13', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '甲子',
+           '一日': '壬申'},
+    1935: {'除夕': '2.3', '立春': '2.5', '惊蛰': '3.6', '清明': '4.6', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '丙子',
+           '一日': '丁丑'},
+    1936: {'除夕': '1.23', '立春': '2.5', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '戊子',
+           '一日': '壬午'},
+    1937: {'除夕': '2.10', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '庚子',
+           '一日': '戊子'},
+    1938: {'除夕': '1.30', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '壬子',
+           '一日': '癸巳'},
+    1939: {'除夕': '2.18', '立春': '2.5', '惊蛰': '3.6', '清明': '4.6', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '甲子',
+           '一日': '戊戌'},
+    1940: {'除夕': '2.7', '立春': '2.5', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '丙子',
+           '一日': '癸卯'},
+    1941: {'除夕': '1.26', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '戊子',
+           '一日': '己酉'},
+    1942: {'除夕': '2.14', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '庚子',
+           '一日': '甲寅'},
+    1943: {'除夕': '2.4', '立春': '2.5', '惊蛰': '3.6', '清明': '4.6', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '壬子',
+           '一日': '己未'},
+    1944: {'除夕': '1.24', '立春': '2.5', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '甲子',
+           '一日': '甲子'},
+    1945: {'除夕': '2.12', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '丙子',
+           '一日': '庚午'},
+    1946: {'除夕': '2.1', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '戊子',
+           '一日': '乙亥'},
+    1947: {'除夕': '1.21', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '庚子',
+           '一日': '庚辰'},
+    1948: {'除夕': '2.9', '立春': '2.5', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '壬子',
+           '一日': '乙酉'},
+    1949: {'除夕': '1.28', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '甲子',
+           '一日': '辛卯'},
+    1950: {'除夕': '2.16', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '丙子',
+           '一日': '丙申'},
+    1951: {'除夕': '2.5', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '戊子',
+           '一日': '辛丑'},
+    1952: {'除夕': '1.26', '立春': '2.5', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '庚子',
+           '一日': '丙午'},
+    1953: {'除夕': '2.13', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '壬子',
+           '一日': '壬子'},
+    1954: {'除夕': '2.2', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '甲子',
+           '一日': '丁巳'},
+    1955: {'除夕': '1.23', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '丙子',
+           '一日': '壬戌'},
+    1956: {'除夕': '2.11', '立春': '2.5', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '戊子',
+           '一日': '丁卯'},
+    1957: {'除夕': '1.30', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '庚子',
+           '一日': '癸酉'},
+    1958: {'除夕': '2.17', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '壬子',
+           '一日': '戊寅'},
+    1959: {'除夕': '2.7', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '甲子',
+           '一日': '癸未'},
+    1960: {'除夕': '1.27', '立春': '2.5', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '丙子',
+           '一日': '戊子'},
+    1961: {'除夕': '2.14', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '戊子',
+           '一日': '甲午'},
+    1962: {'除夕': '2.4', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '庚子',
+           '一日': '己亥'},
+    1963: {'除夕': '1.24', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '壬子',
+           '一日': '甲辰'},
+    1964: {'除夕': '2.12', '立春': '2.5', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '甲子',
+           '一日': '己酉'},
+    1965: {'除夕': '2.1', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '丙子',
+           '一日': '乙卯'},
+    1966: {'除夕': '1.20', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '戊子',
+           '一日': '庚申'},
+    1967: {'除夕': '2.8', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '庚子',
+           '一日': '乙丑'},
+    1968: {'除夕': '1.29', '立春': '2.5', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '壬子',
+           '一日': '庚午'},
+    1969: {'除夕': '2.16', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '甲子',
+           '一日': '丙子'},
+    1970: {'除夕': '2.5', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '丙子',
+           '一日': '辛巳'},
+    1971: {'除夕': '1.26', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '戊子',
+           '一日': '丙戌'},
+    1972: {'除夕': '2.14', '立春': '2.5', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '庚子',
+           '一日': '辛卯'},
+    1973: {'除夕': '2.2', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '壬子',
+           '一日': '丁酉'},
+    1974: {'除夕': '1.22', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '甲子',
+           '一日': '壬寅'},
+    1975: {'除夕': '2.10', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.85', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '丙子',
+           '一日': '丁未'},
+    1976: {'除夕': '1.30', '立春': '2.5', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '戊子',
+           '一日': '壬子'},
+    1977: {'除夕': '2.17', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '庚子',
+           '一日': '戊午'},
+    1978: {'除夕': '2.6', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '壬子',
+           '一日': '癸亥'},
+    1979: {'除夕': '1.27', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '甲子',
+           '一日': '戊辰'},
+    1980: {'除夕': '2.15', '立春': '2.5', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '丙子',
+           '一日': '癸酉'},
+    1981: {'除夕': '2.4', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '戊子',
+           '一日': '己卯'},
+    1982: {'除夕': '1.24', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '庚子',
+           '一日': '甲申'},
+    1983: {'除夕': '2.12', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.8',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.8', '小寒': '1.6', '一月': '壬子',
+           '一日': '己丑'},
+    1984: {'除夕': '2.1', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '甲子',
+           '一日': '甲午'},
+    1985: {'除夕': '2.19', '立春': '2.4', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '丙子',
+           '一日': '庚子'},
+    1986: {'除夕': '2.8', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '戊子',
+           '一日': '乙巳'},
+    1987: {'除夕': '1.28', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '庚子',
+           '一日': '庚戌'},
+    1988: {'除夕': '2.16', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '壬子',
+           '一日': '乙卯'},
+    1989: {'除夕': '2.5', '立春': '2.4', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '甲子',
+           '一日': '辛酉'},
+    1990: {'除夕': '1.26', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '丙子',
+           '一日': '丙寅'},
+    1991: {'除夕': '2.14', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '戊子',
+           '一日': '辛未'},
+    1992: {'除夕': '2.3', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '庚子',
+           '一日': '丙子'},
+    1993: {'除夕': '1.22', '立春': '2.4', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '壬子',
+           '一日': '壬午'},
+    1994: {'除夕': '2.9', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '甲子',
+           '一日': '丁亥'},
+    1995: {'除夕': '1.30', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '丙子',
+           '一日': '壬辰'},
+    1996: {'除夕': '2.18', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '戊子',
+           '一日': '丁酉'},
+    1997: {'除夕': '2.6', '立春': '2.4', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '庚子',
+           '一日': '癸卯'},
+    1998: {'除夕': '1.27', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '壬子',
+           '一日': '戊申'},
+    1999: {'除夕': '2.15', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '甲子',
+           '一日': '癸丑'},
+    2000: {'除夕': '2.4', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '丙子',
+           '一日': '戊午'},
+    2001: {'除夕': '1.23', '立春': '2.4', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '戊子',
+           '一日': '甲子'},
+    2002: {'除夕': '2.11', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '庚子',
+           '一日': '己巳'},
+    2003: {'除夕': '1.31', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '壬子',
+           '一日': '甲戌'},
+    2004: {'除夕': '1.21', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '甲子',
+           '一日': '己卯'},
+    2005: {'除夕': '2.8', '立春': '2.4', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '丙子',
+           '一日': '乙酉'},
+    2006: {'除夕': '1.28', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '戊子',
+           '一日': '庚寅'},
+    2007: {'除夕': '2.17', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.9', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '庚子',
+           '一日': '乙未'},
+    2008: {'除夕': '2.6', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '壬子',
+           '一日': '庚子'},
+    2009: {'除夕': '1.25', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '甲子',
+           '一日': '丙午'},
+    2010: {'除夕': '2.13', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '丙子',
+           '一日': '辛亥'},
+    2011: {'除夕': '2.2', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '戊子',
+           '一日': '丙辰'},
+    2012: {'除夕': '1.22', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '庚子',
+           '一日': '辛酉'},
+    2013: {'除夕': '2.9', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '壬子',
+           '一日': '丁卯'},
+    2014: {'除夕': '1.30', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '甲子',
+           '一日': '壬申'},
+    2015: {'除夕': '2.18', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '丙子',
+           '一日': '丁丑'},
+    2016: {'除夕': '2.7', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '戊子',
+           '一日': '壬午'},
+    2017: {'除夕': '1.27', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '庚子',
+           '一日': '戊子'},
+    2018: {'除夕': '2.15', '立春': '2.4', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '壬子',
+           '一日': '癸巳'},
+    2019: {'除夕': '2.4', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '甲子',
+           '一日': '戊戌'},
+    2020: {'除夕': '1.24', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '丙子',
+           '一日': '癸卯'},
+    2021: {'除夕': '2.11', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '戊子',
+           '一日': '己酉'},
+    2022: {'除夕': '1.31', '立春': '2.4', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '庚子',
+           '一日': '甲寅'},
+    2023: {'除夕': '1.21', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.8', '大雪': '12.7', '小寒': '1.6', '一月': '壬子',
+           '一日': '己未'},
+    2024: {'除夕': '2.9', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '甲子',
+           '一日': '甲子'},
+    2025: {'除夕': '1.28', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '丙子',
+           '一日': '庚午'},
+    2026: {'除夕': '2.16', '立春': '2.4', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '戊子',
+           '一日': '乙亥'},
+    2027: {'除夕': '2.5', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '庚子',
+           '一日': '庚辰'},
+    2028: {'除夕': '1.25', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '壬子',
+           '一日': '乙酉'},
+    2029: {'除夕': '2.12', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '甲子',
+           '一日': '辛卯'},
+    2030: {'除夕': '2.2', '立春': '2.4', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '丙子',
+           '一日': '丙申'},
+    2031: {'除夕': '1.22', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.6', '芒种': '6.36', '小暑': '7.7',
+           '立秋': '8.8', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '戊子',
+           '一日': '辛丑'},
+    2032: {'除夕': '2.10', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '庚子',
+           '一日': '丙午'},
+    2033: {'除夕': '1.30', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '壬子',
+           '一日': '壬子'},
+    2034: {'除夕': '2.18', '立春': '2.4', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '甲子',
+           '一日': '丁巳'},
+    2035: {'除夕': '2.7', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '丙子',
+           '一日': '壬戌'},
+    2036: {'除夕': '1.27', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '戊子',
+           '一日': '丁卯'},
+    2037: {'除夕': '2.14', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '庚子',
+           '一日': '癸酉'},
+    2038: {'除夕': '2.3', '立春': '2.4', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '壬子',
+           '一日': '戊寅'},
+    2039: {'除夕': '1.23', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '甲子',
+           '一日': '癸未'},
+    2040: {'除夕': '2.11', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '丙子',
+           '一日': '戊子'},
+    2041: {'除夕': '1.31', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '戊子',
+           '一日': '甲午'},
+    2042: {'除夕': '1.21', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '庚子',
+           '一日': '己亥'},
+    2043: {'除夕': '2.9', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '壬子',
+           '一日': '甲辰'},
+    2044: {'除夕': '1.29', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.7', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '甲子',
+           '一日': '己酉'},
+    2045: {'除夕': '2.16', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '丙子',
+           '一日': '乙卯'},
+    2046: {'除夕': '2.5', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '戊子',
+           '一日': '庚申'},
+    2047: {'除夕': '1.25', '立春': '2.4', '惊蛰': '3.6', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.8', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.6', '一月': '庚子',
+           '一日': '乙丑'},
+    2048: {'除夕': '2.13', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.7', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '壬子',
+           '一日': '庚午'},
+    2049: {'除夕': '2.1', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '甲子',
+           '一日': '丙子'},
+    2050: {'除夕': '1.22', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '丙子',
+           '一日': '辛巳'},
+    2051: {'除夕': '2.10', '立春': '2.4', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.6', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '戊子',
+           '一日': '丙戌'},
+    2052: {'除夕': '1.31', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.7', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '庚子',
+           '一日': '辛卯'},
+    2053: {'除夕': '2.18', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '壬子',
+           '一日': '丁酉'},
+    2054: {'除夕': '2.7', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '甲子',
+           '一日': '壬寅'},
+    2055: {'除夕': '1.27', '立春': '2.4', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '丙子',
+           '一日': '丁未'},
+    2056: {'除夕': '2.14', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.7', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '戊子',
+           '一日': '壬子'},
+    2057: {'除夕': '2.3', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '庚子',
+           '一日': '戊午'},
+    2058: {'除夕': '1.23', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '壬子',
+           '一日': '癸亥'},
+    2059: {'除夕': '2.11', '立春': '2.4', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '甲子',
+           '一日': '戊辰'},
+    2060: {'除夕': '2.1', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.7', '立冬': '11.6', '大雪': '12.6', '小寒': '1.5', '一月': '丙子',
+           '一日': '癸酉'},
+    2061: {'除夕': '1.20', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '戊子',
+           '一日': '己卯'},
+    2062: {'除夕': '2.8', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '庚子',
+           '一日': '甲申'},
+    2063: {'除夕': '1.28', '立春': '2.4', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '壬子',
+           '一日': '己丑'},
+    2064: {'除夕': '2.16', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.7', '立冬': '11.6', '大雪': '12.6', '小寒': '1.5', '一月': '甲子',
+           '一日': '甲午'},
+    2065: {'除夕': '2.4', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '丙子',
+           '一日': '庚子'},
+    2066: {'除夕': '1.25', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '戊子',
+           '一日': '乙巳'},
+    2067: {'除夕': '2.13', '立春': '2.4', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '庚子',
+           '一日': '庚戌'},
+    2068: {'除夕': '2.2', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.4', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.6', '白露': '9.7', '寒露': '10.7', '立冬': '11.6', '大雪': '12.6', '小寒': '1.5', '一月': '壬子',
+           '一日': '乙卯'},
+    2069: {'除夕': '1.22', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '甲子',
+           '一日': '辛酉'},
+    2070: {'除夕': '2.10', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '丙子',
+           '一日': '丙寅'},
+    2071: {'除夕': '1.30', '立春': '2.4', '惊蛰': '3.5', '清明': '4.5', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '戊子',
+           '一日': '辛未'},
+    2072: {'除夕': '2.18', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.4', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.6', '白露': '9.7', '寒露': '10.7', '立冬': '11.6', '大雪': '12.6', '小寒': '1.5', '一月': '庚子',
+           '一日': '丙子'},
+    2073: {'除夕': '2.6', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.7', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '壬子',
+           '一日': '壬午'},
+    2074: {'除夕': '1.26', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '甲子',
+           '一日': '丁亥'},
+    2075: {'除夕': '2.14', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '丙子',
+           '一日': '壬辰'},
+    2076: {'除夕': '2.4', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.4', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.6', '白露': '9.7', '寒露': '10.7', '立冬': '11.6', '大雪': '12.6', '小寒': '1.5', '一月': '戊子',
+           '一日': '丁酉'},
+    2077: {'除夕': '1.23', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.7', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '庚子',
+           '一日': '癸卯'},
+    2078: {'除夕': '2.11', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '壬子',
+           '一日': '戊申'},
+    2079: {'除夕': '2.1', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '甲子',
+           '一日': '癸丑'},
+    2080: {'除夕': '1.21', '立春': '2.4', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.4', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.6', '白露': '9.7', '寒露': '10.7', '立冬': '11.6', '大雪': '12.6', '小寒': '1.5', '一月': '丙子',
+           '一日': '戊午'},
+    2081: {'除夕': '2.8', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.7', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '戊子',
+           '一日': '甲子'},
+    2082: {'除夕': '1.28', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '庚子',
+           '一日': '己巳'},
+    2083: {'除夕': '2.16', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '壬子',
+           '一日': '甲戌'},
+    2084: {'除夕': '2.5', '立春': '2.4', '惊蛰': '3.4', '清明': '4.4', '立夏': '5.4', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.6', '白露': '9.6', '寒露': '10.7', '立冬': '11.6', '大雪': '12.6', '小寒': '1.4', '一月': '甲子',
+           '一日': '己卯'},
+    2085: {'除夕': '1.25', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.7', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '丙子',
+           '一日': '乙酉'},
+    2086: {'除夕': '2.13', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '戊子',
+           '一日': '庚寅'},
+    2087: {'除夕': '2.2', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '庚子',
+           '一日': '乙未'},
+    2088: {'除夕': '1.23', '立春': '2.4', '惊蛰': '3.4', '清明': '4.4', '立夏': '5.4', '芒种': '6.4', '小暑': '7.6',
+           '立秋': '8.6', '白露': '9.6', '寒露': '10.7', '立冬': '11.6', '大雪': '12.6', '小寒': '1.4', '一月': '壬子',
+           '一日': '庚子'},
+    2089: {'除夕': '2.9', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.7', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '甲子',
+           '一日': '丙午'},
+    2090: {'除夕': '1.29', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '丙子',
+           '一日': '辛亥'},
+    2091: {'除夕': '2.17', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '戊子',
+           '一日': '丙辰'},
+    2092: {'除夕': '2.6', '立春': '2.4', '惊蛰': '3.4', '清明': '4.4', '立夏': '5.4', '芒种': '6.4', '小暑': '7.6',
+           '立秋': '8.6', '白露': '9.6', '寒露': '10.7', '立冬': '11.6', '大雪': '12.6', '小寒': '1.4', '一月': '庚子',
+           '一日': '辛酉'},
+    2093: {'除夕': '1.26', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.7', '立冬': '11.6', '大雪': '12.6', '小寒': '1.5', '一月': '壬子',
+           '一日': '丁卯'},
+    2094: {'除夕': '2.14', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '甲子',
+           '一日': '壬申'},
+    2095: {'除夕': '2.4', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.7',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.7', '小寒': '1.5', '一月': '丙子',
+           '一日': '丁丑'},
+    2096: {'除夕': '1.24', '立春': '2.4', '惊蛰': '3.4', '清明': '4.4', '立夏': '5.4', '芒种': '6.4', '小暑': '7.6',
+           '立秋': '8.6', '白露': '9.6', '寒露': '10.7', '立冬': '11.6', '大雪': '12.6', '小寒': '1.4', '一月': '戊子',
+           '一日': '壬午'},
+    2097: {'除夕': '2.11', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.6', '白露': '9.7', '寒露': '10.7', '立冬': '11.6', '大雪': '12.6', '小寒': '1.5', '一月': '庚子',
+           '一日': '戊子'},
+    2098: {'除夕': '1.31', '立春': '2.3', '惊蛰': '3.5', '清明': '4.4', '立夏': '5.5', '芒种': '6.5', '小暑': '7.6',
+           '立秋': '8.7', '白露': '9.7', '寒露': '10.8', '立冬': '11.7', '大雪': '12.6', '小寒': '1.5', '一月': '壬子',
+           '一日': '癸巳'},
+}
+
+config_zhenduan_wuxing = {
+    "木": {
+        "过旺": "强势固执自负,容易善恶不分。",
+        "旺": "温和慈悲,适应力强,积极自信,乐于接受新事物。",
+        "衰": "内向保守,悲观压抑,情绪不稳。"
+    },
+    "火": {
+        "过旺": "冲动自负,过度兴奋、易焦虑,易与人冲突。",
+        "旺": "热情开朗,充满激情,善于表达,行动力强,重视礼仪,时间观念强。",
+        "衰": "消极悲观,缺乏热情,难以表达情感。"
+    },
+    "土": {
+        "过旺": "固执保守,思虑过重,有时候会导致想得太多而难以行动。",
+        "旺": "稳定可靠,富有包容心,诚实守信,执着有毅力,喜欢旧物。",
+        "衰": "缺乏安全感,容易依赖别人,情绪容易波动,容易焦虑不安。"
+    },
+    "金": {
+        "过旺": "严肃刻板,容易自我抑制情感,疏远别人导致孤独,控制欲强。",
+        "旺": "客观理性,重视规则纪律,决断力强,独立性强,富有正义感、是非观、道德观,容易招惹是非。",
+        "衰": "敏感,多愁善感,依赖性强,缺乏纪律组织性。"
+    },
+    "水": {
+        "过旺": "缺乏坚定的方向感,容易随波逐流,情感上过于敏感丰富,容易陷入过分的内省和感性而导致难以把握现实,给人冷漠、不好靠近的感觉。",
+        "旺": "冷静稳定,灵活性、适应性强,富有智慧和直觉力,生理欲望强。",
+        "衰": "刚硬,缺少变通,难以深入理解自己和他人,行动容易缺少谋略。"
+    },
+}
+
+config_zhenduan_shishen = {
+    "官杀": {
+        "过旺": "追求过多而导致分心,容易想入非非,性格怯弱。",
+        "旺": "有理想有追求,悟性高,具备辩证思维,重视口碑,会强迫自己去奋斗,容易操劳,容易为欲望破财。",
+        "衰": "难以聚焦理想,容易受到挑战,不易被认可,缺乏变革的动力,容易犹豫不决,容易因为不够积极主动错失机会。"
+    },
+    "官": {
+        "过旺": "过于严格刻板,自身容易因为过度的责任感和管理压力感到疲惫,控制欲过强。",
+        "旺": "重视规则和权威,事业运强,喜欢稳定。",
+        "衰": "容易受到挑战,不易被认可。"
+    },
+    "杀": {
+        "过旺": "与人冲突,生活中存在过多变化和不确定性,缺乏安全感。容易因为过于冒险导致轻率的决策行为。",
+        "旺": "具备自我变革和突破精神,有勇气有毅力有冒险精神,生活中多与他人竞争。",
+        "衰": "缺乏变革的动力,容易犹豫不决,容易因为不够积极主动错失机会。"
+    },
+    "财星": {
+        "过旺": "过度追求物质,忽略精神层面的发展与满足;忽略个人成长、家庭和人际关系中的非物质价值;容易过度消费,缺乏对财富的合理管理。",
+        "旺": "物质、现实主义,对财富的掌控欲强。",
+        "衰": "低欲望、淡泊名利,容易在财富积累上遇到障碍,长期稳定的收入来源易受到冲击,财富的积累相对慢。"
+    },
+    "财": {
+        "过旺": "过度追求财富稳定性容易失去一些机会。",
+        "旺": "以工作和事业提供的稳定财富收入为主,物质上追求安全和满足感,财富管理上以安全稳定为首要目标。",
+        "衰": "容易在财富积累上遇到障碍,长期稳定的收入来源易受到冲击。"
+    },
+    "才": {
+        "过旺": "忽略长期规划,财富波动较大;容易过度追求快速致富,涉足高风险投资。",
+        "旺": "财富获取的方式比较灵活和创新,喜好风险投资和快速获得收益。",
+        "衰": "财富观念比较保守,财富的积累相对慢,更多依赖稳定的积累。"
+    },
+    "印绶": {
+        "过旺": "过度依赖他人的帮助导致自立能力可能不够强。",
+        "旺": "贵人缘好,容易得到帮助;原则性强,重视口碑;为人谦虚低调,具有格局眼光;不爱操心,容易懒惰。",
+        "衰": "较少得到外界的帮助,学习知识容易遇到困难,需要更多的努力;精神和心灵层面的成长相对缓慢,需要更多时间去磨练自身,创新能力相对受限。"
+    },
+    "印": {
+        "过旺": "自信自满,忽视持续性的努力。",
+        "旺": "富有智慧,学习能力强,容易走自我创业路线。",
+        "衰": "学习知识容易遇到困难,需要更多的努力;精神和心灵层面的成长相对缓慢,需要更多时间去磨练自身。"
+    },
+    "枭": {
+        "过旺": "过度追求非主流,难以融入传统环境,容易和常规知识体系脱节,有时候思想过于前卫而导致不被理解。",
+        "旺": "擅长独立思考和创新,容易对非传统学识感兴趣,容易走个性化成长和发展路线,喜欢搞副业。",
+        "衰": "创新能力相对受限,思想和知识倾向主流和传统。"
+    },
+    "食伤": {
+        "过旺": "过度表现而得罪他人。",
+        "旺": "执行力强,好胜心强,喜欢操作,亲力亲为,有才华,好表现自己。",
+        "衰": "难以表达想法和感受,性格随和不喜争斗,容易怀才不遇,做事容易拖拉,不太注重生活品质。"
+    },
+    "食": {
+        "过旺": "过度依赖言辞表达,可能给人夸张不真诚的感觉。",
+        "旺": "喜欢享受生活,追求岁月静好,善于做规划,自我精神世界富足。",
+        "衰": "不太注重生活品质,喜欢走动、行动,多对抗。"
+    },
+    "伤": {
+        "过旺": "过度的创新容易挑战规则,从而导致冲突。情绪容易波动,情感表达过于直接,易冲动鲁莽。",
+        "旺": "喜欢社交,多与人互动,具备创新思维,见解独到,喜欢刺激性的充满挑战的事物,自身会比较辛苦。",
+        "衰": "思想倾向保守,遵循传统,对新事物持保留态度,喜欢慢生活。"
+    },
+    "比劫": {
+        "过旺": "拉帮结派,仗势欺人;容易过度竞争从而影响和他人的关系。",
+        "旺": "好客、仗义、朋友多,具有领导力。",
+        "衰": "较少与他人协作,交际面不广,缺少竞争的动力和欲望。"
+    },
+    "比": {
+        "过旺": "以自我为中心,忽略团队价值;容易给自己过多压力,不利于身心健康。",
+        "旺": "个人独立性强,协同能力强。",
+        "衰": "缺少竞争的动力和欲望,倾向依赖他人或环境提供的机会。"
+    },
+    "劫": {
+        "过旺": "因资源、利益的分配导致和朋友关系紧张;容易面临财富和资源被他人争夺或流失的风险。",
+        "旺": "和朋友伙伴间多存在利益关系,善于利用他人的资源,有较强的对个人资源、财富的管理能力和控制力。",
+        "衰": "人际关系中较少遇到竞争和挑战,独立性强,较少依赖他人,但也容易因此错失合作带来的机会。"
+    },
+}
+
+config_zhenduan_zuozhi = {
+    "官杀": "辩证思维强,擅长举一反三,缺乏安全感,好斗,容易自己为难自己,活的累,为钱为理想劳累。",
+    "财星": "对财、物的把控能力强,务实、现实主义。",
+    "印绶": "贵人缘好,喜欢发号施令,做事拖拉,容易犯懒,为人低调。",
+    "食伤": "喜欢亲力亲为,劳碌命。有才华,擅表达,容易强势。",
+    "比劫": "喜欢交朋友,喜欢人多,讲排场,执行力强,控制欲强。",
+}
+
+config_zhenduan_rizhu = {
+    "木": {
+        "木": "木日元,给人积极阳光充满活力的感觉,内心适应力强,能迅速使用环境,心怀慈悲。",
+        "火": "木日元,给人积极阳光充满活力的感觉,内心热情如火,充满激情和动力。",
+        "土": "木日元,给人积极阳光充满活力的感觉,内心沉稳踏实,信守承诺。",
+        "金": "木日元,给人积极阳光充满活力的感觉,内心刚硬不屈,讲义气。",
+        "水": "木日元,给人积极阳光充满活力的感觉,内心冷静客观,理性明事理。",
+    },
+    "火": {
+        "木": "火日元,热情好客重礼仪,内心适应力强,能迅速使用环境,心怀慈悲。",
+        "火": "火日元,热情好客重礼仪,内心热情如火,充满激情和动力。",
+        "土": "火日元,热情好客重礼仪,内心沉稳踏实,信守承诺。",
+        "金": "火日元,热情好客重礼仪,内心刚硬不屈,讲义气。",
+        "水": "火日元,热情好客重礼仪,内心冷静客观,理性明事理。",
+    },
+    "土": {
+        "木": "土日元,性格稳定少言语,内心适应力强,能迅速使用环境,心怀慈悲。",
+        "火": "土日元,性格稳定少言语,内心热情如火,充满激情和动力。",
+        "土": "土日元,性格稳定少言语,内心沉稳踏实,信守承诺。",
+        "金": "土日元,性格稳定少言语,内心刚硬不屈,讲义气。",
+        "水": "土日元,性格稳定少言语,内心冷静客观,理性明事理。",
+    },
+    "金": {
+        "木": "金日元,重规则有担当,内心适应力强,能迅速使用环境,心怀慈悲。",
+        "火": "金日元,重规则有担当,内心热情如火,充满激情和动力。",
+        "土": "金日元,重规则有担当,内心沉稳踏实,信守承诺。",
+        "金": "金日元,重规则有担当,内心刚硬不屈,讲义气。",
+        "水": "金日元,重规则有担当,内心冷静客观,理性明事理。",
+    },
+    "水": {
+        "木": "水日元,外在冷静客观,内心适应力强,能迅速使用环境,心怀慈悲。",
+        "火": "水日元,外在冷静客观,内心热情如火,充满激情和动力。",
+        "土": "水日元,外在冷静客观,内心沉稳踏实,信守承诺。",
+        "金": "水日元,外在冷静客观,内心刚硬不屈,讲义气。",
+        "水": "水日元,外在冷静客观,内心冷静客观,理性明事理。",
+    },
+}
+
+config_zhenduan_cai = {
+    "官": "靠名望地位、职位获取财富,财富来源相对稳定。",
+    "杀": "靠社会资源获取财富,多与人竞争,伴随较大压力。",
+    "印": "靠贵人提携、事业发展获取财富,根基比较稳固。",
+    "枭": "靠贵人提携、事业发展获取财富,有一定波动性。",
+    "食": "靠个人能力、才华、一技之长获取财富,相对比较费脑力。",
+    "伤": "靠亲力亲为、人脉关系获取财富,相对比较累自身。",
+    "比": "靠团队协作、竞争获取财富,比较依赖个人能力。",
+    "劫": "靠与朋友合作获取财富,需要分出部分利益来维持合作。",
+}
+
+config_zhenduan_jiankang_wuxing = {
+    "木旺": "肝气淤积,容易动肝火,生闷气,肌肉筋骨僵硬,酸痛甚至痉挛,眼干涩,视力模糊。",
+    "木衰": "肝气不足,容易疲劳,精神萎靡,视力下降、夜盲,发育迟缓,身材矮小。",
+    "火旺": "容易心悸、失眠多梦,口舌生疮,情绪易燥易怒,皮肤炎症、痤疮。",
+    "火衰": "心气不足,心慌胸闷,情绪低落,记忆力减退,血液循环不佳,手脚冰冷。",
+    "土旺": "消化系统失调、肥胖、胃胀,反酸,肌肉僵硬,四肢沉重,精力压力大。",
+    "土衰": "脾胃虚弱,食欲不振,消化不良,容易腹泻、胃寒,肌肉无力,意志力减退。",
+    "金旺": "咳嗽、气喘、喉咙干燥,易患慢性支气管炎、哮喘,皮肤干燥、脱皮、瘙痒,肠功能紊乱,便秘。",
+    "金衰": "肺气虚弱,气短,容易感冒鼻塞,皮肤松弛,毛发干枯,容易长斑,容易感染呼吸道疾病。",
+    "水旺": "肾气过盛,腰膝酸软,尿频尿急,体内湿气过重,全身或局部容易水肿,生理欲望强。",
+    "水衰": "肾气不足,耳鸣、听力减退、健忘,性功能减退,月经不调,骨质疏松,免疫力低。",
+}
+
+config_zhenduan_jiankang_zixing = {
+    "辰辰自刑": "容易庸人自扰,念头不通畅,进入哲学思维模式。",
+    "午午自刑": "容易口舌是非、空想,产生自我心理幻觉,无中生有又以此与人争执,或者喜欢没完没了的抱怨吐槽。",
+    "酉酉自刑": "容易神神叨叨,为金钱烦恼,喜欢抬扛。",
+    "亥亥自刑": "容易顾虑太多,选择困难。",
+}
+
+# xxyy运,带来xxx,同时yyy
+config_zhenduan_dayun = {
+    "官": "带来更多的机会,影响名望地位、职位晋升。",
+    "杀": "带来更多的资源,将面临更多竞争和挑战。",
+    "财": "带来更多财富机会,影响方方面面的稳定性。",
+    "才": "有机会获得额外的收获,影响自身财富的积累。",
+    "印": "为事业、学业带来助力,影响自身的根基。",
+    "枭": "为探索、突破带来助力,在新领域形成沉淀。",
+    "食": "将更加依赖个人的能力、才华,也是对心境的磨练。",
+    "伤": "带来人际关系的变动,也是个突破的契机。",
+    "比": "关系到自我的变革,也影响团队和伙伴的构建。",
+    "劫": "带来更多人际关系的实践,也是对财富管理的考验。",
+}
+
+
+def get_value(obj: {}, key, default=None):
+    result = default
+    if obj.__contains__(key):
+        result = obj[key]
+    return result
+
+
+def get_value2(obj: {}, key1, key2, default=None):
+    result = default
+    if obj.__contains__(key1):
+        temp = obj[key1]
+        if temp.__contains__(key2):
+            result = temp[key2]
+    return result
+
+
+def get_value3(obj: {}, key1, key2, key3, default=None):
+    result = default
+    if obj.__contains__(key1):
+        temp1 = obj[key1]
+        if temp1.__contains__(key2):
+            temp2 = temp1[key2]
+            if temp2.__contains__(key3):
+                result = temp2[key3]
+    return result
+
+
+def get_jie_qi(year: int, jieqi: str):
+    month = None
+    day = None
+    info = get_value(config_jie_qi, year)
+    if info is not None:
+        data = str(info[jieqi])
+        lst = data.split(".")
+        if len(lst) == 2:
+            month = int(lst[0])
+            day = int(lst[1])
+    result = [month, day]
+    if month is None or day is None:
+        result = None
+    return result

+ 14 - 0
yixue/DataCenter.py

@@ -0,0 +1,14 @@
+tokens = {
+
+}
+
+
+def set_token(uid: int, token: str):
+    tokens[uid] = token
+
+
+def get_token(uid: int):
+    if tokens.__contains__(uid):
+        return tokens[uid]
+    else:
+        return None

+ 386 - 0
yixue/GeJuLogic.py

@@ -0,0 +1,386 @@
+from yixue import Configs
+from yixue.Models import BaZi, GeJuItem, SiZhuGeJu, SiZhu
+from yixue.geju import CalcXiongJi
+
+
+# 要注意,这里其实有2个概念,一个叫天干地支影响,一个叫格局。
+# 天干地支影响指的是当10天干12地支到来时,对原局、大运、流年等影响,可以用来看哪些年份、月份的利弊。
+# 客户端页面上的天干地支选择指的就是这个,也可以用来看五行应该怎么增补最有利
+# 格局指的是八字的日元影响下,高能关系转换为十神会是什么,这里和原局、大运这些没有关系,只是一种由日元
+# 决定下的八字的适配性。比如乙木日元,一旦遇到辛,必然七杀攻身。乙木日元,比如酉辰合,促成了七杀合正财,这里跟
+# 原局、大运等是否有辰和酉这两个因素没有关系。
+
+def calc_tian_gan(bazi: BaZi):
+    bazi.tiangan_geju = {}
+    lushen = bazi.shishen_guanxi["禄神"]
+    banlu = bazi.shishen_guanxi["半禄"]
+    __calc_geju__(bazi.ri_gan.text, bazi.tiangan_geju, bazi.all_tian_gans(), Configs.config_tiangan_list, lushen, banlu,
+                  0, True)
+
+    bazi.dayun_tiangan_geju = {}
+    dayun_tgs = []
+    for dayun in bazi.dayun:
+        if dayun.is_dayun:
+            dayun_tgs.append(dayun.gan_zhu)
+    __calc_geju__(bazi.ri_gan.text, bazi.dayun_tiangan_geju, dayun_tgs, Configs.config_tiangan_list, lushen, banlu, 1,
+                  True)
+
+    bazi.liunian_tiangan_geju = {}
+    liunian_tgs = []
+    for dayun in bazi.dayun:
+        if not dayun.is_dayun:
+            continue
+        for ln in dayun.liunian:
+            liunian_tgs.append(ln.gan_zhu)
+    __calc_geju__(bazi.ri_gan.text, bazi.liunian_tiangan_geju, liunian_tgs, Configs.config_tiangan_list, lushen, banlu,
+                  2, True)
+
+
+def calc_di_zhi(bazi: BaZi):
+    bazi.dizhi_geju = {}
+    lushen = bazi.shishen_guanxi["禄神"]
+    banlu = bazi.shishen_guanxi["半禄"]
+    __calc_geju__(bazi.ri_gan.text, bazi.dizhi_geju, bazi.all_di_zhis(), Configs.config_dizhi_list, lushen, banlu, 0,
+                  False)
+
+    bazi.dayun_dizhi_geju = {}
+    dayun_dzs = []
+    for dayun in bazi.dayun:
+        if dayun.is_dayun:
+            dayun_dzs.append(dayun.zhi_zhu)
+    __calc_geju__(bazi.ri_gan.text, bazi.dayun_dizhi_geju, dayun_dzs, Configs.config_dizhi_list, lushen, banlu, 1,
+                  False)
+
+    bazi.liunian_dizhi_geju = {}
+    liunian_dzs = []
+    for dayun in bazi.dayun:
+        if not dayun.is_dayun:
+            continue
+        for ln in dayun.liunian:
+            liunian_dzs.append(ln.zhi_zhu)
+    __calc_geju__(bazi.ri_gan.text, bazi.liunian_dizhi_geju, liunian_dzs, Configs.config_dizhi_list, lushen, banlu,
+                  2, False)
+
+
+def count_geju_score(bazi: BaZi):
+    bazi.geju_score = {}
+    effects = {}
+    for wx in Configs.config_wuxing_list:
+        bazi.geju_score[wx] = 0
+        effects[wx] = 0
+    for ss in Configs.config_shishen_list:
+        bazi.geju_score[ss] = 0
+        effects[ss] = 0
+
+    lst = [bazi.tiangan_geju, bazi.dizhi_geju]
+    for item in lst:
+        for key in item:
+            geju = item[key]
+            if geju.total == 0:
+                continue
+            shishen = Configs.config_shishen[bazi.ri_gan.text][key]
+            wuxing = Configs.config_wuxing[key]
+            effects[wuxing] += 1
+            effects[shishen] += 1
+            bazi.geju_score[shishen] += geju.total
+            bazi.geju_score[wuxing] += geju.total
+
+    # print(effects)
+    # 把总分除以个数,计算平均分
+    for key in bazi.geju_score:
+        value = bazi.geju_score[key]
+        amount = effects[key]
+        if value == 0 or amount == 0:
+            continue
+        avg = round(value / amount, 1)
+        bazi.geju_score[key] = avg
+
+
+def count_dayun_geju_score(bazi: BaZi):
+    # key 大运
+    # value :{
+    #   "官": 0,
+    #   "火" :10,
+    # }
+
+    bazi.dayun_geju_score = {}
+    effects = {}
+
+    # 根据大运做初始化
+    for dayun in bazi.dayun:
+        if not dayun.is_dayun:
+            continue
+
+        temp = {}
+        dayun_key = dayun.gan_text + dayun.zhi_text
+        bazi.dayun_geju_score[dayun_key] = temp
+        effects[dayun_key] = {}
+
+        for wx in Configs.config_wuxing_list:
+            temp[wx] = 0
+            effects[dayun_key][wx] = 0
+
+        for ss in Configs.config_shishen_list:
+            temp[ss] = 0
+            effects[dayun_key][ss] = 0
+
+    # 计算并填装数据
+    for target in [bazi.dayun_tiangan_geju, bazi.dayun_dizhi_geju]:
+        for gan_zhi in target:  # key = 干支
+            shishen = Configs.config_shishen[bazi.ri_gan.text][gan_zhi]
+            wuxing = Configs.config_wuxing[gan_zhi]
+            sz_ge_ju = target[gan_zhi]  # SiZhuGeJu
+            temp_values = {}
+            for item in sz_ge_ju.items:  # GeJuItem
+                total = item.calc_total()
+                if total == 0:
+                    continue
+
+                obj = bazi.dayun_geju_score[item.trigger]
+                obj[shishen] += total
+                obj[wuxing] += total
+
+                if not temp_values.__contains__(item.trigger):
+                    temp_values[item.trigger] = {}
+                    __init_obj_of_wuxing_shishen__(temp_values[item.trigger])
+                temp_values[item.trigger][wuxing] += total
+                temp_values[item.trigger][shishen] += total
+
+            # if temp_values.__contains__("丙寅"):
+            # print(temp_values["丙寅"])
+            for dy in temp_values:
+                dt = temp_values[dy]
+                for wuxing in Configs.config_wuxing_list:
+                    if dt[wuxing] != 0:
+                        effects[dy][wuxing] += 1
+                for shishen in Configs.config_shishen_list:
+                    if dt[shishen] != 0:
+                        effects[dy][shishen] += 1
+
+    # print(11, bazi.dayun_geju_score["丙寅"])
+    # print(12, effects["丙寅"])
+
+    # 把总分除以个数,计算平均分
+    for dayun in bazi.dayun_geju_score:
+        obj = bazi.dayun_geju_score[dayun]
+        eft = effects[dayun]
+        for key in obj:
+            value = obj[key]
+            amount = eft[key]
+            if value == 0 or amount == 0:
+                continue
+
+            avg = round(value / amount, 1)
+            obj[key] = avg
+            # print(value, amount, avg, dayun, key)
+
+
+def count_liunian_geju_score(bazi: BaZi):
+    bazi.liunian_geju_score = {}
+    effects = {}
+    # 根据流年做初始化
+    for dayun in bazi.dayun:
+        if not dayun.is_dayun:
+            continue
+        for liunian in dayun.liunian:
+            temp = {}
+            liunian_key = dayun.gan_text + dayun.zhi_text + liunian.gan_text + liunian.zhi_text
+            bazi.liunian_geju_score[liunian_key] = temp
+            effects[liunian_key] = {}
+            for wx in Configs.config_wuxing_list:
+                temp[wx] = 0
+                effects[liunian_key][wx] = 0
+            for ss in Configs.config_shishen_list:
+                temp[ss] = 0
+                effects[liunian_key][ss] = 0
+
+    # 计算并填装数据
+    for target in [bazi.liunian_tiangan_geju, bazi.liunian_dizhi_geju]:
+        for gan_zhi in target:  # key = 干支
+            shishen = Configs.config_shishen[bazi.ri_gan.text][gan_zhi]
+            wuxing = Configs.config_wuxing[gan_zhi]
+            sz_ge_ju = target[gan_zhi]  # SiZhuGeJu
+            temp_values = {}
+            for item in sz_ge_ju.items:  # GeJuItem
+                total = item.calc_total()
+                if total == 0:
+                    continue
+
+                obj = bazi.liunian_geju_score[item.trigger]
+                obj[shishen] += total
+                obj[wuxing] += total
+
+                if not temp_values.__contains__(item.trigger):
+                    temp_values[item.trigger] = {}
+                    __init_obj_of_wuxing_shishen__(temp_values[item.trigger])
+                temp_values[item.trigger][wuxing] += total
+                temp_values[item.trigger][shishen] += total
+
+            for ln_key in temp_values:
+                dt = temp_values[ln_key]
+                for wuxing in Configs.config_wuxing_list:
+                    if dt[wuxing] != 0:
+                        effects[ln_key][wuxing] += 1
+                for shishen in Configs.config_shishen_list:
+                    if dt[shishen] != 0:
+                        effects[ln_key][shishen] += 1
+
+    for key in bazi.liunian_geju_score:
+        obj = bazi.liunian_geju_score[key]
+        eft = effects[key]
+        for atr in obj:
+            value = obj[atr]
+            amount = eft[atr]
+            if value == 0 or amount == 0:
+                continue
+            avg = round(value / amount, 1)
+            obj[atr] = avg
+
+
+def __init_obj_of_wuxing_shishen__(obj: {}):
+    for wx in Configs.config_wuxing_list:
+        obj[wx] = 0
+
+    for ss in Configs.config_shishen_list:
+        obj[ss] = 0
+
+
+def __calc_dayun_geju_score__(bazi: BaZi):
+    effects = {}
+    extra_key = "运"
+    for wx in Configs.config_wuxing_list:
+        bazi.geju_score[wx + extra_key] = 0
+        effects[wx + extra_key] = 0
+    for ss in Configs.config_shishen_list:
+        bazi.geju_score[ss + extra_key] = 0
+        effects[ss + extra_key] = 0
+
+    lst = [bazi.tiangan_geju, bazi.dizhi_geju]
+    for item in lst:
+        for key in item:
+            geju = item[key]
+            # shishen = Configs.config_shishen[bazi.ri_gan.text][key]
+            # wuxing = Configs.config_wuxing[key]
+            # effects[wuxing] += 1
+            # effects[shishen] += 1
+            # bazi.geju_score[shishen + extra_key] += geju.total
+            # bazi.geju_score[wuxing + extra_key] += geju.total
+            for temp_key in geju.dayun_scores:
+                shishen = Configs.config_shishen[bazi.ri_gan.text][temp_key]
+                wuxing = Configs.config_wuxing[temp_key]
+                effects[wuxing + extra_key] += 1
+                effects[shishen + extra_key] += 1
+                bazi.geju_score[shishen + extra_key] += geju.total
+                bazi.geju_score[wuxing + extra_key] += geju.total
+
+    # 把总分除以个数,计算平均分
+    for key in bazi.geju_score:
+        if not "运" in key:
+            continue
+        value = bazi.geju_score[key]
+        amount = effects[key]
+        avg = round(value / amount, 1)
+        bazi.geju_score[key] = avg
+
+
+def check_xiong_ji(bazi: BaZi):
+    CalcXiongJi.run(bazi)
+
+
+def __check_liuhehuasha__(geju: SiZhuGeJu, lushen: str, banlu: [str]):
+    # 检查四柱格局中是否有地支六合化煞
+    hasHe = False
+    hasSha = False
+    heList = []
+    for item in geju.items:
+        if item.guanxi in ["合", "暗合"]:
+            hasHe = True
+            heList.append(item)
+        elif item.guanxi in ["冲", "刑", "穿", "破"]:
+            hasSha = True
+
+    if hasHe and hasSha:
+        for item in heList:
+            item.clear_score()
+            __calc_score__(item, lushen, banlu, 30)
+
+
+def __calc_geju__(riyuan: str, result, szAry: [SiZhu], texts: [str], lushen: str, banlu: [str], trigger_mode: int,
+                  is_tiangan: bool):
+    for text in texts:
+        szGeJu = SiZhuGeJu()
+        szGeJu.yudao = text
+        for sz in szAry:
+            if sz.text == "无":
+                continue
+            key = text + sz.text
+            if Configs.config_gaoneng_query.__contains__(key):
+                gns = Configs.config_gaoneng_query[key]
+                for gn in gns:
+                    item = GeJuItem()
+                    item.arg1 = text
+                    item.arg2 = sz.text
+                    if trigger_mode == 1:
+                        item.trigger = sz.dayun_text
+                    elif trigger_mode == 2:
+                        item.trigger = sz.dayun_text + sz.liunian_text
+                    item.shishen1 = Configs.config_shishen[riyuan][text]
+                    item.shishen2 = Configs.config_shishen[riyuan][sz.text]
+                    item.guanxi = gn["guanxi"]
+                    __calc_score__(item, lushen, banlu, 0)
+                    szGeJu.items.append(item)
+        if not is_tiangan:
+            __check_liuhehuasha__(szGeJu, lushen, banlu)
+        szGeJu.count_score()
+        result[text] = szGeJu
+
+
+def __calc_score__(item: GeJuItem, lushen: str, banlu: [str], extra: int):
+    # 评分由两个部分组成,一个是关系分,一个是排序分
+    # 关系分指的是高能关系的评分,排序分指的是当发生某些关系时,受到好坏程度的影响高低
+    # 最终分数等于 关系分(十位) + 高能分(个位)
+    # 另外,如果对禄神起作用,将产生额外的禄神系数,禄神系数是一个倍数,作用在排序分上,用来增加或减少得到的排序分
+    # 最终分数=关系分+排序分*禄神系数
+    # 天干的合有可能虚透,分数要少一些(50),地支的合如果同柱内不存在其他负面关系,分数也会少一些(50),暗合也是这个规则
+
+    order_value = __get__config_score__(item)
+    # 默认0分,表示不发生高能关系时,不好也不坏
+    guanxi_value = Configs.get_value(Configs.config_gaoneng_guanxi_score, item.guanxi)
+    if guanxi_value is None:
+        guanxi_value = 0
+    guanxi_value += extra
+
+    lushen_param = 0
+    if item.arg1 == lushen or item.arg2 == lushen:
+        lushen_param = 1
+    elif item.arg1 in banlu or item.arg2 in banlu:
+        lushen_param = 0.5
+
+    if lushen_param > 0:
+        lushen_score = 0
+        if Configs.config_gaoneng_lushen_score.__contains__(item.guanxi):
+            lushen_score = Configs.config_gaoneng_lushen_score[item.guanxi]
+        new_order_value = lushen_score * lushen_param / 100
+        new_order_value = (1 + new_order_value) * order_value
+        order_value = round(new_order_value, 0)
+
+    if item.shishen2 in ["官", "杀"]:
+        item.guan_sha += order_value + guanxi_value
+    elif item.shishen2 in ["比", "劫"]:
+        item.bi_jie += order_value + guanxi_value
+    elif item.shishen2 in ["财", "才"]:
+        item.cai_xing += order_value + guanxi_value
+    elif item.shishen2 in ["印", "枭"]:
+        item.yin_shou += order_value + guanxi_value
+    elif item.shishen2 in ["食", "伤"]:
+        item.shi_shang += order_value + guanxi_value
+
+
+def __get__config_score__(item: GeJuItem):
+    score = 0
+    if item.guanxi != "自刑":
+        try:
+            score = Configs.config_gaoneng_score[item.guanxi][item.shishen1][item.shishen2]
+        except Exception:
+            print("not found gaoneng score:", item.guanxi, item.shishen1, item.shishen2)
+    return score

+ 509 - 0
yixue/Models.py

@@ -0,0 +1,509 @@
+import datetime
+
+from yixue import Configs
+
+
+class BaseYiXue(object):
+    def __repr__(self):
+        result = self.__class__.__name__ + "("
+        for attr in self.__dict__:
+            if attr.startswith("_") or attr.startswith("__") or attr == "__tablename__":
+                continue
+            result += attr + "=" + str(getattr(self, attr)) + " "
+        result += ")"
+        return result
+
+    def __resolve_base_type__(self, obj, attr, value):
+        obj[attr] = value
+
+    def __resolve_yixue_object(self, obj, attr, value):
+        obj[attr] = value.to_response()
+
+    def __resolve__(self, value):
+        if value is None:
+            return None
+        tp = type(value)
+        if tp in [str, int, float, bool]:
+            return value
+        elif tp is datetime.datetime:
+            return str(value)
+        elif issubclass(tp, BaseYiXue):
+            return value.to_response()
+        elif tp is list:
+            temp = []
+            for list_item in value:
+                temp.append(self.__resolve__(list_item))
+            return temp
+        elif tp is dict:
+            temp = {}
+            for k, v in value.items():
+                temp[k] = self.__resolve__(v)
+            return temp
+        else:
+            print("无法处理的类型:", tp, value)
+            return None
+
+    def to_response(self):
+        result = {}
+        for attr in self.__dict__:
+            if attr.startswith("_") or attr.startswith("__") or attr == "__tablename__":
+                continue
+            value = getattr(self, attr)
+            result[attr] = self.__resolve__(value)
+        return result
+
+
+class BaseInfo(BaseYiXue):
+    date_mode: int
+    year: int
+    month: int
+    day: int
+    hour_mode: int
+    hour: int
+    minute: int
+    area_mode: int
+    sheng: str
+    shi: str
+    qu: str
+    nongli_year: int
+    nongli_month: str
+    nongli_day: str
+    nian_gan: str
+    nian_zhi: str
+    yue_gan: str
+    yue_zhi: str
+    ri_gan: str
+    ri_zhi: str
+    shi_gan: str
+    shi_zhi: str
+
+
+class SiZhuResult(BaseYiXue):
+    nian_gan: str = None
+    nian_zhi: str = None
+    yue_gan: str = None
+    yue_zhi: str = None
+    ri_gan: str = None
+    ri_zhi: str = None
+    shi_gan: str = None
+    shi_zhi: str = None
+    sheng: str = None
+    shi: str = None
+    qu: str = None
+    tai_yang_shi: datetime = None
+
+
+class SiZhuCheckResult(BaseYiXue):
+    error: bool
+    adv_nian: [str]
+    adv_yue: [str]
+    adv_ri: [str]
+    adv_shi: [str]
+    adv_date: [str]
+
+    def __init__(self):
+        self.error = False
+        self.adv_nian = []
+        self.adv_yue = []
+        self.adv_ri = []
+        self.adv_shi = []
+        self.adv_date = []
+
+
+class PowerCounter(BaseYiXue):
+    power_raw: {}
+    power_muku: {}
+    power_gaoneng: {}
+    power_zihe: {}
+
+    @classmethod
+    def new_counter(cls):
+        temp = {}
+        for wx in Configs.config_wuxing_list:
+            temp[wx] = 0
+        for ss in Configs.config_shishen_list:
+            temp[ss] = 0
+        return temp
+
+
+class GaoNeng(BaseYiXue):
+    arg1: str
+    arg2: str
+    arg3: str
+    wei_zhi1: int
+    wei_zhi2: int
+    wei_zhi3: int
+    wu_xing1: str
+    wu_xing2: str
+    wu_xing3: str
+    shi_shen1: str
+    shi_shen2: str
+    shi_shen3: str
+    text: str
+    guanxi: str
+    leibie: str
+    hehua: str
+    zengqiang_shishen: str
+    fangxiang: str
+    tip: str
+    sign: str
+    xing_chu: str
+    xing_chong: str
+
+    def __init__(self):
+        self.arg3 = None
+        self.wei_zhi3 = None
+
+
+class SiZhu(BaseYiXue):
+    text: str
+    wei_zhi: int
+    wu_xing: str
+    shi_shen: str
+    yin_yang: str
+    cang_gan1: str
+    cang_gan2: str
+    cang_gan3: str
+    gan1_wu_xing: str
+    gan2_wu_xing: str
+    gan3_wu_xing: str
+    gan1_shi_shen: str = None
+    gan2_shi_shen: str = None
+    gan3_shi_shen: str = None
+    zhang_sheng_zhu: str
+    zhang_sheng_ri: str
+    gaonengs: [GaoNeng]
+    shenshas: [str]
+    is_muku: bool
+    is_muku_open: bool
+    trigger_gaonengs: {}
+    dayun_text: str
+    liunian_text: str
+    liuyue_text: str
+    liuri_text: str
+
+    def __init__(self, text: str, wz: int):
+        self.text = text
+        self.wei_zhi = wz
+        self.gaonengs = []
+        self.shenshas = []
+        self.trigger_gaonengs = {}
+        self.is_muku = Configs.config_muku_list.__contains__(text)
+        self.is_muku_open = False
+
+    def has_guanxi_in_gaonengs(self, guanxis: [str]):
+        result = False
+        for gn in self.gaonengs:
+            if gn.guanxi in guanxis:
+                result = True
+                break
+        return result
+
+    def has_shen_sha(self, name: str):
+        result = False
+        for sh in self.shenshas:
+            if sh == name:
+                result = True
+                break
+        return result
+
+
+class GeJuItem(BaseYiXue):
+    arg1: str
+    arg2: str
+    shishen1: str
+    shishen2: str
+    guanxi: str
+    guan_sha: int = 0
+    cai_xing: int = 0
+    yin_shou: int = 0
+    shi_shang: int = 0
+    bi_jie: int = 0
+    trigger: str
+
+    def clear_score(self):
+        self.guan_sha = 0
+        self.cai_xing = 0
+        self.yin_shou = 0
+        self.shi_shang = 0
+        self.bi_jie = 0
+
+    def calc_total(self):
+        return self.guan_sha + self.cai_xing + self.yin_shou + self.shi_shang + self.bi_jie
+
+
+class SiZhuGeJu(BaseYiXue):
+    yudao: str
+    items: [GeJuItem]
+    guan_sha: int = 0
+    cai_xing: int = 0
+    yin_shou: int = 0
+    shi_shang: int = 0
+    bi_jie: int = 0
+    total: int = 0
+
+    def __init__(self):
+        self.items = []
+
+    def count_score(self):
+        for item in self.items:
+            self.guan_sha += item.guan_sha
+            self.cai_xing += item.cai_xing
+            self.yin_shou += item.yin_shou
+            self.shi_shang += item.shi_shang
+            self.bi_jie += item.bi_jie
+        self.total = self.guan_sha + self.cai_xing + self.yin_shou + self.shi_shang + self.bi_jie
+
+
+class XiongJi(BaseYiXue):
+    name: str
+    guanxi: str
+    arg1: str
+    arg2: str
+    tip: str
+    found: bool
+
+
+class LiuRi(BaseYiXue):
+    day: int
+    nong_li: str
+    xing_qi: str
+    gan_text: str
+    zhi_text: str
+    gan_zhu: SiZhu
+    zhi_zhu: SiZhu
+    trigger: str
+
+
+class LiuYue(BaseYiXue):
+    month: int
+    jie_qi: str
+    jie_qi_date: str
+    gan_text: str
+    zhi_text: str
+    gan_zhu: SiZhu
+    zhi_zhu: SiZhu
+    liuri: [LiuRi]
+    trigger: str
+    yinyuan_level: int = 0
+    yinyuan_tip: str
+
+
+class LiuNian(BaseYiXue):
+    year: int
+    gan_text: str
+    zhi_text: str
+    from_dayun: bool
+    age: int
+    gan_zhu: SiZhu
+    zhi_zhu: SiZhu
+    liuyue: []
+    trigger: str
+    yinyuan_level: int = 0
+    yinyuan_tip: str
+
+
+class DaYun(BaseYiXue):
+    gan_text: str
+    zhi_text: str
+    is_dayun: bool
+    start_age: int
+    end_age: int
+    start_year: int
+    end_year: int
+    gan_zhu: SiZhu
+    zhi_zhu: SiZhu
+    liunian: []
+    trigger: str
+
+
+class ZhenDuanItem(BaseYiXue):
+    key: str
+    content: str
+    order: int
+    selected: bool
+    defaultSelected: bool
+    tip: str
+
+    def __init__(self, order: int, *args: str):
+        self.order = order
+        self.content = ""
+        self.selected = False
+        self.defaultSelected = False
+        self.key = None
+        for arg in args:
+            self.content += arg
+
+    def set_selected(self, v: bool):
+        self.selected = v
+        self.defaultSelected = v
+
+
+class ZhenDuan(BaseYiXue):
+    jianyi: [ZhenDuanItem]
+    cankao: [ZhenDuanItem]
+
+    def __init__(self):
+        self.jianyi = []
+        self.cankao = []
+
+
+class ZhenDuanSet(BaseYiXue):
+    wuxing: ZhenDuan
+    shishen: ZhenDuan
+    zuozhi: ZhenDuan
+    menhu: ZhenDuan
+    shensha: ZhenDuan
+    geju: ZhenDuan
+    gaoneng: {}
+    jiankang: ZhenDuan
+    qinggan: ZhenDuan
+    dayun: ZhenDuan
+    yinyuan: ZhenDuan
+
+    def __init__(self):
+        self.wuxing = ZhenDuan()
+        self.shishen = ZhenDuan()
+        self.zuozhi = ZhenDuan()
+        self.menhu = ZhenDuan()
+        self.shensha = ZhenDuan()
+        self.geju = ZhenDuan()
+        self.gaoneng = {}
+        self.jiankang = ZhenDuan()
+        self.qinggan = ZhenDuan()
+        self.dayun = ZhenDuan()
+        self.yinyuan = ZhenDuan()
+
+
+class PowerQiangRuo(BaseYiXue):
+    mu_ruo: bool = False
+    huo_ruo: bool = False
+    tu_ruo: bool = False
+    jin_ruo: bool = False
+    shui_ruo: bool = False
+    mu_wang: bool = False
+    huo_wang: bool = False
+    tu_wang: bool = False
+    jin_wang: bool = False
+    shui_wang: bool = False
+    guan_sha_ruo: bool = False
+    cai_xing_ruo: bool = False
+    yin_shou_ruo: bool = False
+    shi_shang_ruo: bool = False
+    bi_jie_ruo: bool = False
+    guan_sha_wang: bool = False
+    cai_xing_wang: bool = False
+    yin_shou_wang: bool = False
+    shi_shang_wang: bool = False
+    bi_jie_wang: bool = False
+    guan_sha_guo_wang: bool = False
+    cai_xing_guo_wang: bool = False
+
+
+class TaoHuaZhu(BaseYiXue):
+    gan_zhu: SiZhu
+    zhi_zhu: SiZhu
+    level: int  # 数值越小优先级越高
+    tg_keys: [str]
+    dz_keys: [str]
+
+    def __init__(self, gan: SiZhu, zhi: SiZhu, level: int):
+        self.level = level
+        self.gan_zhu = gan
+        self.zhi_zhu = zhi
+        self.tg_keys = []
+        self.dz_keys = []
+
+
+class QuShiItem(BaseYiXue):
+    key: str
+    score: int
+    reasons: [str]
+
+
+class LiuNianQuShi(BaseYiXue):
+    year: int
+    gan_text: str
+    zhi_text: str
+    age: int
+    items: {}
+
+
+class DaYunQuShi(BaseYiXue):
+    is_dayun: bool
+    gan_text: str
+    zhi_text: str
+    start_year: int
+    end_year: int
+    start_age: int
+    end_age: int
+    items: {}
+
+
+class QuShiSet(BaseYiXue):
+    dayun: [DaYunQuShi]
+    liunian: [LiuNianQuShi]
+
+
+class BaZi(BaseYiXue):
+    is_man: bool
+    tai_yang_shi: datetime
+    base_info: BaseInfo
+    nian_gan: SiZhu
+    nian_zhi: SiZhu
+    yue_gan: SiZhu
+    yue_zhi: SiZhu
+    ri_gan: SiZhu
+    ri_zhi: SiZhu
+    shi_gan: SiZhu
+    shi_zhi: SiZhu
+    counter: PowerCounter
+    power_steps: {}
+    shishen_guanxi: {}
+    tong_dang: float
+    yi_dang: float
+    tiangan_geju: {}
+    dizhi_geju: {}
+    geju_score: {}
+    geju_xiongji: {}
+    dayun: [DaYun]
+    dayun_tiangan_geju: {}
+    dayun_dizhi_geju: {}
+    dayun_geju_score: {}
+    liunian_tiangan_geju: {}
+    liunian_dizhi_geju: {}
+    liunian_geju_score: {}
+    zhenduan: ZhenDuanSet
+    qushi: QuShiSet
+
+    @staticmethod
+    def build(sizhu: SiZhuResult):
+        """
+        传入参数的顺序必须是:年干、年支、月干、月支、日干、日支、时干、时支
+        """
+        bazi = BaZi()
+        bazi.nian_gan = SiZhu(sizhu.nian_gan, Configs.const_nian_gan)
+        bazi.nian_zhi = SiZhu(sizhu.nian_zhi, Configs.const_nian_zhi)
+        bazi.yue_gan = SiZhu(sizhu.yue_gan, Configs.const_yue_gan)
+        bazi.yue_zhi = SiZhu(sizhu.yue_zhi, Configs.const_yue_zhi)
+        bazi.ri_gan = SiZhu(sizhu.ri_gan, Configs.const_ri_gan)
+        bazi.ri_zhi = SiZhu(sizhu.ri_zhi, Configs.const_ri_zhi)
+        bazi.shi_gan = SiZhu(sizhu.shi_gan, Configs.const_shi_gan)
+        bazi.shi_zhi = SiZhu(sizhu.shi_zhi, Configs.const_shi_zhi)
+        bazi.tai_yang_shi = sizhu.tai_yang_shi
+
+        bazi.zhenduan = ZhenDuanSet()
+        return bazi
+
+    def all_zhus(self):
+        """
+        返回顺序:年干、年支、月干、月支、日干、日支、时干、时支
+        """
+        return [self.nian_gan, self.nian_zhi, self.yue_gan, self.yue_zhi, self.ri_gan, self.ri_zhi, self.shi_gan,
+                self.shi_zhi]
+
+    def all_tian_gans(self):
+        return [self.nian_gan, self.yue_gan, self.ri_gan, self.shi_gan]
+
+    def all_di_zhis(self):
+        return [self.nian_zhi, self.yue_zhi, self.ri_zhi, self.shi_zhi]

+ 144 - 0
yixue/QuShiLogic.py

@@ -0,0 +1,144 @@
+from yixue import Configs
+from yixue.Models import BaZi, QuShiSet, DaYunQuShi, QuShiItem, SiZhu, GaoNeng, LiuNian, LiuNianQuShi
+
+
+def calc_qushi(bazi: BaZi):
+    bazi.qushi = QuShiSet()
+    __dayun_qushi__(bazi)
+
+
+def __dayun_qushi__(bazi: BaZi):
+    bazi.qushi.dayun = []
+    bazi.qushi.liunian = []
+    lushen = bazi.shishen_guanxi["禄神"]
+    banlu = bazi.shishen_guanxi["半禄"]
+
+    for dayun in bazi.dayun:
+        if not dayun.is_dayun:
+            continue
+        qs = DaYunQuShi()
+        qs.is_dayun = dayun.is_dayun
+        qs.gan_text = dayun.gan_text
+        qs.zhi_text = dayun.zhi_text
+        qs.start_year = dayun.start_year
+        qs.end_year = dayun.end_year
+        qs.start_age = dayun.start_age
+        qs.end_age = dayun.end_age
+        qs.items = {}
+        __create_qushi_items__(qs.items)
+        __resolve_zhu__(dayun.gan_zhu, qs.items, lushen, banlu, "大运")
+        __resolve_zhu__(dayun.zhi_zhu, qs.items, lushen, banlu, "大运")
+        for liunian in dayun.liunian:
+            __resolve_zhu__(liunian.gan_zhu, qs.items, lushen, banlu, str(liunian.year) + "年")
+            __resolve_zhu__(liunian.zhi_zhu, qs.items, lushen, banlu, str(liunian.year) + "年")
+            __build_liunian_qu_shi__(liunian, lushen, banlu, bazi)
+
+        bazi.qushi.dayun.append(qs)
+
+
+def __build_liunian_qu_shi__(liunian: LiuNian, lushen: str, banlu: [str], bazi: BaZi):
+    qs = LiuNianQuShi()
+    qs.year = liunian.year
+    qs.age = liunian.age
+    qs.gan_text = liunian.gan_text
+    qs.zhi_text = liunian.zhi_text
+    qs.items = {}
+    __create_qushi_items__(qs.items)
+    __resolve_zhu__(liunian.gan_zhu, qs.items, lushen, banlu, str(liunian.year) + "年")
+    __resolve_zhu__(liunian.zhi_zhu, qs.items, lushen, banlu, str(liunian.year) + "年")
+    for liuyue in liunian.liuyue:
+        __resolve_zhu1__(liuyue.gan_zhu, qs.items, lushen, banlu, str(liunian.year) + "年" + str(liuyue.month) + "月")
+        __resolve_zhu1__(liuyue.zhi_zhu, qs.items, lushen, banlu, str(liunian.year) + "年" + str(liuyue.month) + "月")
+    bazi.qushi.liunian.append(qs)
+
+
+def __resolve_zhu1__(zhu: SiZhu, items: {}, lushen: str, banlu: [str], title: str):
+    ss = zhu.shi_shen
+    item = items[ss]
+    extra = 0
+    if __has_hua_sha__(zhu):
+        extra = 30
+    for gn in zhu.gaonengs:
+        # 排序分,就是合什么,冲什么的不同分数
+        order_score = __get_order_score__(gn)
+        guanxi_score = __get_guanxi_score__(gn)
+        if gn.guanxi in ["合", "暗合"]:
+            guanxi_score += extra
+        total_score = __calc_total_score__(order_score, guanxi_score, lushen, banlu, gn)
+        item.score += total_score
+        reason = title + " : " + gn.shi_shen1 + gn.guanxi + gn.shi_shen2 + " => " + str(total_score)
+        item.reasons.append(reason)
+
+
+def __resolve_zhu__(zhu: SiZhu, items: {}, lushen: str, banlu: [str], title: str):
+    ss = zhu.shi_shen
+    item = items[ss]
+    extra = 0
+    if __has_hua_sha__(zhu):
+        extra = 30
+    for gn in zhu.gaonengs:
+        # 排序分,就是合什么,冲什么的不同分数
+        order_score = __get_order_score__(gn)
+        guanxi_score = __get_guanxi_score__(gn)
+        if gn.guanxi in ["合", "暗合"]:
+            guanxi_score += extra
+        total_score = __calc_total_score__(order_score, guanxi_score, lushen, banlu, gn)
+        item.score += total_score
+        reason = title + " : " + gn.shi_shen1 + gn.guanxi + gn.shi_shen2 + " => " + str(total_score)
+        item.reasons.append(reason)
+
+
+def __calc_total_score__(order_score, guanxi_score, lushen: str, banlu: [str], gn: GaoNeng):
+    total = order_score + guanxi_score
+    lushen_param = 0
+    if gn.arg1 == lushen or gn.arg2 == lushen:
+        lushen_param = 1
+    elif gn.arg1 in banlu or gn.arg2 in banlu:
+        lushen_param = 0.5
+
+    if lushen_param > 0:
+        lushen_score = 0
+        if Configs.config_gaoneng_lushen_score.__contains__(gn.guanxi):
+            lushen_score = Configs.config_gaoneng_lushen_score[gn.guanxi]
+        eft = 1 + lushen_score * lushen_param / 100
+        total = round(eft * total, 0)
+    return total
+
+
+def __has_hua_sha__(zhu: SiZhu):
+    hasHe = False
+    hasSha = False
+
+    for gn in zhu.gaonengs:
+        if gn.guanxi in ["合", "暗合"]:
+            hasHe = True
+        elif gn.guanxi in ["冲", "刑", "穿", "破"]:
+            hasSha = True
+
+    return hasHe and hasSha
+
+
+def __get_guanxi_score__(gn: GaoNeng):
+    guanxi_value = Configs.get_value(Configs.config_gaoneng_guanxi_score, gn.guanxi)
+    if guanxi_value is None:
+        guanxi_value = 0
+    return guanxi_value
+
+
+def __get_order_score__(gn: GaoNeng):
+    score = 0
+    if gn.guanxi not in ["自刑", "三会"]:
+        try:
+            score = Configs.config_gaoneng_score[gn.guanxi][gn.shi_shen1][gn.shi_shen2]
+        except Exception:
+            print("not found gaoneng score:", gn.guanxi, gn.shi_shen1, gn.shi_shen2)
+    return score
+
+
+def __create_qushi_items__(result: {}):
+    for key in Configs.config_shishen_list:
+        item = QuShiItem()
+        item.score = 0
+        item.reasons = []
+        item.key = key
+        result[key] = item

+ 186 - 0
yixue/SiZhuLogic.py

@@ -0,0 +1,186 @@
+from yixue import Configs
+from yixue.Models import BaZi, PowerCounter, SiZhu, SiZhuResult
+from yixue.sizhu import CalcSiZhu, CalcGaoNeng, CalcPower, CheckMuKu, CalcDaYun, CalcShenSha, CalcLiuNian, CalcLiuYue, \
+    CalcLiuRi, CalcYinYuan
+
+
+def calc_si_zhu(year: int, month: int, day: int, know_time: bool, hour: int, minute: int, sheng: str, shi: str,
+                qu: str) -> SiZhuResult:
+    """
+        返回数组,顺序是:[年干、年支、月干、月支、日干、日支、时干、时支]
+    """
+
+    # test
+    # year = 1989
+    # month = 10
+    # day = 2
+    # hour = 18
+    # minute = 30
+    # sheng = "福建省"
+    # shi = "宁德"
+    # qu = "市辖区"
+    result = CalcSiZhu.run(year, month, day, know_time, hour, minute, sheng, shi, qu)
+    return result
+
+
+def calc_wu_xing(bazi: BaZi):
+    for sz in bazi.all_zhus():
+        sz.wu_xing = Configs.get_value(Configs.config_wuxing, sz.text)
+
+
+def calc_yin_yang(bazi: BaZi):
+    for sz in bazi.all_zhus():
+        sz.yin_yang = Configs.get_value(Configs.config_yinyang, sz.text)
+
+
+def calc_shi_shen(bazi: BaZi):
+    for sz in bazi.all_zhus():
+        sz.shi_shen = Configs.get_value2(Configs.config_shishen, bazi.ri_gan.text, sz.text)
+
+
+def calc_cang_gans(bazi: BaZi):
+    riyuan = bazi.ri_gan.text
+    for dz in bazi.all_di_zhis():
+        data = Configs.get_value(Configs.config_canggan, dz.text)
+        if data is None:
+            continue
+        dz.cang_gan1 = data[0]
+        dz.cang_gan2 = data[1]
+        dz.cang_gan3 = data[2]
+        dz.gan1_wu_xing = Configs.config_wuxing[dz.cang_gan1]
+        dz.gan1_shi_shen = Configs.config_shishen[riyuan][dz.cang_gan1]
+        if dz.cang_gan2 is not None:
+            dz.gan2_wu_xing = Configs.config_wuxing[dz.cang_gan2]
+            dz.gan2_shi_shen = Configs.config_shishen[riyuan][dz.cang_gan2]
+        if dz.cang_gan3 is not None:
+            dz.gan3_wu_xing = Configs.config_wuxing[dz.cang_gan3]
+            dz.gan3_shi_shen = Configs.config_shishen[riyuan][dz.cang_gan3]
+
+
+def calc_zhang_shengs(bazi: BaZi):
+    bazi.nian_zhi.zhang_sheng_zhu = Configs.get_value2(Configs.config_zhangsheng, bazi.nian_gan.text,
+                                                       bazi.nian_zhi.text)
+    bazi.nian_zhi.zhang_sheng_ri = Configs.get_value2(Configs.config_zhangsheng, bazi.ri_gan.text, bazi.nian_zhi.text)
+
+    bazi.yue_zhi.zhang_sheng_zhu = Configs.get_value2(Configs.config_zhangsheng, bazi.yue_gan.text,
+                                                      bazi.yue_zhi.text)
+    bazi.yue_zhi.zhang_sheng_ri = Configs.get_value2(Configs.config_zhangsheng, bazi.ri_gan.text, bazi.yue_zhi.text)
+
+    bazi.ri_zhi.zhang_sheng_zhu = Configs.get_value2(Configs.config_zhangsheng, bazi.ri_gan.text,
+                                                     bazi.ri_zhi.text)
+    bazi.ri_zhi.zhang_sheng_ri = Configs.get_value2(Configs.config_zhangsheng, bazi.ri_gan.text, bazi.ri_zhi.text)
+
+    bazi.shi_zhi.zhang_sheng_zhu = Configs.get_value2(Configs.config_zhangsheng, bazi.shi_gan.text,
+                                                      bazi.shi_zhi.text)
+    bazi.shi_zhi.zhang_sheng_ri = Configs.get_value2(Configs.config_zhangsheng, bazi.ri_gan.text, bazi.shi_zhi.text)
+
+
+def calc_gao_nengs(bazi: BaZi):
+    riyuan = bazi.ri_gan.text
+    tgs = bazi.all_tian_gans()
+    for tg1 in tgs:
+        for tg2 in tgs:
+            if tg1.wei_zhi == tg2.wei_zhi:
+                continue
+            CalcGaoNeng.fix_gao_neng(riyuan, tg1, tg2, None)
+
+    dzs = bazi.all_di_zhis()
+    for dz1 in dzs:
+        for dz2 in dzs:
+            for dz3 in dzs:
+                if dz1.wei_zhi == dz2.wei_zhi or dz2.wei_zhi == dz3.wei_zhi or dz1.wei_zhi == dz3.wei_zhi:
+                    continue
+                CalcGaoNeng.fix_gao_neng(riyuan, dz1, dz2, dz3)
+
+    for dz1 in dzs:
+        for dz2 in dzs:
+            if dz1.wei_zhi == dz2.wei_zhi:
+                continue
+            CalcGaoNeng.fix_gao_neng(riyuan, dz1, dz2, None)
+
+
+def calc_counter_and_steps(bazi: BaZi):
+    bazi.counter = PowerCounter()
+    bazi.power_steps = CalcPower.calc_power_step(bazi)
+    # counter分几种,原局、高能、墓库
+    bazi.counter.power_raw = CalcPower.count_wu_xing_shi_shen(bazi)
+    bazi.counter.power_gaoneng = CalcPower.count_diff_of_gaoneng(bazi)
+    bazi.counter.power_muku = CalcPower.count_diff_of_muku(bazi)
+    bazi.counter.power_zihe = CalcPower.count_diff_of_zihe(bazi)
+
+
+def calc_wang_shuai(bazi: BaZi):
+    tong = 0
+    yi = 0
+    for key in bazi.counter.power_raw:
+        value = bazi.counter.power_raw[key]
+        if key in Configs.config_tongdang_list:
+            tong += value
+        if key in Configs.config_yidang_list:
+            yi += value
+    bazi.tong_dang = round(tong, 1)
+    bazi.yi_dang = round(yi, 1)
+
+
+def check_muku(bazi: BaZi):
+    for dz in bazi.all_di_zhis():  # type: SiZhu
+        if dz.text == "无":
+            continue
+        if dz.is_muku:
+            dz.is_muku_open = CheckMuKu.is_muku_open(dz, bazi)
+
+
+def check_shen_sha(bazi: BaZi):
+    CalcShenSha.run(bazi)
+
+
+def calc_da_yun(bazi: BaZi):
+    CalcDaYun.run(bazi)
+
+
+def calc_liu_nian(bazi: BaZi):
+    CalcLiuNian.run(bazi)
+
+
+def calc_liu_yue(bazi: BaZi):
+    CalcLiuYue.run(bazi)
+
+
+def calc_liu_ri(bazi: BaZi):
+    CalcLiuRi.run(bazi)
+
+
+def calc_dayun_gaoneng(bazi):
+    CalcDaYun.calc_gaoneng(bazi)
+
+
+def calc_dayun_shensha(bazi: BaZi):
+    CalcDaYun.calc_shensha(bazi)
+
+
+def calc_liunian_gaoneng(bazi: BaZi):
+    CalcLiuNian.calc_gaonengs(bazi)
+
+
+def calc_liunian_shensha(bazi: BaZi):
+    CalcLiuNian.calc_shensha(bazi)
+
+
+def calc_liuyue_gaoneng(bazi: BaZi):
+    CalcLiuYue.calc_gaoneng(bazi)
+
+
+def calc_liuyue_shensha(bazi: BaZi):
+    CalcLiuYue.calc_shen_sha(bazi)
+
+
+def calc_liuri_gaoneng(bazi: BaZi):
+    CalcLiuRi.calc_gaoneng(bazi)
+
+
+def calc_liuri_shensha(bazi: BaZi):
+    CalcLiuRi.calc_shensha(bazi)
+
+
+def calc_yinyuan(bazi: BaZi):
+    CalcYinYuan.calc_yinyuan(bazi)

+ 164 - 0
yixue/ZhenDuanLogic.py

@@ -0,0 +1,164 @@
+from yixue import Configs
+from yixue.Models import BaZi, PowerQiangRuo
+from yixue.zhenduan import AboutWuXingShiShenZuoZhi, AboutMenHu, AboutShenSha, AboutGeJu, AboutGaoNeng, AboutJianKang, \
+    AboutQingGan, AboutDaYun, AboutYinYuan
+
+wx_per = {}
+ss_per = {}
+qiang_ruo = PowerQiangRuo()
+
+
+def calc_power_percentages(bazi: BaZi):
+    global wx_per, ss_per, qiang_ruo
+    wx_per = __calc_wuxing_power_percentage__(bazi)
+    ss_per = __calc_shishen_power_percentage__(bazi)
+    qiang_ruo = __calc_qiang_ruo__(bazi)
+
+
+def about_wuxing_shishen_zuozhi(bazi: BaZi):
+    AboutWuXingShiShenZuoZhi.about_wuxing(bazi, wx_per)
+    AboutWuXingShiShenZuoZhi.about_shi_shen(bazi, ss_per)
+    AboutWuXingShiShenZuoZhi.about_zuozhi(bazi)
+
+
+def about_menhu(bazi: BaZi):
+    AboutMenHu.run(bazi, qiang_ruo)
+
+
+def about_shen_sha(bazi: BaZi):
+    AboutShenSha.run(bazi)
+
+
+def about_geju(bazi: BaZi):
+    AboutGeJu.run(bazi, ss_per)
+
+
+def about_gaoneng(bazi: BaZi):
+    AboutGaoNeng.run(bazi)
+
+
+def about_jiankang(bazi: BaZi):
+    AboutJianKang.run(bazi, wx_per)
+
+
+def about_qinggan(bazi: BaZi):
+    AboutQingGan.run(bazi, qiang_ruo)
+
+
+def about_dayun(bazi: BaZi):
+    AboutDaYun.run(bazi)
+
+
+def about_yinyuan(bazi: BaZi):
+    AboutYinYuan.run(bazi, wx_per, ss_per)
+
+
+def __calc_wuxing_power_percentage__(bazi: BaZi):
+    total = 0
+    wx_power = {}
+    wx_per = {}
+    for wx in Configs.config_wuxing_list:
+        step = bazi.power_steps[wx]
+        amount = bazi.counter.power_raw[wx]
+        power = step * amount
+        total += power
+        wx_power[wx] = power
+
+    for wx in Configs.config_wuxing_list:
+        wx_per[wx] = round(wx_power[wx] * 100 / total, 0)
+
+    return wx_per
+
+
+def __calc_shishen_power_percentage__(bazi: BaZi):
+    total = 0
+    ss_power = {}
+    ss_per = {}
+    keys = [ss for ss in Configs.config_shishen_list]
+    for key in ["官杀", "财星", "印绶", "食伤", "比劫"]:
+        keys.append(key)
+
+    for key in keys:
+        ss_power[key] = 0
+        ss_per[key] = 0
+
+    for ss in Configs.config_shishen_list:
+        step = bazi.power_steps[ss]
+        amount = bazi.counter.power_raw[ss]
+        power = step * amount
+        total += power
+        ss_power[ss] = power
+        if ss in ["官", "杀"]:
+            ss_power["官杀"] += power
+        elif ss in ["财", "才"]:
+            ss_power["财星"] += power
+        elif ss in ["印", "枭"]:
+            ss_power["印绶"] += power
+        elif ss in ["食", "伤"]:
+            ss_power["食伤"] += power
+        elif ss in ["比", "劫"]:
+            ss_power["比劫"] += power
+
+    for ss in keys:
+        ss_per[ss] = round(ss_power[ss] * 100 / total, 0)
+    return ss_per
+
+
+def __calc_qiang_ruo__(bazi: BaZi):
+    result = PowerQiangRuo()
+    result.mu_ruo = wx_per["木"] <= 10
+    result.huo_ruo = wx_per["火"] <= 10
+    result.tu_ruo = wx_per["土"] <= 10
+    result.jin_ruo = wx_per["金"] <= 10
+    result.shui_ruo = wx_per["水"] <= 10
+    result.mu_wang = wx_per["木"] > 25
+    result.huo_wang = wx_per["火"] > 25
+    result.tu_wang = wx_per["土"] > 25
+    result.jin_wang = wx_per["金"] > 25
+    result.shui_wang = wx_per["水"] > 25
+    result.guan_sha_ruo = ss_per["官杀"] <= 10
+    result.cai_xing_ruo = ss_per["财星"] <= 10
+    result.yin_shou_ruo = ss_per["印绶"] <= 10
+    result.shi_shang_ruo = ss_per["食伤"] <= 10
+    result.bi_jie_ruo = ss_per["比劫"] <= 10
+    result.guan_sha_wang = ss_per["官杀"] > 25
+    result.cai_xing_wang = ss_per["财星"] > 25
+    result.yin_shou_wang = ss_per["印绶"] > 25
+    result.shi_shang_wang = ss_per["食伤"] > 25
+    result.bi_jie_wang = ss_per["比劫"] > 25
+    result.guan_sha_guo_wang = ss_per["官杀"] >= 37.5
+    result.cai_xing_guo_wang = ss_per["财星"] >= 37.5
+
+    if bazi.ri_zhi.wu_xing == "木":
+        result.mu_ruo = False
+        result.mu_wang = True
+    elif bazi.ri_zhi.wu_xing == "火":
+        result.huo_ruo = False
+        result.huo_wang = True
+    elif bazi.ri_zhi.wu_xing == "土":
+        result.tu_ruo = False
+        result.tu_wang = True
+    elif bazi.ri_zhi.wu_xing == "金":
+        result.jin_ruo = False
+        result.jin_wang = True
+    elif bazi.ri_zhi.wu_xing == "水":
+        result.shui_ruo = False
+        result.shui_wang = True
+
+    if bazi.ri_zhi.shi_shen in ["官", "杀"]:
+        result.guan_sha_ruo = False
+        result.guan_sha_wang = True
+    elif bazi.ri_zhi.shi_shen in ["财", "才"]:
+        result.cai_xing_ruo = False
+        result.cai_xing_wang = True
+    elif bazi.ri_zhi.shi_shen in ["印", "枭"]:
+        result.yin_shou_ruo = False
+        result.yin_shou_wang = True
+    elif bazi.ri_zhi.shi_shen in ["食", "伤"]:
+        result.shi_shang_ruo = False
+        result.shi_shang_wang = True
+    elif bazi.ri_zhi.shi_shen in ["比", "劫"]:
+        result.bi_jie_ruo = False
+        result.bi_jie_wang = True
+
+    return result

+ 252 - 0
yixue/geju/CalcXiongJi.py

@@ -0,0 +1,252 @@
+from yixue import Configs
+from yixue.Models import BaZi, XiongJi
+
+
+# 要注意,这里其实有2个概念,一个叫天干地支影响,一个叫格局。
+# 天干地支影响指的是当10天干12地支到来时,对原局、大运、流年等影响,可以用来看哪些年份、月份的利弊。
+# 客户端页面上的天干地支选择指的就是这个,也可以用来看五行应该怎么增补最有利
+# 格局指的是八字的日元影响下,高能关系转换为十神会是什么,这里和原局、大运这些没有关系,只是一种由日元
+# 决定下的八字的适配性。比如乙木日元,一旦遇到辛,必然七杀攻身。乙木日元,比如酉辰合,促成了七杀合正财,这里跟
+# 原局、大运等是否有辰和酉这两个因素没有关系。
+# 格局和力量无关,只和日元有关,格局是否触发看大运流年
+
+def run(bazi: BaZi):
+    bazi.geju_xiongji = {}
+    for ss in Configs.config_shishen_list:
+        bazi.geju_xiongji[ss] = []
+    __check_guan__(bazi)
+    __check_sha__(bazi)
+    __check_yin__(bazi)
+    __check_xiao__(bazi)
+    __check_zheng_cai__(bazi)
+    __check_pian_cai__(bazi)
+    __check_shi_shen__(bazi)
+    __check__jie_cai__(bazi)
+
+
+def __check_guan__(bazi: BaZi):
+    # 检查伤官冲官,劫财冲官,官暗合财,官印相生
+    name1 = "伤官冲官"
+    tip1 = "行事容易越界,冲撞、挑战权威,也善于攻克难关。"
+    __check_gaoneng_in_bazi__(name1, "官", "伤", ["冲", "穿"], bazi, tip1)
+
+    name2 = "劫财冲官"
+    tip2 = "与人合作要注意行事不要越界,也可能涉及动到行业内他人的利益。"
+    __check_gaoneng_in_bazi__(name2, "官", "劫", ["冲", "穿"], bazi, tip2)
+
+    name3 = "暗合财星"
+    tip3 = "要注意行为的正当性,尤其是一些不上台面的交易。"
+    found = __check_gaoneng_in_bazi__(name3, "官", "财", ["暗合"], bazi, tip3)
+    if not found:
+        __check_gaoneng_in_bazi__(name3, "官", "才", ["暗合"], bazi, tip3)
+    name4 = "官印相生"
+    tip4 = "有权有势,容易得名望得地位。"
+    found = __check_gaoneng_in_bazi__(name4, "官", "印", ["合", "暗合"], bazi, tip4)
+    if not found:
+        __check_gaoneng_in_bazi__(name4, "官", "枭", ["合", "暗合"], bazi, tip4)
+    name5 = "官制劫财"
+    tip5 = "保护自身财富不被掠夺,能克制小人。"
+    __check_exist_in_bazi__(name5, "官", "劫", bazi, tip5)
+
+
+def __check_sha__(bazi: BaZi):
+    # 检查七杀冲比肩,七杀合劫财,七杀合伤官,杀印相生
+    name1 = "七杀攻身"
+    tip1 = "容易被诸多事务缠身,压力大,影响健康。"
+    __check_gaoneng_in_bazi__(name1, "杀", "比", ["冲", "合", "穿", "暗合"], bazi, tip1)
+    name2 = "七杀劫财"
+    tip2 = "事务缠身,处处救火。处处都被需要,疲于奔命。"
+    __check_gaoneng_in_bazi__(name2, "杀", "劫", ["合", "暗合"], bazi, tip2)
+    name3 = "七杀伤官"
+    tip3 = "容易挑战超过自己能力的事情。"
+    __check_gaoneng_in_bazi__(name3, "杀", "伤", ["合", "暗合"], bazi, tip3)
+    name4 = "杀印相生"
+    tip4 = "容易得贵人帮助,带来巨大机会。"
+    found = __check_gaoneng_in_bazi__(name4, "杀", "印", ["合", "暗合"], bazi, tip4)
+    if not found:
+        __check_gaoneng_in_bazi__(name4, "杀", "枭", ["合", "暗合"], bazi, tip4)
+
+
+def __check_yin__(bazi: BaZi):
+    # 检查食伤合印,财损印
+    name1 = "食伤合印"
+    tip1 = "学习能力强,并能迅速转化应用,计划的事情都能一步步去实现。"
+    found = __check_gaoneng_in_bazi__(name1, "印", "食", ["合", "暗合"], bazi, tip1)
+    if not found:
+        found = __check_gaoneng_in_bazi__(name1, "印", "伤", ["合", "暗合"], bazi, tip1)
+        if not found:
+            found = __check_gaoneng_in_bazi__(name1, "枭", "食", ["合", "暗合"], bazi, tip1)
+            if not found:
+                __check_gaoneng_in_bazi__(name1, "枭", "伤", ["合", "暗合"], bazi, tip1)
+    name2 = "财小印大"
+    tip2 = "用小的代价想得到大的回报,要成事需要投入更多的精力、资源。印容易让人犯懒,不谋事还好,一旦要谋事,务必投入更多时间精力资源才可成事。"
+    __compile_power__(name2, ["印", "枭"], ["财", "才"], "印", "财", 0.5, bazi, tip2)
+
+    name3 = "印禄相随"
+    tip3 = "容易得贵人相帮,东山再起。"
+    if __has__lu_shen__(bazi):
+        found = __check_exist_in_bazi__(name3, "印", None, bazi, tip3)
+        if not found:
+            __check_exist_in_bazi__(name3, "枭", None, bazi, tip3)
+
+
+def __check_xiao__(bazi: BaZi):
+    # 检查枭神夺食
+    name1 = "枭神夺食"
+    tip1 = "被约束,有口难言,不得志。"
+    __check_exist_in_bazi__(name1, "枭", "食", bazi, tip1)
+
+
+def __check_zheng_cai__(bazi: BaZi):
+    __check_gaoneng_in_bazi__("合官", "财", "官", ["合", "暗合", "冲"], bazi, "名望地位带来财富。")
+    __check_gaoneng_in_bazi__("合杀", "财", "杀", ["合", "暗合", "冲"], bazi, "社会资源带来财富。")
+    __check_gaoneng_in_bazi__("合印", "财", "印", ["合", "暗合", "冲"], bazi, "贵人事业带来财富。")
+    __check_gaoneng_in_bazi__("合枭", "财", "枭", ["合", "暗合", "冲"], bazi, "贵人事业带来财富。")
+    __check_gaoneng_in_bazi__("合食", "财", "食", ["合", "暗合", "冲"], bazi, "知识技能带来财富。")
+    __check_gaoneng_in_bazi__("合伤", "财", "伤", ["合", "暗合", "冲"], bazi, "知识技能带来财富。")
+    __check_gaoneng_in_bazi__("合比", "财", "比", ["合", "暗合", "冲"], bazi, "朋友协作带来财富。")
+    __check_gaoneng_in_bazi__("合劫", "财", "劫", ["合", "暗合", "冲"], bazi, "朋友协作带来财富。")
+
+
+def __check_pian_cai__(bazi: BaZi):
+    __check_gaoneng_in_bazi__("合官", "才", "官", ["合", "暗合", "冲"], bazi, "名望地位带来财富。")
+    __check_gaoneng_in_bazi__("合杀", "才", "杀", ["合", "暗合", "冲"], bazi, "社会资源带来财富。")
+    __check_gaoneng_in_bazi__("合印", "才", "印", ["合", "暗合", "冲"], bazi, "贵人事业带来财富。")
+    __check_gaoneng_in_bazi__("合枭", "才", "枭", ["合", "暗合", "冲"], bazi, "贵人事业带来财富。")
+    __check_gaoneng_in_bazi__("合食", "才", "食", ["合", "暗合", "冲"], bazi, "知识技能带来财富。")
+    __check_gaoneng_in_bazi__("合伤", "才", "伤", ["合", "暗合", "冲"], bazi, "知识技能带来财富。")
+    __check_gaoneng_in_bazi__("合比", "才", "比", ["合", "暗合", "冲"], bazi, "朋友协作带来财富。")
+    __check_gaoneng_in_bazi__("合劫", "才", "劫", ["合", "暗合", "冲"], bazi, "朋友协作带来财富。")
+
+
+def __check_shi_shen__(bazi: BaZi):
+    __check_exist_in_bazi__("食神制杀", "食", "杀", bazi, "能保护自身,避开小人。")
+
+
+def __check__jie_cai__(bazi: BaZi):
+    found = __check_exist_in_bazi__("劫财见财", "劫", "财", bazi, "财富容易被掠夺。")
+    if not found:
+        __check_exist_in_bazi__("劫财见财", "劫", "才", bazi, "财富容易被掠夺。")
+
+
+def __compile_power__(name: str, shishenBiggers: [str], shishenLowers: [str], key1: str, key2: str, percentage: float,
+                      bazi: BaZi, tip: str):
+    p1 = 0
+    for ss in shishenBiggers:
+        step = bazi.power_steps[ss]
+        value = bazi.counter.power_raw[ss]
+        p1 += step * value
+
+    p2 = 0
+    for ss in shishenLowers:
+        step = bazi.power_steps[ss]
+        value = bazi.counter.power_raw[ss]
+        p2 += step * value
+
+    if p1 * percentage > p2:
+        xj = XiongJi()
+        xj.name = name
+        xj.arg1 = key1
+        xj.arg2 = key2
+        xj.guanxi = ""
+        xj.tip = tip
+        bazi.geju_xiongji[key1].append(xj)
+
+
+def __has__lu_shen__(bazi: BaZi):
+    found = False
+    for dz in bazi.all_di_zhis():
+        if "禄神" in dz.shenshas:
+            found = True
+            break
+        elif "半禄" in dz.shenshas:
+            found = True
+            break
+    return found
+
+
+def __check_exist_in_bazi__(name: str, key1: str, key2: str, bazi: BaZi, tip: str):
+    ary1 = bazi.shishen_guanxi[key1]
+    has1 = False
+    for item1 in ary1:
+        if __is_in_bazi__(item1, bazi):
+            has1 = True
+        if has1:
+            break
+
+    has2 = False
+    if key2 is None:
+        has2 = True
+    else:
+        ary2 = bazi.shishen_guanxi[key2]
+        for item2 in ary2:
+            if __is_in_bazi__(item2, bazi):
+                has2 = True
+            if has2:
+                break
+
+    if has1 and has2:
+        xj = XiongJi()
+        xj.name = name
+        xj.arg1 = key1
+        xj.arg2 = key2
+        xj.guanxi = ""
+        xj.tip = tip
+        bazi.geju_xiongji[key1].append(xj)
+    return has1 and has2
+
+
+def __build_unfound_bean__(name: str, key: str, tip: str, bazi: BaZi):
+    xj = XiongJi()
+    xj.name = name
+    xj.found = False
+    xj.tip = tip
+    bazi.geju_xiongji[key].append(xj)
+
+
+def __check_gaoneng_in_bazi__(name: str, key1: str, key2: str, guanxis: [str], bazi: BaZi, tip: str):
+    ary1 = bazi.shishen_guanxi[key1]
+    ary2 = bazi.shishen_guanxi[key2]
+    found = False
+    for item1 in ary1:
+        for item2 in ary2:
+            key = item1 + item2
+            if Configs.config_gaoneng_query.__contains__(key):
+                gns = Configs.config_gaoneng_query[key]
+                for gn in gns:
+                    if gn["guanxi"] in guanxis:
+                        xj = XiongJi()
+                        xj.name = name
+                        xj.arg1 = key1
+                        xj.arg2 = key2
+                        xj.guanxi = gn["guanxi"]
+                        xj.tip = tip
+                        xj.found = True
+                        bazi.geju_xiongji[key1].append(xj)
+                        found = True
+                        break
+            if found:
+                break
+        if found:
+            break
+    return found
+
+
+def __is_in_bazi__(key: str, bazi: BaZi):
+    if bazi.nian_gan.text == key:
+        return True
+    if bazi.nian_zhi.text == key:
+        return True
+    if bazi.yue_gan.text == key:
+        return True
+    if bazi.yue_zhi.text == key:
+        return True
+    if bazi.ri_gan.text == key:
+        return True
+    if bazi.ri_zhi.text == key:
+        return True
+    if bazi.shi_gan.text == key:
+        return True
+    if bazi.shi_zhi.text == key:
+        return True
+    return False

+ 21 - 0
yixue/other/CalcNongLi.py

@@ -0,0 +1,21 @@
+import datetime
+
+from wx.dbTools import DBNongLi
+
+nongli_days = ["初一", "初二", "初三", "初四", "初五", "初六", "初七", "初八", "初九", "初十",
+               "十一", "十二", "十三", "十四", "十五", "十六", "十七", "十八", "十九", "廿十",
+               "廿一", "廿二", "廿三", "廿四", "廿五", "廿六", "廿七", "廿八", "廿九", "三十"]
+
+
+def run(year: int, month: str, day: str):
+    dt = DBNongLi.query_first_by(year=year, month=month)
+    if dt is not None:
+        try:
+            cur_index = nongli_days.index(day)
+            start_date = dt.new_date
+            delta = datetime.timedelta(days=cur_index)
+            new_date = start_date + delta
+            return new_date
+        except Exception as e:
+            print(e)
+    return None

+ 250 - 0
yixue/sizhu/CalcDaYun.py

@@ -0,0 +1,250 @@
+import datetime
+import math
+
+from wx.dbTools import DBDaYunNan, DBDaYunNv
+from yixue import Configs
+from yixue.Models import BaZi, DaYun, SiZhu
+from yixue.sizhu import CalcGaoNeng, CalcShenSha
+
+
+def run(bazi: BaZi):
+    qiyun_date = __calc_qi_yun__(bazi.is_man, bazi.tai_yang_shi)
+    print("起运时间:", qiyun_date)
+    if qiyun_date is not None:
+        dayun_orders = __order_dayun__(bazi)
+        __build_dayuns__(bazi, qiyun_date, dayun_orders)
+    else:
+        bazi.dayun = []
+
+
+def calc_gaoneng(bazi: BaZi):
+    tgs = bazi.all_tian_gans()
+    dzs = bazi.all_di_zhis()
+    riyuan = bazi.ri_gan.text
+    for dy in bazi.dayun:
+        if not dy.is_dayun:
+            continue
+
+        # check tian gan
+        for tg in tgs:
+            CalcGaoNeng.fix_gao_neng(riyuan, dy.gan_zhu, tg, None)
+            CalcGaoNeng.fix_gao_neng(riyuan, tg, dy.gan_zhu, None, dy.trigger)
+
+        for dz1 in dzs:
+            for dz2 in dzs:
+                if dz1.wei_zhi == dz2.wei_zhi:
+                    continue
+                CalcGaoNeng.fix_gao_neng(riyuan, dy.zhi_zhu, dz1, dz2)
+                CalcGaoNeng.fix_gao_neng(riyuan, dz1, dz2, dy.zhi_zhu, dy.trigger)
+                CalcGaoNeng.fix_gao_neng(riyuan, dz2, dy.zhi_zhu, dz1, dy.trigger)
+
+        for dz in dzs:
+            CalcGaoNeng.fix_gao_neng(riyuan, dy.zhi_zhu, dz, None)
+            CalcGaoNeng.fix_gao_neng(riyuan, dz, dy.zhi_zhu, None, dy.trigger)
+
+
+def calc_shensha(bazi: BaZi):
+    riyuan = bazi.ri_gan.text
+    for dy in bazi.dayun:
+        if not dy.is_dayun:
+            continue
+
+        CalcShenSha.__check_lu_shen__(dy.zhi_zhu, riyuan)
+        CalcShenSha.__check_yang_ren__(dy.zhi_zhu, riyuan)
+        CalcShenSha.__check_wen_chang__(dy.gan_zhu, dy.zhi_zhu)
+        CalcShenSha.__check_kui_gang__(dy.gan_zhu, dy.zhi_zhu)
+        CalcShenSha.__check_yi_ma__(bazi.nian_zhi, bazi.ri_zhi, [dy.zhi_zhu])
+        CalcShenSha.__check_tianluo_diwang__(bazi.nian_zhi, bazi.ri_zhi, [dy.zhi_zhu])
+        CalcShenSha.__check_tao_hua__(bazi.nian_zhi, bazi.ri_zhi, [dy.zhi_zhu])
+
+
+def __create_temp_sizhu__(text: str, riyuan: str, weizhi: int):
+    sz = SiZhu(text, weizhi)
+    sz.wu_xing = Configs.get_value(Configs.config_wuxing, text)
+    sz.shi_shen = Configs.get_value2(Configs.config_shishen, riyuan, text)
+    return sz
+
+
+def __calc_qi_yun__(is_man: bool, tai_yang_shi: datetime):
+    if tai_yang_shi is None:  # 未知时辰的时候,太阳时是没有的
+        return
+    # tai_yang_shi = datetime.datetime(1910, 6, 20, 13, 40, 0)
+    # is_man = False
+    table = DBDaYunNan
+    if not is_man:
+        table = DBDaYunNv
+
+    ss = table.new_session()
+    dt = ss.query(table).filter(table.sign is not None, table.time < tai_yang_shi).order_by(
+        table.time.desc()).first()
+    # print("最近的参考时间:", dt)
+    result = None
+    if dt is not None:
+        # 这里有两个概念,一个是起运时间(qi_yun),一个是现实时间(real)
+        # 起运时间是几个整数组成的,包括年、月、日、时,它不代表一个具体的时间,只是时间差的一种标记
+        # 起运时间是24时=1日,30日=1月,12月=1年
+        # 起运值 = ((起运年 *12 + 起运月) * 30 + 起运日) * 24 + 起运时
+        # 现实时间过1分钟,大运时间差2小时(可能加,可能减,看符号)
+        # 比如:现实时间 00:29,对应大运时间是 2天6时;现实时间00:30,对应大运时间是2天4时(举个例子)
+
+        if dt.sign == "-":
+            # 如果符号是-,就以当前参考值的时间为基准,计算两者时间差,并换算成分钟(/60)
+            real_min_diff = math.trunc((tai_yang_shi - dt.time).total_seconds() / 60)
+            qiyun_min_diff = real_min_diff * 2  # 换算成大运的差异,要乘以2
+            # 把数据库中提取的参考时间,换算成起运总值,符号是-的话,是以这个数值为基准开始减
+            qiyun_value = ((dt.year * 12 + dt.month) * 30 + dt.day) * 24 + dt.hour
+            # 两个基于相同纬度的值差,就是目标日期和参考日期的起运值差异
+            qiyun_diff = abs(qiyun_min_diff - qiyun_value)
+            # 把总的起运值差异,换算成年、月、日、时
+            result = __calc_qiyun_date__(qiyun_diff)
+            # print("起运:", result)
+        elif dt.sign == "+":
+            # 如果符号是-,就以当前参考值的时间为基准,计算两者时间差,并换算成分钟(/60)
+            real_min_diff = math.trunc((tai_yang_shi - dt.time).total_seconds() / 60)
+            qiyun_min_diff = real_min_diff * 2  # 换算成大运的差异,要乘以2
+            # 把数据库中提取的参考时间,换算成起运总值,符号是+的话,是以这个数值为基准开始加
+            qiyun_value = ((dt.year * 12 + dt.month) * 30 + dt.day) * 24 + dt.hour
+            # 两个基于相同纬度的值差,就是目标日期和参考日期的起运值差异
+            qiyun_diff = abs(qiyun_min_diff - qiyun_value)
+            # 把总的起运值差异,换算成年、月、日、时
+            result = __calc_qiyun_date__(qiyun_diff)
+            # print("起运:", result)
+    else:
+        print("__calc_qi_yun__,未找到合适的参考时间:", tai_yang_shi)
+    ss.close()
+    return result
+
+
+def __calc_qiyun_date__(total: int):
+    year_cost = 8640
+    month_cost = 720
+    day_cost = 24
+
+    year = math.trunc(total / year_cost)
+    remain = total - year * year_cost
+    month = math.trunc(remain / month_cost)
+    remain = remain - month * month_cost
+    day = math.trunc(remain / day_cost)
+    remain = remain - day * day_cost
+    hour = remain
+    return [year, month, day, hour]
+
+
+def __order_dayun__(bazi: BaZi):
+    # 排10个大运,大运排法看年干定阴阳,再看性别
+    # 以月干为基准,阳男阴女顺排,阴男阳女逆排
+    gan = bazi.yue_gan.text
+    zhi = bazi.yue_zhi.text
+
+    is_man = bazi.is_man
+    yin_yang = bazi.nian_gan.yin_yang
+
+    dayun = []
+    step = 1
+    if is_man:
+        if yin_yang == "阳":
+            step = 1
+        else:
+            step = -1
+    else:
+        if yin_yang == "阳":
+            step = -1
+        else:
+            step = 1
+
+    for index in range(0, 10):
+        gan = __next_tiangan__(gan, step)
+        zhi = __next_dizhi__(zhi, step)
+        dayun.append([gan, zhi])
+    return dayun
+
+
+def __build_dayuns__(bazi: BaZi, qiyun_date: [int], dayun_orders: [str]):
+    # 把起运数据换算成天
+    days = (qiyun_date[0] * 12 + qiyun_date[1]) * 30
+    new_date: datetime.datetime = datetime.timedelta(days=days) + bazi.tai_yang_shi
+    qiyun_year = new_date.year
+    qiyun_age = new_date.year - bazi.tai_yang_shi.year + 1
+
+    bazi.dayun = []
+    # 处理小运
+    xiaoyun = DaYun()
+    xiaoyun.is_dayun = False
+    xiaoyun.gan_text = "小"
+    xiaoyun.zhi_text = "运"
+    xiaoyun.start_age = 1
+    xiaoyun.end_age = qiyun_age - 1
+    xiaoyun.start_year = bazi.tai_yang_shi.year
+    xiaoyun.end_year = qiyun_year - 1
+    xiaoyun.gan_zhu = SiZhu("小", Configs.const_dayun_gan)
+    xiaoyun.zhi_zhu = SiZhu("运", Configs.const_dayun_zhi)
+    xiaoyun.gan_zhu.dayun_text = "小运"
+    xiaoyun.zhi_zhu.dayun_text = "小运"
+    xiaoyun.trigger = xiaoyun.gan_text + xiaoyun.zhi_text
+
+    bazi.dayun.append(xiaoyun)
+
+    # 处理大运
+    riyuan = bazi.ri_gan.text
+    lu_shen: str = Configs.get_value2(Configs.config_lushen, bazi.ri_gan.text, "禄神")
+    ban_lu: [str] = Configs.get_value2(Configs.config_lushen, bazi.ri_gan.text, "半禄")
+    for (index, dy) in enumerate(dayun_orders):
+        dayun = DaYun()
+        dayun.is_dayun = True
+        dayun.gan_text = dy[0]
+        dayun.zhi_text = dy[1]
+        dayun.trigger = dayun.gan_text + dayun.zhi_text
+        dayun.start_age = qiyun_age + index * 10
+        dayun.end_age = dayun.start_age + 10 - 1
+        dayun.start_year = qiyun_year + index * 10
+        dayun.end_year = dayun.start_year + 10 - 1
+
+        gan = SiZhu(dy[0], Configs.const_dayun_gan)
+        __fill_sizhu_data(gan, riyuan, False)
+        zhi = SiZhu(dy[1], Configs.const_dayun_zhi)
+        __fill_sizhu_data(zhi, riyuan, True)
+        dayun.gan_zhu = gan
+        dayun.zhi_zhu = zhi
+        dayun.gan_zhu.dayun_text = dayun.gan_text + dayun.zhi_text
+        dayun.zhi_zhu.dayun_text = dayun.gan_text + dayun.zhi_text
+
+        bazi.dayun.append(dayun)
+
+
+def __fill_sizhu_data(sz: SiZhu, riyuan: str, is_dizhi: bool):
+    sz.wu_xing = Configs.get_value(Configs.config_wuxing, sz.text)
+    sz.shi_shen = Configs.get_value2(Configs.config_shishen, riyuan, sz.text)
+    if is_dizhi:
+        cang_gan = Configs.get_value(Configs.config_canggan, sz.text)
+        sz.cang_gan1 = cang_gan[0]
+        sz.cang_gan2 = cang_gan[1]
+        sz.cang_gan3 = cang_gan[2]
+        if sz.cang_gan1 is not None:
+            sz.gan1_wu_xing = Configs.get_value(Configs.config_wuxing, sz.cang_gan1)
+            sz.gan1_shi_shen = Configs.get_value2(Configs.config_shishen, riyuan, sz.cang_gan1)
+        if sz.cang_gan2 is not None:
+            sz.gan2_wu_xing = Configs.get_value(Configs.config_wuxing, sz.cang_gan2)
+            sz.gan2_shi_shen = Configs.get_value2(Configs.config_shishen, riyuan, sz.cang_gan2)
+        if sz.cang_gan3 is not None:
+            sz.gan3_wu_xing = Configs.get_value(Configs.config_wuxing, sz.cang_gan3)
+            sz.gan3_shi_shen = Configs.get_value2(Configs.config_shishen, riyuan, sz.cang_gan3)
+
+
+def __get_next_by_dist__(ary: [str], item: str, dist: int):
+    result = None
+    if ary.__contains__(item):
+        index = ary.index(item)
+        index += dist
+        ln = len(ary)
+        while index >= ln:
+            index -= ln
+        result = ary[index]
+    return result
+
+
+def __next_tiangan__(tiangan: str, dist: int):
+    return __get_next_by_dist__(Configs.config_tiangan_list, tiangan, dist)
+
+
+def __next_dizhi__(dizhi: str, dist: int):
+    return __get_next_by_dist__(Configs.config_dizhi_list, dizhi, dist)

+ 79 - 0
yixue/sizhu/CalcGaoNeng.py

@@ -0,0 +1,79 @@
+from yixue import Configs
+from yixue.Models import SiZhu, GaoNeng
+
+
+def __calc__fang_xiang__(gn: GaoNeng, zhu: SiZhu):
+    if gn.guanxi in ["合", "暗合", "半合"]:
+        if zhu.text == gn.fangxiang:
+            gn.sign = ""
+        else:
+            if gn.wei_zhi3 is None:
+                if zhu.wei_zhi < gn.wei_zhi2:
+                    gn.sign = "→"
+                else:
+                    gn.sign = "←"
+            else:
+                wz = gn.wei_zhi2
+                if gn.fangxiang == gn.arg3:
+                    wz = gn.wei_zhi3
+                if zhu.wei_zhi < wz:
+                    gn.sign = "→"
+                else:
+                    gn.sign = "←"
+
+
+def fix_gao_neng(riyuan: str, zhu1: SiZhu, zhu2: SiZhu, zhu3: SiZhu, trigger: str = None):
+    key = zhu1.text + zhu2.text
+    if zhu3 is not None:
+        key += zhu3.text
+    try:
+        if Configs.config_gaoneng_query.__contains__(key):
+            infos = Configs.config_gaoneng_query[key]
+            for info in infos:
+                gn = GaoNeng()
+                gn.arg1 = zhu1.text
+                gn.arg2 = zhu2.text
+                gn.wei_zhi1 = zhu1.wei_zhi
+                gn.wei_zhi2 = zhu2.wei_zhi
+                gn.wu_xing1 = zhu1.wu_xing
+                gn.wu_xing2 = zhu2.wu_xing
+                gn.shi_shen1 = zhu1.shi_shen
+                gn.shi_shen2 = zhu2.shi_shen
+
+                if zhu3 is not None:
+                    gn.arg3 = zhu3.text
+                    gn.wei_zhi3 = zhu3.wei_zhi
+                    gn.wu_xing3 = zhu3.wu_xing
+                    gn.shi_shen3 = zhu3.shi_shen
+                gn.text = info["name"]
+                gn.guanxi = info["guanxi"]
+                gn.leibie = info["leibie"]
+                gn.hehua = info["hehua"]
+                gn.fangxiang = info["fangxiang"]
+                if gn.guanxi in ["半合", "拱合", "三会"]:
+                    gn.zengqiang_shishen = Configs.config_shishen[riyuan][gn.fangxiang]
+                if gn.guanxi == "刑":
+                    xing = Configs.get_value(Configs.config_gaoneng_xing, gn.text)
+                    if xing is not None:
+                        chus = xing["刑出"]
+                        chongs = xing["刑冲"]
+                        gn.xing_chu = ""
+                        for chu in chus:
+                            xing_shi_shen = Configs.get_value2(Configs.config_shishen, riyuan, chu)
+                            gn.xing_chu += xing_shi_shen
+                        gn.xing_chong = ""
+                        for chong in chongs:
+                            chong_shi_shen1 = Configs.get_value2(Configs.config_shishen, riyuan, chong[0])
+                            chong_shi_shen2 = Configs.get_value2(Configs.config_shishen, riyuan, chong[1])
+                            gn.xing_chong += chong_shi_shen1 + chong_shi_shen2 + "冲"
+                gn.tip = info["tip"]
+                __calc__fang_xiang__(gn, zhu1)
+                if trigger is None:
+                    zhu1.gaonengs.append(gn)
+                else:
+                    if not zhu1.trigger_gaonengs.__contains__(trigger):
+                        zhu1.trigger_gaonengs[trigger] = []
+                    lst = zhu1.trigger_gaonengs[trigger]
+                    lst.append(gn)
+    except Exception as e:
+        print("error on :CalcGaoNeng.fix_gao_neng", e)

+ 157 - 0
yixue/sizhu/CalcLiuNian.py

@@ -0,0 +1,157 @@
+from yixue import Configs
+from yixue.Models import BaZi, DaYun, LiuNian, SiZhu
+from yixue.sizhu import CalcGaoNeng, CalcShenSha
+
+
+def run(bazi: BaZi):
+    for dy in bazi.dayun:
+        __calc_liu_nian__(dy, bazi)
+
+
+def calc_gaonengs(bazi: BaZi):
+    tgs = bazi.all_tian_gans()
+    dzs = bazi.all_di_zhis()
+    riyuan = bazi.ri_gan.text
+    for dayun in bazi.dayun:
+        for ln in dayun.liunian:
+
+            # 流年天干 vs 原局天干
+            for tg in tgs:
+                CalcGaoNeng.fix_gao_neng(riyuan, ln.gan_zhu, tg, None)
+                CalcGaoNeng.fix_gao_neng(riyuan, tg, ln.gan_zhu, None, ln.trigger)
+
+            # 流年地支 vs 原局地支 3
+            for dz1 in dzs:
+                for dz2 in dzs:
+                    if dz1.wei_zhi == dz2.wei_zhi:
+                        continue
+                    CalcGaoNeng.fix_gao_neng(riyuan, ln.zhi_zhu, dz1, dz2, )
+                    CalcGaoNeng.fix_gao_neng(riyuan, dz1, dz2, ln.zhi_zhu, ln.trigger)
+                    CalcGaoNeng.fix_gao_neng(riyuan, dz2, ln.zhi_zhu, dz1, ln.trigger)
+
+            # 流年地支 vs 原局地支 2
+            for dz in dzs:
+                CalcGaoNeng.fix_gao_neng(riyuan, ln.zhi_zhu, dz, None)
+                CalcGaoNeng.fix_gao_neng(riyuan, dz, ln.zhi_zhu, None, ln.trigger)
+
+            # 流年如果来自大运,还要和大运再做一次比对
+            if ln.from_dayun:
+                other_tgs = [dayun.gan_zhu]
+                other_dzs = [dayun.zhi_zhu]
+
+                # 流年天干 vs 大运天干
+                for tg in other_tgs:
+                    CalcGaoNeng.fix_gao_neng(riyuan, ln.gan_zhu, tg, None)
+                    CalcGaoNeng.fix_gao_neng(riyuan, tg, ln.gan_zhu, None, ln.trigger)
+
+                # 流年地支 vs 大运地支 3
+                for dz1 in other_dzs:
+                    for dz2 in dzs:
+                        CalcGaoNeng.fix_gao_neng(riyuan, ln.zhi_zhu, dz1, dz2)
+                        CalcGaoNeng.fix_gao_neng(riyuan, dz1, dz2, ln.zhi_zhu, ln.trigger)
+                        CalcGaoNeng.fix_gao_neng(riyuan, dz2, ln.zhi_zhu, dz1, ln.trigger)
+
+                # 流年地支 vs 大运地支 2
+                for dz in other_dzs:
+                    CalcGaoNeng.fix_gao_neng(riyuan, ln.zhi_zhu, dz, None)
+                    CalcGaoNeng.fix_gao_neng(riyuan, dz, ln.zhi_zhu, None, ln.trigger)
+
+
+def calc_shensha(bazi: BaZi):
+    riyuan = bazi.ri_gan.text
+    for dayun in bazi.dayun:
+        for ln in dayun.liunian:
+            CalcShenSha.__check_lu_shen__(ln.zhi_zhu, riyuan)
+            CalcShenSha.__check_yang_ren__(ln.zhi_zhu, riyuan)
+            CalcShenSha.__check_wen_chang__(ln.gan_zhu, ln.zhi_zhu)
+            CalcShenSha.__check_kui_gang__(ln.gan_zhu, ln.zhi_zhu)
+            CalcShenSha.__check_yi_ma__(bazi.nian_zhi, bazi.ri_zhi, [ln.zhi_zhu])
+            CalcShenSha.__check_tianluo_diwang__(bazi.nian_zhi, bazi.ri_zhi, [ln.zhi_zhu])
+            CalcShenSha.__check_tao_hua__(bazi.nian_zhi, bazi.ri_zhi, [ln.zhi_zhu])
+
+
+def __calc_liu_nian__(dayun: DaYun, bazi: BaZi):
+    index = 0
+    riyuan = bazi.ri_gan.text
+    from_gan = bazi.nian_gan.text
+    from_zhi = bazi.nian_zhi.text
+
+    # 要判断过没过除夕,没过除夕的话,干支要倒退一位
+    # from 干支是从数据库提取的,如果没过除夕,其实对应的是上一年的干支
+    # 而出生年 start_year 又是指的当年,所以这种情况下干支会落后一个位,所以要往前移动一位
+    go_next = False
+    jie_qi = Configs.get_jie_qi(bazi.tai_yang_shi.year, "除夕")
+    if jie_qi is not None:
+        if bazi.tai_yang_shi.month < jie_qi[0]:
+            go_next = True
+        elif bazi.tai_yang_shi.month == jie_qi[0]:
+            if bazi.tai_yang_shi.day < jie_qi[1]:
+                go_next = True
+
+    if go_next:
+        from_gan = __next_tiangan__(from_gan, 1)
+        from_zhi = __next_dizhi__(from_zhi, 1)
+
+    dayun.liunian = []
+    for year in range(dayun.start_year, dayun.end_year + 1):
+        dist = year - bazi.tai_yang_shi.year
+        ln = LiuNian()
+        ln.year = year
+        ln.from_dayun = dayun.is_dayun
+        ln.age = dayun.start_age + index
+        ln.gan_text = __next_tiangan__(from_gan, dist)
+        ln.zhi_text = __next_dizhi__(from_zhi, dist)
+        ln.trigger = dayun.gan_text + dayun.zhi_text + ln.gan_text + ln.zhi_text
+
+        gan = SiZhu(ln.gan_text, Configs.const_liunian_gan)
+        __fill_sizhu_data(gan, riyuan, False)
+        zhi = SiZhu(ln.zhi_text, Configs.const_liunian_zhi)
+        __fill_sizhu_data(zhi, riyuan, True)
+        ln.gan_zhu = gan
+        ln.zhi_zhu = zhi
+        ln.gan_zhu.liunian_text = ln.gan_text + ln.zhi_text
+        ln.zhi_zhu.liunian_text = ln.gan_text + ln.zhi_text
+        ln.gan_zhu.dayun_text = dayun.gan_text + dayun.zhi_text
+        ln.zhi_zhu.dayun_text = dayun.gan_text + dayun.zhi_text
+        index += 1
+
+        dayun.liunian.append(ln)
+
+
+def __fill_sizhu_data(sz: SiZhu, riyuan: str, is_dizhi: bool):
+    sz.wu_xing = Configs.get_value(Configs.config_wuxing, sz.text)
+    sz.shi_shen = Configs.get_value2(Configs.config_shishen, riyuan, sz.text)
+    if is_dizhi:
+        cang_gan = Configs.get_value(Configs.config_canggan, sz.text)
+        sz.cang_gan1 = cang_gan[0]
+        sz.cang_gan2 = cang_gan[1]
+        sz.cang_gan3 = cang_gan[2]
+        if sz.cang_gan1 is not None:
+            sz.gan1_wu_xing = Configs.get_value(Configs.config_wuxing, sz.cang_gan1)
+            sz.gan1_shi_shen = Configs.get_value2(Configs.config_shishen, riyuan, sz.cang_gan1)
+        if sz.cang_gan2 is not None:
+            sz.gan2_wu_xing = Configs.get_value(Configs.config_wuxing, sz.cang_gan2)
+            sz.gan2_shi_shen = Configs.get_value2(Configs.config_shishen, riyuan, sz.cang_gan2)
+        if sz.cang_gan3 is not None:
+            sz.gan3_wu_xing = Configs.get_value(Configs.config_wuxing, sz.cang_gan3)
+            sz.gan3_shi_shen = Configs.get_value2(Configs.config_shishen, riyuan, sz.cang_gan3)
+
+
+def __get_next_by_dist__(ary: [str], item: str, dist: int):
+    result = None
+    if ary.__contains__(item):
+        index = ary.index(item)
+        index += dist
+        ln = len(ary)
+        while index >= ln:
+            index -= ln
+        result = ary[index]
+    return result
+
+
+def __next_tiangan__(tiangan: str, dist: int):
+    return __get_next_by_dist__(Configs.config_tiangan_list, tiangan, dist)
+
+
+def __next_dizhi__(dizhi: str, dist: int):
+    return __get_next_by_dist__(Configs.config_dizhi_list, dizhi, dist)

+ 215 - 0
yixue/sizhu/CalcLiuRi.py

@@ -0,0 +1,215 @@
+import calendar
+import datetime
+
+from wx.dbTools import DBNongLi
+from yixue import Configs
+from yixue.Models import BaZi, LiuRi, SiZhu
+from yixue.sizhu import CalcShenSha, CalcGaoNeng
+
+
+def run(bazi: BaZi):
+    riyuan = bazi.ri_gan.text
+    for dayun in bazi.dayun:
+        for liunian in dayun.liunian:
+            start_date = datetime.datetime(year=liunian.year, month=1, day=1)
+            start_gan_zhi = __get_start_gan_zhi_of_day__(liunian.year)
+            if start_gan_zhi is None:
+                continue
+
+            for liuyue in liunian.liuyue:
+                dt = calendar.monthrange(liunian.year, liuyue.month)
+                max_day = dt[1]
+                liuyue.liuri = []
+                for day in range(1, max_day + 1):
+                    end_date = datetime.datetime(year=liunian.year, month=liuyue.month, day=day)
+                    dist = (end_date - start_date).days
+
+                    lr = LiuRi()
+                    lr.day = day
+                    lr.nong_li = ""
+                    lr.xing_qi = end_date.weekday()
+                    lr.gan_text = __next_tiangan__(start_gan_zhi[0], dist)
+                    lr.zhi_text = __next_dizhi__(start_gan_zhi[1], dist)
+                    lr.trigger = dayun.gan_text + dayun.zhi_text + liunian.gan_text + liunian.zhi_text + liuyue.gan_text + liuyue.zhi_text + lr.gan_text + lr.zhi_text
+                    lr.gan_zhu = SiZhu(lr.gan_text, Configs.const_liuri_gan)
+                    lr.zhi_zhu = SiZhu(lr.zhi_text, Configs.const_liuri_zhi)
+                    lr.gan_zhu.liuri_text = lr.gan_text + lr.zhi_text
+                    lr.zhi_zhu.liuri_text = lr.gan_text + lr.zhi_text
+                    lr.gan_zhu.dayun_text = dayun.gan_text + dayun.zhi_text
+                    lr.zhi_zhu.dayun_text = dayun.gan_text + dayun.zhi_text
+                    lr.gan_zhu.liunian_text = liunian.gan_text + liunian.zhi_text
+                    lr.zhi_zhu.liunian_text = liunian.gan_text + liunian.zhi_text
+                    lr.gan_zhu.liuyue_text = liuyue.gan_text + liuyue.zhi_text
+                    lr.zhi_zhu.liuyue_text = liuyue.gan_text + liuyue.zhi_text
+                    __fill_sizhu_data(lr.gan_zhu, riyuan, False)
+                    __fill_sizhu_data(lr.zhi_zhu, riyuan, True)
+                    liuyue.liuri.append(lr)
+
+
+def __print_nong_li_data__():
+    ss = DBNongLi.new_session()
+    data = ss.query(DBNongLi).filter(DBNongLi.day == "初一")
+    temp = {}
+    for dt in data:
+        year = dt.new_date.year
+        month = dt.new_date.month
+        day = dt.new_date.day
+        obj = {
+            "year": year,
+            "month": month,
+            "day": day,
+            "nl_yue": dt.month,
+            "nl_ri": dt.day,
+            "real_year": dt.year
+        }
+
+        if not temp.__contains__(year):
+            temp[year] = {}
+        year_obj = temp[year]
+
+        if not year_obj.__contains__(month):
+            year_obj[month] = {}
+        month_obj = year_obj[month]
+        if year == dt.year:
+            month_obj[day] = obj
+        elif year < dt.year:
+            if not temp[year - 1].__contains__(month):
+                temp[year - 1] = {}
+            year_obj = temp[year - 1]
+
+            if not year_obj.__contains__(month):
+                year_obj[month] = {}
+            month_obj[day] = obj
+
+    # print(temp)
+    for year in temp.keys():
+        year_obj = temp[year]
+        print(year, ":{")
+        for month in year_obj.keys():
+            month_obj = year_obj[month]
+            print("   ", month, ":{")
+            for day in month_obj.keys():
+                day_obj = month_obj[day]
+                print("       ", day, ":", day_obj, ",")
+            print("    },")
+
+        print("},")
+
+    ss.close()
+
+
+def calc_gaoneng(bazi: BaZi):
+    # 这边运算太久了,放本地去算,选了才计算
+    return
+    tgs = bazi.all_tian_gans()
+    dzs = bazi.all_di_zhis()
+    riyuan = bazi.ri_gan.text
+    for dayun in bazi.dayun:
+        for liunian in dayun.liunian:
+            for liuyue in liunian.liuyue:
+                for lr in liuyue.liuri:
+
+                    # 流日天干 vs 原局天干
+                    for tg in tgs:
+                        CalcGaoNeng.fix_gao_neng(riyuan, lr.gan_zhu, tg, None)
+                        CalcGaoNeng.fix_gao_neng(riyuan, tg, lr.gan_zhu, None, lr.trigger)
+
+                    # 流月地支 vs 原局地支 3
+                    for dz1 in dzs:
+                        for dz2 in dzs:
+                            if dz1.wei_zhi == dz2.wei_zhi:
+                                continue
+                            CalcGaoNeng.fix_gao_neng(riyuan, lr.zhi_zhu, dz1, dz2, )
+                            CalcGaoNeng.fix_gao_neng(riyuan, dz1, dz2, lr.zhi_zhu, lr.trigger)
+                            CalcGaoNeng.fix_gao_neng(riyuan, dz2, lr.zhi_zhu, dz1, lr.trigger)
+
+                    # 流日地支 vs 原局地支 2
+                    for dz in dzs:
+                        CalcGaoNeng.fix_gao_neng(riyuan, lr.zhi_zhu, dz, None)
+                        CalcGaoNeng.fix_gao_neng(riyuan, dz, lr.zhi_zhu, None, lr.trigger)
+
+                    other_tgs = [liunian.gan_zhu, liuyue.gan_zhu]
+                    other_dzs = [liunian.zhi_zhu, liuyue.zhi_zhu]
+                    # 流年如果来自大运,还要和大运再做一次比对
+                    if liunian.from_dayun:
+                        other_tgs.append(dayun.gan_zhu)
+                        other_dzs.append(dayun.zhi_zhu)
+
+                    # 流日天干 vs 大运流年流月天干
+                    for tg in other_tgs:
+                        CalcGaoNeng.fix_gao_neng(riyuan, lr.gan_zhu, tg, None)
+                        CalcGaoNeng.fix_gao_neng(riyuan, tg, lr.gan_zhu, None, lr.trigger)
+
+                    # 流日地支 vs 大运流年流月地支 3
+                    for dz1 in other_dzs:
+                        for dz2 in dzs:
+                            CalcGaoNeng.fix_gao_neng(riyuan, lr.zhi_zhu, dz1, dz2)
+                            CalcGaoNeng.fix_gao_neng(riyuan, dz1, dz2, lr.zhi_zhu, lr.trigger)
+                            CalcGaoNeng.fix_gao_neng(riyuan, dz2, lr.zhi_zhu, dz1, lr.trigger)
+
+                    # 流日地支 vs 大运流年流月地支 2
+                    for dz in other_dzs:
+                        CalcGaoNeng.fix_gao_neng(riyuan, lr.zhi_zhu, dz, None)
+                        CalcGaoNeng.fix_gao_neng(riyuan, dz, lr.zhi_zhu, None, lr.trigger)
+
+
+def calc_shensha(bazi: BaZi):
+    riyuan = bazi.ri_gan.text
+    for dayun in bazi.dayun:
+        for liunian in dayun.liunian:
+            for liuyue in liunian.liuyue:
+                for lr in liuyue.liuri:
+                    CalcShenSha.__check_lu_shen__(lr.zhi_zhu, riyuan)
+                    CalcShenSha.__check_yang_ren__(lr.zhi_zhu, riyuan)
+                    CalcShenSha.__check_wen_chang__(lr.gan_zhu, lr.zhi_zhu)
+                    CalcShenSha.__check_kui_gang__(lr.gan_zhu, lr.zhi_zhu)
+                    CalcShenSha.__check_yi_ma__(bazi.nian_zhi, bazi.ri_zhi, [lr.zhi_zhu])
+                    CalcShenSha.__check_tianluo_diwang__(bazi.nian_zhi, bazi.ri_zhi, [lr.zhi_zhu])
+                    CalcShenSha.__check_tao_hua__(bazi.nian_zhi, bazi.ri_zhi, [lr.zhi_zhu])
+
+
+def __fill_sizhu_data(sz: SiZhu, riyuan: str, is_dizhi: bool):
+    sz.wu_xing = Configs.get_value(Configs.config_wuxing, sz.text)
+    sz.shi_shen = Configs.get_value2(Configs.config_shishen, riyuan, sz.text)
+    if is_dizhi:
+        cang_gan = Configs.get_value(Configs.config_canggan, sz.text)
+        sz.cang_gan1 = cang_gan[0]
+        sz.cang_gan2 = cang_gan[1]
+        sz.cang_gan3 = cang_gan[2]
+        if sz.cang_gan1 is not None:
+            sz.gan1_wu_xing = Configs.get_value(Configs.config_wuxing, sz.cang_gan1)
+            sz.gan1_shi_shen = Configs.get_value2(Configs.config_shishen, riyuan, sz.cang_gan1)
+        if sz.cang_gan2 is not None:
+            sz.gan2_wu_xing = Configs.get_value(Configs.config_wuxing, sz.cang_gan2)
+            sz.gan2_shi_shen = Configs.get_value2(Configs.config_shishen, riyuan, sz.cang_gan2)
+        if sz.cang_gan3 is not None:
+            sz.gan3_wu_xing = Configs.get_value(Configs.config_wuxing, sz.cang_gan3)
+            sz.gan3_shi_shen = Configs.get_value2(Configs.config_shishen, riyuan, sz.cang_gan3)
+
+
+def __get_start_gan_zhi_of_day__(year: int):
+    data = Configs.get_value2(Configs.config_jie_qi, year, "一日")
+    if data is not None and len(data) == 2:
+        return [data[0], data[1]]
+    else:
+        return None
+
+
+def __get_next_by_dist__(ary: [str], item: str, dist: int):
+    result = None
+    if ary.__contains__(item):
+        index = ary.index(item)
+        index += dist
+        ln = len(ary)
+        while index >= ln:
+            index -= ln
+        result = ary[index]
+    return result
+
+
+def __next_tiangan__(tiangan: str, dist: int):
+    return __get_next_by_dist__(Configs.config_tiangan_list, tiangan, dist)
+
+
+def __next_dizhi__(dizhi: str, dist: int):
+    return __get_next_by_dist__(Configs.config_dizhi_list, dizhi, dist)

+ 152 - 0
yixue/sizhu/CalcLiuYue.py

@@ -0,0 +1,152 @@
+from yixue import Configs
+from yixue.Models import BaZi, LiuYue, SiZhu
+from yixue.sizhu import CalcShenSha, CalcGaoNeng
+
+
+def run(bazi: BaZi):
+    riyuan = bazi.ri_gan.text
+    for dayun in bazi.dayun:
+        for ln in dayun.liunian:
+            ln.liuyue = []
+            start_gan_zhi = __get__start_gan_zhi__(ln.year)
+            if start_gan_zhi is None:
+                continue
+            for month in range(1, 13):
+                # 这里要注意,超过2098年的数据无法生成,会导致流年下没有对应的流月数据
+                ly = LiuYue()
+                ly.month = month
+                dist = month
+                ly.gan_text = __next_tiangan__(start_gan_zhi[0], dist)
+                ly.zhi_text = __next_dizhi__(start_gan_zhi[1], dist)
+                ly.jie_qi = Configs.config_jie_qi_list[month - 1]
+                ly.jie_qi_date = Configs.get_value2(Configs.config_jie_qi, ln.year, ly.jie_qi)
+                if ly.jie_qi_date is not None:
+                    ly.jie_qi_date = str(ly.jie_qi_date).replace(".", "/")
+                ly.trigger = dayun.gan_text + dayun.zhi_text + ln.gan_text + ln.zhi_text + ly.gan_text + ly.zhi_text
+                ly.gan_zhu = SiZhu(ly.gan_text, Configs.const_liuyue_gan)
+                ly.zhi_zhu = SiZhu(ly.zhi_text, Configs.const_liuyue_zhi)
+                ly.gan_zhu.liuyue_text = ly.gan_text + ly.zhi_text
+                ly.zhi_zhu.liuyue_text = ly.gan_text + ly.zhi_text
+                ly.gan_zhu.dayun_text = dayun.gan_text + dayun.zhi_text
+                ly.zhi_zhu.dayun_text = dayun.gan_text + dayun.zhi_text
+                ly.gan_zhu.liunian_text = ln.gan_text + ln.zhi_text
+                ly.zhi_zhu.liunian_text = ln.gan_text + ln.zhi_text
+                __fill_sizhu_data(ly.gan_zhu, riyuan, False)
+                __fill_sizhu_data(ly.zhi_zhu, riyuan, True)
+                ln.liuyue.append(ly)
+
+
+def calc_gaoneng(bazi: BaZi):
+    # 这边运算太久了,放本地去算,选了才计算
+    return
+    tgs = bazi.all_tian_gans()
+    dzs = bazi.all_di_zhis()
+    riyuan = bazi.ri_gan.text
+    for dayun in bazi.dayun:
+        for liunian in dayun.liunian:
+            for ly in liunian.liuyue:
+
+                # 流月天干 vs 原局天干
+                for tg in tgs:
+                    CalcGaoNeng.fix_gao_neng(riyuan, ly.gan_zhu, tg, None)
+                    CalcGaoNeng.fix_gao_neng(riyuan, tg, ly.gan_zhu, None, ly.trigger)
+
+                # 流月地支 vs 原局地支 3
+                for dz1 in dzs:
+                    for dz2 in dzs:
+                        if dz1.wei_zhi == dz2.wei_zhi:
+                            continue
+                        CalcGaoNeng.fix_gao_neng(riyuan, ly.zhi_zhu, dz1, dz2, )
+                        CalcGaoNeng.fix_gao_neng(riyuan, dz1, dz2, ly.zhi_zhu, ly.trigger)
+                        CalcGaoNeng.fix_gao_neng(riyuan, dz2, ly.zhi_zhu, dz1, ly.trigger)
+
+                # 流月地支 vs 原局地支 2
+                for dz in dzs:
+                    CalcGaoNeng.fix_gao_neng(riyuan, ly.zhi_zhu, dz, None)
+                    CalcGaoNeng.fix_gao_neng(riyuan, dz, ly.zhi_zhu, None, ly.trigger)
+
+                other_tgs = [liunian.gan_zhu]
+                other_dzs = [liunian.zhi_zhu]
+                # 流年如果来自大运,还要和大运再做一次比对
+                if liunian.from_dayun:
+                    other_tgs.append(dayun.gan_zhu)
+                    other_dzs.append(dayun.zhi_zhu)
+
+                # 流月天干 vs 大运流年天干
+                for tg in other_tgs:
+                    CalcGaoNeng.fix_gao_neng(riyuan, ly.gan_zhu, tg, None)
+                    CalcGaoNeng.fix_gao_neng(riyuan, tg, ly.gan_zhu, None, ly.trigger)
+
+                # 流月地支 vs 大运流年地支 3
+                for dz1 in other_dzs:
+                    for dz2 in dzs:
+                        CalcGaoNeng.fix_gao_neng(riyuan, ly.zhi_zhu, dz1, dz2)
+                        CalcGaoNeng.fix_gao_neng(riyuan, dz1, dz2, ly.zhi_zhu, ly.trigger)
+                        CalcGaoNeng.fix_gao_neng(riyuan, dz2, ly.zhi_zhu, dz1, ly.trigger)
+
+                # 流月地支 vs 大运流年地支 2
+                for dz in other_dzs:
+                    CalcGaoNeng.fix_gao_neng(riyuan, ly.zhi_zhu, dz, None)
+                    CalcGaoNeng.fix_gao_neng(riyuan, dz, ly.zhi_zhu, None, ly.trigger)
+
+
+def calc_shen_sha(bazi: BaZi):
+    riyuan = bazi.ri_gan.text
+    for dayun in bazi.dayun:
+        for liunian in dayun.liunian:
+            for ly in liunian.liuyue:
+                CalcShenSha.__check_lu_shen__(ly.zhi_zhu, riyuan)
+                CalcShenSha.__check_yang_ren__(ly.zhi_zhu, riyuan)
+                CalcShenSha.__check_wen_chang__(ly.gan_zhu, ly.zhi_zhu)
+                CalcShenSha.__check_kui_gang__(ly.gan_zhu, ly.zhi_zhu)
+                CalcShenSha.__check_yi_ma__(bazi.nian_zhi, bazi.ri_zhi, [ly.zhi_zhu])
+                CalcShenSha.__check_tianluo_diwang__(bazi.nian_zhi, bazi.ri_zhi, [ly.zhi_zhu])
+                CalcShenSha.__check_tao_hua__(bazi.nian_zhi, bazi.ri_zhi, [ly.zhi_zhu])
+
+
+def __fill_sizhu_data(sz: SiZhu, riyuan: str, is_dizhi: bool):
+    sz.wu_xing = Configs.get_value(Configs.config_wuxing, sz.text)
+    sz.shi_shen = Configs.get_value2(Configs.config_shishen, riyuan, sz.text)
+    if is_dizhi:
+        cang_gan = Configs.get_value(Configs.config_canggan, sz.text)
+        sz.cang_gan1 = cang_gan[0]
+        sz.cang_gan2 = cang_gan[1]
+        sz.cang_gan3 = cang_gan[2]
+        if sz.cang_gan1 is not None:
+            sz.gan1_wu_xing = Configs.get_value(Configs.config_wuxing, sz.cang_gan1)
+            sz.gan1_shi_shen = Configs.get_value2(Configs.config_shishen, riyuan, sz.cang_gan1)
+        if sz.cang_gan2 is not None:
+            sz.gan2_wu_xing = Configs.get_value(Configs.config_wuxing, sz.cang_gan2)
+            sz.gan2_shi_shen = Configs.get_value2(Configs.config_shishen, riyuan, sz.cang_gan2)
+        if sz.cang_gan3 is not None:
+            sz.gan3_wu_xing = Configs.get_value(Configs.config_wuxing, sz.cang_gan3)
+            sz.gan3_shi_shen = Configs.get_value2(Configs.config_shishen, riyuan, sz.cang_gan3)
+
+
+def __get__start_gan_zhi__(year: int):
+    result = None
+    info = Configs.get_value(Configs.config_jie_qi, year)
+    if info is not None:
+        mData = info["一月"]
+        result = [mData[0], mData[1]]
+    return result
+
+
+def __get_next_by_dist__(ary: [str], item: str, dist: int):
+    result = None
+    if ary.__contains__(item):
+        index = ary.index(item)
+        index += dist
+        ln = len(ary)
+        while index >= ln:
+            index -= ln
+        result = ary[index]
+    return result
+
+
+def __next_tiangan__(tiangan: str, dist: int):
+    return __get_next_by_dist__(Configs.config_tiangan_list, tiangan, dist)
+
+
+def __next_dizhi__(dizhi: str, dist: int):
+    return __get_next_by_dist__(Configs.config_dizhi_list, dizhi, dist)

+ 117 - 0
yixue/sizhu/CalcPower.py

@@ -0,0 +1,117 @@
+from yixue import Configs
+from yixue.Models import BaZi, PowerCounter, GaoNeng, SiZhu
+
+
+def __get_wu_xing_of_shi_shen(ss: str, bazi: BaZi):
+    wx = bazi.ri_gan.wu_xing
+    return Configs.get_value2(Configs.config_wuxing_shishen_query, wx, ss)
+
+
+def calc_power_step(bazi: BaZi):
+    """
+    返回一个对象,key是五行和十神简称,value是power step
+    """
+    ary = Configs.congfig_wangshuai[bazi.yue_zhi.wu_xing]
+    steps = {
+        ary[0]: 100,
+        ary[1]: 80,
+        ary[2]: 60,
+        ary[3]: 40,
+        ary[4]: 20,
+    }
+
+    bazi.shishen_guanxi = {
+        "木": [], "火": [], "土": [], "金": [], "水": [],
+    }
+    temp_ss_dict = {}
+    for ss in Configs.config_shishen_list:
+        ss_wx = __get_wu_xing_of_shi_shen(ss, bazi)
+        if ss_wx is None:
+            continue
+        bazi.shishen_guanxi[ss_wx].append(ss)
+        value = steps[ss_wx]
+        steps[ss] = value
+        temp_ss_dict[ss] = []
+
+    for tg in Configs.config_tiangan_list:
+        tg_ss = Configs.config_shishen[bazi.ri_gan.text][tg]
+        bazi.shishen_guanxi[tg] = tg_ss
+        temp_ss_dict[tg_ss].append(tg)
+    for dz in Configs.config_dizhi_list:
+        dz_ss = Configs.config_shishen[bazi.ri_gan.text][dz]
+        bazi.shishen_guanxi[dz] = dz_ss
+        temp_ss_dict[dz_ss].append(dz)
+
+    for key in temp_ss_dict:
+        bazi.shishen_guanxi[key] = temp_ss_dict[key]
+    bazi.shishen_guanxi['禄神'] = Configs.config_lushen[bazi.ri_gan.text]["禄神"]
+    bazi.shishen_guanxi['半禄'] = Configs.config_lushen[bazi.ri_gan.text]["半禄"]
+    return steps
+
+
+def count_wu_xing_shi_shen(bazi: BaZi):
+    counter = PowerCounter.new_counter()
+    for sz in bazi.all_zhus():
+        if sz.text == "无":
+            continue
+        if sz.wei_zhi <= Configs.const_shi_gan:
+            counter[sz.wu_xing] += 1
+            counter[sz.shi_shen] += 1
+        else:
+            if sz.cang_gan3 is None:
+                if sz.cang_gan2 is None:
+                    counter[sz.gan1_wu_xing] += 1
+                    counter[sz.gan1_shi_shen] += 1
+                else:
+                    counter[sz.gan1_wu_xing] += 0.7
+                    counter[sz.gan2_wu_xing] += 0.3
+                    counter[sz.gan1_shi_shen] += 0.7
+                    counter[sz.gan2_shi_shen] += 0.3
+            else:
+                counter[sz.gan1_wu_xing] += 0.6
+                counter[sz.gan2_wu_xing] += 0.3
+                counter[sz.gan3_wu_xing] += 0.1
+                counter[sz.gan1_shi_shen] += 0.6
+                counter[sz.gan2_shi_shen] += 0.3
+                counter[sz.gan3_shi_shen] += 0.1
+
+    for key in counter.keys():
+        counter[key] = round(counter[key], 1)
+    return counter
+
+
+def count_diff_of_gaoneng(bazi: BaZi):
+    riyuan = bazi.ri_gan.text
+    # 影响力量分布的高能关系主要是拱合、半合、三会(不稳定,先不看)
+    counter = PowerCounter.new_counter()
+    for dz in bazi.all_di_zhis():  # type: SiZhu
+        for gn in dz.gaonengs:  # type:GaoNeng
+            if gn.guanxi in ["半合", "拱合"]:
+                target = gn.fangxiang
+                if target is not None:
+                    wx = Configs.config_wuxing[target]
+                    ss = Configs.config_shishen[riyuan][target]
+                    counter[wx] += 0.5
+                    counter[ss] += 0.5
+    return counter
+
+
+def count_diff_of_muku(bazi: BaZi):
+    # 墓库的影响主要是开闭库状态下,藏干中主气中气余气的转换
+    counter = PowerCounter.new_counter()
+    for dz in bazi.all_di_zhis():  # type:SiZhu
+        if dz.is_muku:
+            counter[dz.gan1_wu_xing] -= 0.5
+            counter[dz.gan1_shi_shen] -= 0.5
+            counter[dz.gan2_wu_xing] += 0.3
+            counter[dz.gan2_shi_shen] += 0.3
+            counter[dz.gan3_wu_xing] += 0.2
+            counter[dz.gan3_shi_shen] += 0.2
+
+    return counter
+
+
+def count_diff_of_zihe(bazi: BaZi):
+    counter = PowerCounter.new_counter()
+    
+    return counter

+ 106 - 0
yixue/sizhu/CalcShenSha.py

@@ -0,0 +1,106 @@
+from yixue import Configs
+from yixue.Models import BaZi, SiZhu
+
+
+def run(bazi: BaZi):
+    riyuan = bazi.ri_gan.text
+    tgs = bazi.all_tian_gans()
+    dzs = bazi.all_di_zhis()
+    for dz in dzs:
+        if dz.text == "无":
+            continue
+        __check_lu_shen__(dz, riyuan)
+        __check_yang_ren__(dz, riyuan)
+        __check_jiang_xing__(dz)
+
+    for (index, tg) in enumerate(tgs):
+        dz = dzs[index]
+        __check_wen_chang__(tg, dz)
+        __check_kui_gang__(tg, dz)
+
+    __check_yi_ma__(bazi.nian_zhi, bazi.ri_zhi, dzs)
+    __check_tianluo_diwang__(bazi.nian_zhi, bazi.ri_zhi, dzs)
+    __check_tao_hua__(bazi.nian_zhi, bazi.ri_zhi, dzs)
+
+
+def __check_lu_shen__(sz: SiZhu, riyuan: str):
+    # 以日元查四柱
+    info = Configs.config_lushen[riyuan]
+    if sz.text == info["禄神"]:
+        sz.shenshas.append("禄神")
+    elif sz.text in info["半禄"]:
+        sz.shenshas.append("半禄")
+
+
+def __check_yang_ren__(sz: SiZhu, riyuan: str):
+    key = "羊刃"
+    if sz.text == Configs.config_yangren[riyuan]:
+        sz.shenshas.append(key)
+
+
+def __check_wen_chang__(tg: SiZhu, dz: SiZhu):
+    # 天干食神,地支符合文昌配置(以同柱天干为key)
+    if tg.shi_shen == "食":
+        if dz.text == Configs.config_wenchang[tg.text]:
+            dz.shenshas.append("文昌")
+
+
+def __check_kui_gang__(tg: SiZhu, dz: SiZhu):
+    # 天干地支同时满足条件为魁罡
+    key = tg.text + dz.text
+    if key in Configs.config_kuigang:
+        dz.shenshas.append("魁罡")
+
+
+def __check_yi_ma__(nian_zhi: SiZhu, ri_zhi: SiZhu, dzs: [SiZhu]):
+    # 用年支、日支查其余支
+    targets = [nian_zhi, ri_zhi]
+    for target in targets:
+        for dz in dzs:
+            if dz == target:
+                continue
+            if dz.text == "无":
+                continue
+            if dz.text == Configs.config_yima[target.text]:
+                dz.shenshas.append("驿马")
+
+
+def __check_jiang_xing__(dz: SiZhu):
+    if dz.text in ["子", "午", "卯", "酉"]:
+        dz.shenshas.append("将星")
+
+
+def __check_tianluo_diwang__(nian_zhi: SiZhu, ri_zhi: SiZhu, dzs: [SiZhu]):
+    # 年日支查其余支
+    targets = [nian_zhi, ri_zhi]
+    for target in targets:
+        for dz in dzs:
+            if dz == target:
+                continue
+            if dz.text == "无":
+                continue
+            key = target.text + dz.text
+            if key in ["戌亥", "亥戌"]:
+                dz.shenshas.append("天罗")
+            elif key in ["辰巳", "巳辰"]:
+                dz.shenshas.append("地网")
+
+
+def __check_tao_hua__(nian_zhi: SiZhu, ri_zhi: SiZhu, dzs: [SiZhu]):
+    # 年日支查其余支
+    key = "桃花"
+    targets = [nian_zhi, ri_zhi]
+    for target in targets:
+        for dz in dzs:
+            if dz == target:
+                continue
+            if dz.text == "无":
+                continue
+            if target.text in ["申", "子", "辰"] and dz.text == "酉":
+                dz.shenshas.append(key)
+            elif target.text in ["寅", "午", "戌"] and dz.text == "卯":
+                dz.shenshas.append(key)
+            elif target.text in ["巳", "酉", "丑"] and dz.text == "午":
+                dz.shenshas.append(key)
+            elif target.text in ["亥", "卯", "未"] and dz.text == "子":
+                dz.shenshas.append(key)

+ 183 - 0
yixue/sizhu/CalcSiZhu.py

@@ -0,0 +1,183 @@
+import math
+from datetime import datetime
+
+from wx.dbTools import DBWanNianLi, DBTaiYangShi, DBAreaInfo
+from yixue import Configs
+from yixue.Models import SiZhuResult
+
+
+def __calc_time_delta__(diff_hour: int, diff_minute: int, diff_second: int):
+    import datetime
+    return datetime.timedelta(hours=diff_hour, minutes=diff_minute, seconds=diff_second)
+
+
+def __get_tiangan_start_of_hour__(ri_gan: str):
+    if ri_gan == "甲" or ri_gan == "己":
+        return "甲"
+    if ri_gan == "乙" or ri_gan == "庚":
+        return "丙"
+    if ri_gan == "丙" or ri_gan == "辛":
+        return "戊"
+    if ri_gan == "丁" or ri_gan == "壬":
+        return "庚"
+    if ri_gan == "戊" or ri_gan == "癸":
+        return "壬"
+
+
+def __get_next_by_dist__(ary: [str], item: str, dist: int):
+    result = None
+    if ary.__contains__(item):
+        index = ary.index(item)
+        index += dist
+        ln = len(ary)
+        while index >= ln:
+            index -= ln
+        result = ary[index]
+    return result
+
+
+def __next_tiangan__(tiangan: str, dist: int):
+    return __get_next_by_dist__(Configs.config_tiangan_list, tiangan, dist)
+
+
+def __next_dizhi__(dizhi: str, dist: int):
+    return __get_next_by_dist__(Configs.config_dizhi_list, dizhi, dist)
+
+
+def __get_distance_of_hour__(hour: int):
+    """
+    根据时间换算成当前时间所在的天干地支距离初始天干地支的距离
+    """
+    dist = 0
+    if hour == 23 or hour == 0:
+        dist = 0
+    elif hour == 1 or hour == 2:
+        dist = 1
+    elif hour == 3 or hour == 4:
+        dist = 2
+    elif hour == 5 or hour == 6:
+        dist = 3
+    elif hour == 7 or hour == 8:
+        dist = 4
+    elif hour == 9 or hour == 10:
+        dist = 5
+    elif hour == 11 or hour == 12:
+        dist = 6
+    elif hour == 13 or hour == 14:
+        dist = 7
+    elif hour == 15 or hour == 16:
+        dist = 8
+    elif hour == 17 or hour == 18:
+        dist = 9
+    elif hour == 19 or hour == 20:
+        dist = 10
+    elif hour == 21 or hour == 22:
+        dist = 11
+    return dist
+
+
+def __get_dizhi_by_hour__(hour: int):
+    """
+    地支只根据时辰计算,是固定的
+    """
+    index = 0
+    if hour == 23 or hour == 0:
+        index = 0
+    elif hour == 1 or hour == 2:
+        index = 1
+    elif hour == 3 or hour == 4:
+        index = 2
+    elif hour == 5 or hour == 6:
+        index = 3
+    elif hour == 7 or hour == 8:
+        index = 4
+    elif hour == 9 or hour == 10:
+        index = 5
+    elif hour == 11 or hour == 12:
+        index = 6
+    elif hour == 13 or hour == 14:
+        index = 7
+    elif hour == 15 or hour == 16:
+        index = 8
+    elif hour == 17 or hour == 18:
+        index = 9
+    elif hour == 19 or hour == 20:
+        index = 10
+    elif hour == 21 or hour == 22:
+        index = 11
+    return Configs.config_dizhi_list[index]
+
+
+def run(year: int, month: int, day: int, know_time: bool, hour: int, minute: int, sheng: str, shi: str,
+        qu: str) -> SiZhuResult:
+    """
+        返回数组,顺序是:[年干、年支、月干、月支、日干、日支、时干、时支]
+    """
+    tm1 = datetime.now()
+    wnl = DBWanNianLi.query_first_by(nian=year, yue=month, ri=day)
+    tm2 = datetime.now()
+    print("    query wan nian li use:", tm2 - tm1)
+    if wnl is None:
+        return None
+
+    result = SiZhuResult()
+    result.sheng = sheng
+    result.shi = shi
+    result.qu = qu
+    result.nian_gan = wnl.nian_gan
+    result.nian_zhi = wnl.nian_zhi
+    result.yue_gan = wnl.yue_gan
+    result.yue_zhi = wnl.yue_zhi
+    result.ri_gan = wnl.ri_gan
+    result.ri_zhi = wnl.ri_zhi
+
+    if not know_time:
+        result.shi_gan = "无"
+        result.shi_zhi = "无"
+        hour = 0
+        minute = 0
+
+    dtm = datetime(year=year, month=month, day=day, hour=hour, minute=minute)
+    tys = DBTaiYangShi.query_first_by(month=month, day=day)
+
+    if shi == "-" or qu == "-":
+        sheng = "未知地区"  # 防止客户端过来的数据有错
+    area = DBAreaInfo.query_first_by(sheng=sheng, shi=shi, qu=qu)
+    if area is None:
+        sheng = "未知地区"
+        shi = "-"
+        qu = "-"
+        area = DBAreaInfo.query_first_by(sheng=sheng, shi=shi, qu=qu)
+    if wnl is not None and tys is not None and area is not None:
+        # 计算太阳时导致的偏移,正数减,负数加
+        diff_minute = math.trunc(tys.diff / 60)
+        diff_second = tys.diff - diff_minute * 60
+        tys_delta = __calc_time_delta__(0, diff_minute, diff_second)
+
+        # 计算地区导致的时间偏移,23点减,0点加
+        area_delta_hour = area.hour
+        area_delta_minute = area.minute
+        area_delta_second = area.second
+        if area.hour == 23:
+            area_delta_hour = 0
+            if area.second != 0:
+                area_delta_second = -(60 - area.second)
+                area_delta_minute = -(59 - area.minute)
+            else:
+                area_delta_second = 0
+                area_delta_minute = -(60 - area.minute)
+        area_delta = __calc_time_delta__(area_delta_hour, area_delta_minute, area_delta_second)
+
+        user_date = dtm + area_delta - tys_delta
+        result.tai_yang_shi = user_date
+        # print("真太阳时:", user_date)
+
+        # 用真太阳时计算时柱
+        if know_time is True:
+            start_tiangan = __get_tiangan_start_of_hour__(wnl.ri_gan)
+            dist = __get_distance_of_hour__(user_date.hour)
+            shi_gan = __next_tiangan__(start_tiangan, dist)
+            shi_zhi = __get_dizhi_by_hour__(user_date.hour)
+            result.shi_gan = shi_gan
+            result.shi_zhi = shi_zhi
+    return result

+ 114 - 0
yixue/sizhu/CalcSiZhuByTexts.py

@@ -0,0 +1,114 @@
+from wx.dbTools import DBWanNianLi
+from yixue import Configs
+from yixue.Models import SiZhuCheckResult
+
+shichen_ary = [23, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21]
+
+
+def run(niangan: str, nianzhi: str, yuegan: str, yuezhi: str, rigan: str, rizhi: str, shigan: str, shizhi: str):
+    result = SiZhuCheckResult()
+
+    quy1 = DBWanNianLi.query_first_by(nian_gan=niangan, nian_zhi=nianzhi)
+    if quy1 is None:
+        result.error = True
+        dt_nians = DBWanNianLi.query_by(nian_gan=niangan)
+        for dt_nian in dt_nians:
+            if not result.adv_nian.__contains__(dt_nian.nian_zhi):
+                result.adv_nian.append(dt_nian.nian_zhi)
+    else:
+        # 到这里年对了
+        quy2 = DBWanNianLi.query_first_by(nian_gan=niangan, nian_zhi=nianzhi, yue_gan=yuegan, yue_zhi=yuezhi)
+        if quy2 is None:
+            result.error = True
+            dt_yues = DBWanNianLi.query_by(nian_gan=niangan, nian_zhi=nianzhi, yue_gan=yuegan)
+            for dt_yue in dt_yues:
+                if not result.adv_yue.__contains__(dt_yue.yue_zhi):
+                    result.adv_yue.append(dt_yue.yue_zhi)
+        else:
+            # 到这里月对了
+            quy3 = DBWanNianLi.query_first_by(nian_gan=niangan, nian_zhi=nianzhi, yue_gan=yuegan, yue_zhi=yuezhi,
+                                              ri_gan=rigan, ri_zhi=rizhi)
+            if quy3 is None:
+                result.error = True
+                dt_ris = DBWanNianLi.query_by(nian_gan=niangan, nian_zhi=nianzhi, yue_gan=yuegan, ri_gan=rigan)
+                for dt_ri in dt_ris:
+                    if not result.adv_ri.__contains__(dt_ri.ri_zhi):
+                        result.adv_ri.append(dt_ri.ri_zhi)
+            else:
+                # 到这里日对了
+                time_ok = False
+                correct_time = -1
+                if shigan is not None and shizhi is not None:
+                    start_tiangan = __get_tiangan_start_of_hour__(rigan)
+                    start_dizhi = "子"
+                    last_tiangan = start_tiangan
+                    last_dizhi = start_dizhi
+                    result.error = True
+                    for index, shichen in enumerate(shichen_ary):
+                        if last_tiangan == shigan and last_dizhi == shizhi:
+                            result.error = False
+                            time_ok = True
+                            correct_time = shichen
+                            break
+                        last_tiangan = __next_tiangan__(last_tiangan, 1)
+                        last_dizhi = __next_dizhi__(last_dizhi, 1)
+
+                    if result.error:
+                        last_tiangan = start_tiangan
+                        last_dizhi = start_dizhi
+                        for index, shichen in enumerate(shichen_ary):
+                            if last_tiangan == shigan and last_dizhi != shizhi:
+                                if not result.adv_shi.__contains__(last_dizhi):
+                                    result.adv_shi.append(last_dizhi)
+                            last_tiangan = __next_tiangan__(last_tiangan, 1)
+                            last_dizhi = __next_dizhi__(last_dizhi, 1)
+                else:
+                    time_ok = True
+
+                if time_ok:
+                    # 到这里时对了
+                    quy4 = DBWanNianLi.query_by(nian_gan=niangan, nian_zhi=nianzhi, yue_gan=yuegan, yue_zhi=yuezhi,
+                                                ri_gan=rigan, ri_zhi=rizhi)
+                    for dt in quy4:
+                        if correct_time == -1:
+                            key = str(dt.nian) + "-" + str(dt.yue) + "-" + str(dt.ri)
+                            if not result.adv_date.__contains__(key):
+                                result.adv_date.append(key)
+                        else:
+                            key = str(dt.nian) + "-" + str(dt.yue) + "-" + str(dt.ri) + " " + str(correct_time) + ":00"
+                            if not result.adv_date.__contains__(key):
+                                result.adv_date.append(key)
+    return result
+
+
+def __get_tiangan_start_of_hour__(riyuan: str):
+    if riyuan == "甲" or riyuan == "己":
+        return "甲"
+    if riyuan == "乙" or riyuan == "庚":
+        return "丙"
+    if riyuan == "丙" or riyuan == "辛":
+        return "戊"
+    if riyuan == "丁" or riyuan == "壬":
+        return "庚"
+    if riyuan == "戊" or riyuan == "癸":
+        return "壬"
+
+
+def __get_next_by_dist__(ary: [str], item: str, dist: int):
+    result = None
+    if ary.__contains__(item):
+        index = ary.index(item)
+        index += dist
+        ln = len(ary)
+        while index >= ln:
+            index -= ln
+        result = ary[index]
+    return result
+
+
+def __next_tiangan__(tiangan: str, dist: int):
+    return __get_next_by_dist__(Configs.config_tiangan_list, tiangan, dist)
+
+
+def __next_dizhi__(dizhi: str, dist: int):
+    return __get_next_by_dist__(Configs.config_dizhi_list, dizhi, dist)

+ 176 - 0
yixue/sizhu/CalcYinYuan.py

@@ -0,0 +1,176 @@
+from yixue import Configs
+from yixue.Models import BaZi, TaoHuaZhu, LiuNian, LiuYue, DaYun
+
+
+def calc_yinyuan(bazi: BaZi):
+    taphuazhus = __find_taohua_zhu__(bazi)
+    if len(taphuazhus) == 0:
+        __fix_yinyuan_by_chong__(bazi)
+    else:
+        __fix_yinyuan__(bazi, taphuazhus)
+
+
+def __find_taohua_zhu__(bazi: BaZi):
+    # 桃花柱的等级:以男命为例
+    # 5、财星。4、官星。3、藏干带财官。2、大运带财。1、大运带官。0、带印的柱(只在原局找)。
+    result: [TaoHuaZhu] = []
+    if bazi.is_man:
+        if bazi.ri_zhi.shi_shen in ["财", "才"]:
+            pass
+        else:
+            __find_taohuazhu_in_bazi__(bazi, ["财", "才"], [], 5, result, False)
+            __find_taohuazhu_in_bazi__(bazi, ["官", "杀"], ["财", "才"], 4, result, False)
+            __find_taohuazhu_in_bazi__(bazi, ["财", "才", "官", "杀"], ["财", "才", "官", "杀"], 3, result, True)
+            __find_taohuazhu_in_dayun__(bazi, ["财", "才"], [], 2, result)
+            __find_taohuazhu_in_dayun__(bazi, ["官", "杀"], ["财", "才"], 1, result)
+            # __find_taohuazhu_in_bazi__(bazi, ["印", "枭"], ["财", "才", "官", "杀"], 1, result, False)
+            # for thz in result:
+            #     print(thz.level, thz.gan_zhu.wei_zhi, thz.gan_zhu.text, thz.zhi_zhu.wei_zhi, thz.zhi_zhu.text)
+    else:
+        if bazi.ri_zhi.shi_shen in ["官", "杀"]:
+            pass
+        else:
+            __find_taohuazhu_in_bazi__(bazi, ["官", "杀"], [], 5, result, False)
+            __find_taohuazhu_in_bazi__(bazi, ["财", "才"], ["官", "杀"], 4, result, False)
+            __find_taohuazhu_in_bazi__(bazi, ["财", "才", "官", "杀"], ["财", "才", "官", "杀"], 3, result, True)
+            __find_taohuazhu_in_dayun__(bazi, ["官", "杀"], [], 2, result)
+            __find_taohuazhu_in_dayun__(bazi, ["财", "才"], ["官", "杀"], 1, result)
+
+    return result
+
+
+def __fix_yinyuan__(bazi: BaZi, taohuazhus: [TaoHuaZhu]):
+    pei_ou_zhu = TaoHuaZhu(bazi.ri_gan, bazi.ri_zhi, 0)
+    pei_ou_zhu.tg_keys = __calc_gaoneng_keys__(pei_ou_zhu.gan_zhu.text, ["合"])
+    pei_ou_zhu.dz_keys = __calc_gaoneng_keys__(pei_ou_zhu.zhi_zhu.text, ["合", "半合"])
+    for thz in taohuazhus:
+        thz.tg_keys = __calc_gaoneng_keys__(thz.gan_zhu.text, ["合"])
+        thz.dz_keys = __calc_gaoneng_keys__(thz.zhi_zhu.text, ["合", "半合"])
+
+        for dayun in bazi.dayun:
+            if not dayun.is_dayun:
+                continue
+            if dayun.start_age >= 60 or dayun.end_age <= 10:
+                continue
+            if thz.level <= 2:  # 从大运找的桃花柱,只在当前大运有效
+                if thz.gan_zhu != dayun.gan_zhu and thz.zhi_zhu != dayun.zhi_zhu:
+                    continue
+            for liunian in dayun.liunian:
+                if liunian.age <= 10 or liunian.age >= 60:
+                    continue
+                is_yin_yuan_nian = __do_fix__(bazi, pei_ou_zhu, thz, dayun, liunian, None)
+                if is_yin_yuan_nian:
+                    for liuyue in liunian.liuyue:
+                        __do_fix__(bazi, pei_ou_zhu, thz, dayun, liunian, liuyue)
+
+
+def __do_fix__(bazi: BaZi, main_zhu: TaoHuaZhu, taohua: TaoHuaZhu, dayun: DaYun, liunian: LiuNian, liuyue: LiuYue):
+    tgs = [bazi.nian_gan.text, bazi.yue_gan.text, bazi.ri_gan.text, bazi.shi_gan.text, dayun.gan_text,
+           liunian.gan_text]
+    dzs = [bazi.nian_zhi.text, bazi.yue_zhi.text, bazi.ri_zhi.text, bazi.shi_zhi.text, dayun.zhi_text,
+           liunian.zhi_text]
+    if liuyue is not None:
+        tgs.append(liuyue.gan_text)
+        dzs.append(liuyue.zhi_text)
+    target_index = len(tgs) - 1
+    tip = ""
+
+    fixed = False
+    if tgs[target_index] in main_zhu.tg_keys:  # 适配日柱天干
+        index = __index_of_keys__(taohua.dz_keys, dzs)
+        if index != -1:  # 适配桃花地支
+            fixed = True
+            tip = main_zhu.gan_zhu.text + tgs[target_index] + "、" + taohua.zhi_zhu.text + dzs[index]
+    elif dzs[target_index] in main_zhu.dz_keys:  # 适配日柱地支
+        index = __index_of_keys__(taohua.tg_keys, tgs)
+        if index != -1:  # 适配桃花天干
+            fixed = True
+            tip = main_zhu.zhi_zhu.text + dzs[target_index] + "、" + taohua.gan_zhu.text + tgs[index]
+
+    if fixed:
+        if liuyue is None:
+            if liunian.yinyuan_level < taohua.level:
+                liunian.yinyuan_level = taohua.level
+                liunian.yinyuan_tip = tip
+        else:
+            if liuyue.yinyuan_level < taohua.level:
+                liuyue.yinyuan_level = taohua.level
+                liuyue.yinyuan_tip = tip
+    return fixed
+
+
+def __fix_yinyuan_by_chong__(bazi: BaZi):
+    chongs = __calc_gaoneng_keys__(bazi.ri_zhi.text, ["冲"])
+    for dayun in bazi.dayun:
+        if not dayun.is_dayun:
+            continue
+        if dayun.start_age >= 60 or dayun.end_age <= 10:
+            continue
+        for liunian in dayun.liunian:
+            if liunian.age <= 10 or liunian.age >= 60:
+                continue
+            if liunian.zhi_text in chongs:
+                liunian.yinyuan_level = 5
+                liunian.yinyuan_tip = bazi.ri_zhi.text + liunian.zhi_text + "冲"
+                for liuyue in liunian.liuyue:
+                    if liuyue.zhi_text in chongs:
+                        liuyue.yinyuan_level = 1
+                        liuyue.yinyuan_tip = bazi.ri_zhi.text + liuyue.zhi_text + "冲"
+
+
+def __index_of_keys__(keys: [str], ary: [str]):
+    index = -1
+    for key in keys:
+        if key in ary:
+            index = ary.index(key)
+        break
+    return index
+
+
+def __calc_gaoneng_keys__(text: str, guanxis: [str]):
+    result = []
+    gns = Configs.get_value(Configs.config_gaoneng_key, text)
+    if gns is not None:
+        for gn in gns:
+            if gn["guanxi"] in guanxis:
+                other = str(gn["name"]).replace(gn["guanxi"], "").replace(text, "")
+                result.append(other)
+    return result
+
+
+def __find_taohuazhu_in_dayun__(bazi: BaZi, includes: [str], excludes: [str], level: int, result: [TaoHuaZhu]):
+    for dayun in bazi.dayun:
+        if not dayun.is_dayun:
+            continue
+        if dayun.gan_zhu.shi_shen in excludes or dayun.zhi_zhu.shi_shen in excludes:
+            continue
+        if dayun.gan_zhu.shi_shen in includes or dayun.zhi_zhu.shi_shen in includes:
+            result.append(TaoHuaZhu(dayun.gan_zhu, dayun.zhi_zhu, level))
+
+
+def __find_taohuazhu_in_bazi__(bazi: BaZi, includes: [str], excludes: [str], level: int, result: [TaoHuaZhu],
+                               search_canggan: bool):
+    for index, gan in enumerate(bazi.all_tian_gans()):
+        if gan == bazi.ri_gan:
+            continue
+        zhi = bazi.all_di_zhis()[index]
+        if search_canggan is False:
+            if gan.shi_shen in excludes or zhi.shi_shen in excludes:
+                continue
+            if gan.shi_shen in includes or zhi.shi_shen in includes:
+                result.append(TaoHuaZhu(gan, zhi, level))
+        else:
+            if gan.shi_shen in excludes or zhi.shi_shen in excludes:
+                continue
+            if gan.gan1_shi_shen is not None and gan.gan1_shi_shen in includes:
+                result.append(TaoHuaZhu(gan, zhi, level))
+            elif gan.gan2_shi_shen is not None and gan.gan2_shi_shen in includes:
+                result.append(TaoHuaZhu(gan, zhi, level))
+            elif gan.gan3_shi_shen is not None and gan.gan3_shi_shen in excludes:
+                result.append(TaoHuaZhu(gan, zhi, level))
+            elif zhi.gan1_shi_shen is not None and zhi.gan1_shi_shen in includes:
+                result.append(TaoHuaZhu(gan, zhi, level))
+            elif zhi.gan2_shi_shen is not None and zhi.gan2_shi_shen in includes:
+                result.append(TaoHuaZhu(gan, zhi, level))
+            elif zhi.gan3_shi_shen is not None and zhi.gan3_shi_shen == excludes:
+                result.append(TaoHuaZhu(gan, zhi, level))

+ 41 - 0
yixue/sizhu/CheckMuKu.py

@@ -0,0 +1,41 @@
+from yixue import Configs
+from yixue.Models import SiZhu, BaZi, GaoNeng
+
+
+def __has_gaoneng_in_dizhi(gn_text: str, bazi: BaZi):
+    result = False
+    if gn_text is not None:
+        for dz in bazi.all_di_zhis():  # type: SiZhu
+            for gn in dz.gaonengs:  # type: GaoNeng
+                if gn.text == gn_text:
+                    result = True
+                    break
+            if result:
+                break
+    return result
+
+
+def is_muku_open(zhu: SiZhu, bazi: BaZi):
+    result = False
+    if Configs.config_muku.__contains__(zhu.text):
+        info = Configs.config_muku[zhu.text]
+        if __has_gaoneng_in_dizhi(info["lock"], bazi):
+            # 锁库
+            # 方案1,自刑开库
+            result = __has_gaoneng_in_dizhi(info["zixing"], bazi)
+            if result is False:
+                # 方案2,拱合开库
+                result = __has_gaoneng_in_dizhi(info["gonghe"], bazi)
+                if result is False:
+                    # 方案3,三会开库
+                    result = __has_gaoneng_in_dizhi(info["sanhui"], bazi)
+                    if result is False:
+                        # 方案4,暗合+冲开库
+                        rt1 = __has_gaoneng_in_dizhi(info["anhe"], bazi)
+                        if rt1 is True:
+                            result = __has_gaoneng_in_dizhi(info["chong"], bazi)
+        else:
+            # 未锁库,可以直接冲开
+            if __has_gaoneng_in_dizhi(info["chong"], bazi):
+                result = True
+    return result

+ 337 - 0
yixue/zhenduan/AboutDaYun.py

@@ -0,0 +1,337 @@
+import datetime
+
+from yixue import Configs
+from yixue.Models import BaZi, DaYun, LiuNian, ZhenDuanItem, GaoNeng, SiZhu
+
+
+# 找今年对应的大运,往后看三年
+# 如果跨大运,就看下一个大运,反正凑满3年
+# 大运只看事业,年份的姻缘到姻缘板块看
+
+def run(bazi: BaZi):
+    cur = datetime.datetime.now()
+    # cur.year
+    dayun_list = []
+    liu_nian_list = []
+    jianyi = []
+    cankao = []
+    __find_dayun_liunian__(cur.year, bazi, dayun_list, liu_nian_list)
+    __resolve_data__(dayun_list, liu_nian_list, jianyi, cankao, bazi)
+    bazi.zhenduan.dayun.jianyi = jianyi
+    bazi.zhenduan.dayun.cankao = cankao
+
+
+def __resolve_data__(dayun_list: [DaYun], liunian_list: [LiuNian], jianyi: [], cankao: [], bazi: BaZi):
+    last_dayun = None
+    count = 0
+    for index, dayun in enumerate(dayun_list):
+        if last_dayun != dayun:
+            __about_dayun__(dayun, jianyi, cankao, bazi, count)
+            count += 1
+        liunian = liunian_list[index]
+        __about_liunian__(liunian, jianyi, cankao, bazi)
+        last_dayun = dayun
+
+
+def __about_dayun__(dayun: DaYun, jianyi: [], cankao: [], bazi: BaZi, count: int):
+    if not dayun.is_dayun:
+        return
+    full_gan_shishen = __get_shishen_full_name__(dayun.gan_zhu.shi_shen)
+    full_zhi_shishen = __get_shishen_full_name__(dayun.zhi_zhu.shi_shen)
+    content = ""
+    if count == 0:
+        content += "大运走"
+    else:
+        content += "\n\n下个大运走"
+    content += full_gan_shishen + full_zhi_shishen + "运(" + str(dayun.start_year) + " - " + str(
+        dayun.end_year) + "),"
+    tip1 = Configs.get_value(Configs.config_zhenduan_dayun, dayun.gan_zhu.shi_shen)
+    tip2 = Configs.get_value(Configs.config_zhenduan_dayun, dayun.zhi_zhu.shi_shen)
+    if tip1 is not None and tip2 is not None:
+        content += tip1 + "同时" + tip2
+    item = ZhenDuanItem(0, content)
+    item.set_selected(True)
+    jianyi.append(item)
+
+    __about_he__(dayun.gan_zhu, bazi, jianyi, cankao)
+    __about_he__(dayun.zhi_zhu, bazi, jianyi, cankao)
+    __about_an_he__(dayun.gan_zhu, bazi, jianyi, cankao)
+    __about_an_he__(dayun.zhi_zhu, bazi, jianyi, cankao)
+    __about_chong__(dayun.gan_zhu, bazi, jianyi, cankao)
+    __about_chong__(dayun.zhi_zhu, bazi, jianyi, cankao)
+    __about_xing__(dayun.gan_zhu, bazi, jianyi, cankao)
+    __about_xing__(dayun.zhi_zhu, bazi, jianyi, cankao)
+    __about_chuan__(dayun.gan_zhu, bazi, jianyi, cankao)
+    __about_chuan__(dayun.zhi_zhu, bazi, jianyi, cankao)
+
+
+def __about_liunian__(liunian: LiuNian, jianyi: [], cankao: [], bazi: BaZi):
+    full_gan_shishen = __get_shishen_full_name__(liunian.gan_zhu.shi_shen)
+    full_zhi_shishen = __get_shishen_full_name__(liunian.zhi_zhu.shi_shen)
+    content = "\n" + str(liunian.year) + " " + liunian.gan_text + liunian.zhi_text + "年,"
+    content += "以" + full_gan_shishen + full_zhi_shishen + "运为主,"
+    tip1 = Configs.get_value(Configs.config_zhenduan_dayun, liunian.gan_zhu.shi_shen)
+    tip2 = Configs.get_value(Configs.config_zhenduan_dayun, liunian.zhi_zhu.shi_shen)
+    if tip1 is not None and tip2 is not None:
+        content += tip1 + "同时" + tip2
+
+    item = ZhenDuanItem(0, content)
+    item.set_selected(True)
+    jianyi.append(item)
+    __about_he__(liunian.gan_zhu, bazi, jianyi, cankao)
+    __about_he__(liunian.zhi_zhu, bazi, jianyi, cankao)
+    __about_an_he__(liunian.gan_zhu, bazi, jianyi, cankao)
+    __about_an_he__(liunian.zhi_zhu, bazi, jianyi, cankao)
+    __about_chong__(liunian.gan_zhu, bazi, jianyi, cankao)
+    __about_chong__(liunian.zhi_zhu, bazi, jianyi, cankao)
+    __about_xing__(liunian.gan_zhu, bazi, jianyi, cankao)
+    __about_xing__(liunian.zhi_zhu, bazi, jianyi, cankao)
+    __about_chuan__(liunian.gan_zhu, bazi, jianyi, cankao)
+    __about_chuan__(liunian.zhi_zhu, bazi, jianyi, cankao)
+
+
+def __about_he__(sz: SiZhu, bazi: BaZi, jianyi: [], cankao: []):
+    ct_he = 0
+    more_shishen = ""
+    # 高能
+    for gn in sz.gaonengs:
+        if gn.guanxi == "合":
+            __do_check__(gn, bazi, Configs.config_gaoneng_he, jianyi, cankao)
+            ct_he += 1
+            more_shishen = gn.shi_shen2
+    if ct_he > 1:
+        __check_zheng_he__(sz.shi_shen, more_shishen, jianyi, cankao)
+
+
+def __about_an_he__(sz: SiZhu, bazi: BaZi, jianyi: [], cankao: []):
+    for gn in sz.gaonengs:
+        if gn.guanxi == "暗合":
+            __do_check__(gn, bazi, Configs.config_gaoneng_anhe, jianyi, cankao)
+
+
+def __about_chong__(sz: SiZhu, bazi: BaZi, jianyi: [], cankao: []):
+    for gn in sz.gaonengs:
+        if gn.guanxi == "冲":
+            __do_check__(gn, bazi, Configs.config_gaoneng_chong, jianyi, cankao)
+
+
+def __about_xing__(sz: SiZhu, bazi: BaZi, jianyi: [], cankao: []):
+    for gn in sz.gaonengs:
+        if gn.guanxi == "刑":
+            __do_check_xing__(gn, bazi, jianyi, cankao)
+
+
+def __about_chuan__(sz: SiZhu, bazi: BaZi, jianyi: [], cankao: []):
+    for gn in sz.gaonengs:
+        if gn.guanxi == "穿":
+            __do_check__(gn, bazi, Configs.config_gaoneng_chuan, jianyi, cankao)
+
+
+def __check_zheng_he__(single: str, more: str, jianyi: [], cankao: []):
+    tip = Configs.get_value2(Configs.config_zheng_he, single, more)
+    if tip is not None:
+        item = ZhenDuanItem(0, tip)
+        item.set_selected(True)
+        jianyi.append(item)
+    else:
+        print("争合:", single, more, "找不到对一个的描述")
+
+
+def __do_check__(gn: GaoNeng, bazi: BaZi, data_src: {}, jianyi: [], cankao: []):
+    data = Configs.get_value(data_src, gn.shi_shen1 + gn.shi_shen2)
+    if data is None:
+        data = Configs.get_value(data_src, gn.shi_shen2 + gn.shi_shen1)
+    if data is not None:
+        for dt in data:
+            jiedu = dt["解读"]
+
+            if gn.guanxi == "冲":
+                power1 = __get_power__(gn.shi_shen1, bazi)
+                power2 = __get_power__(gn.shi_shen2, bazi)
+                tag = "平"
+                if power1 > power2 * 2:
+                    tag = "胜"
+                elif power1 * 2 < power2:
+                    tag = "负"
+                jiedu += dt[tag]
+
+            full_name1 = __get_shishen_full_name__(gn.shi_shen1)
+            full_name2 = __get_shishen_full_name__(gn.shi_shen2)
+            content = full_name1 + gn.guanxi + full_name2 + "," + jiedu
+
+            # if gn.guanxi in ["穿"]:
+            #     zhu1 = __get_zhu_by_weizhi__(gn.wei_zhi1, bazi)
+            #     other_text = __get_baohuzhe_in_zhu__(zhu1)
+            #     if other_text is None:
+            #         zhu2 = __get_zhu_by_weizhi__(gn.wei_zhi2, bazi)
+            #         other_text = __get_baohuzhe_in_zhu__(zhu2)
+            #     if other_text is not None:
+            #         other_wuxing = Configs.get_value(Configs.config_wuxing, other_text)
+            #         content += "(受" + other_text + other_wuxing + "的保护,负面的影响会被削弱)"
+
+            item = ZhenDuanItem(0, content)
+            item.key = gn.text
+
+            if dt["类别"] == "建议":
+                item.set_selected(True)
+                jianyi.append(item)
+            else:
+                cankao.append(item)
+    else:
+        print("没找到匹配的关系在:", gn.shi_shen1 + gn.shi_shen2, gn.guanxi)
+
+
+def __do_check_xing__(gn: GaoNeng, bazi: BaZi, jianyi: [], cankao: []):
+    data = Configs.get_value(Configs.config_gaoneng_xing, gn.text)
+    if data is not None:
+        content = ""
+        jie_fang = ""
+        for chu in data["刑出"]:
+            chu_shishen = Configs.get_value2(Configs.config_shishen, bazi.ri_gan.text, chu)
+            full_name = __get_shishen_full_name__(chu_shishen)
+            jie_fang += full_name
+            if chu_shishen in ["官", "杀"]:
+                content += full_name + "被刑,容易被目标吊着,总是差一点能够到。"
+            elif chu_shishen in ["印", "枭"]:
+                content += full_name + "被刑,得到的帮助都有代价,甚至与自身深度绑定。"
+            elif chu_shishen in ["财", "才"]:
+                content += full_name + "被刑,需要持续的投入财富、精力,持续的输血。"
+            elif chu_shishen in ["食", "伤"]:
+                content += full_name + "被刑,有力没处使,甚至感觉怀才不遇,情绪深陷其中。"
+            elif chu_shishen in ["比", "劫"]:
+                content += full_name + "被刑,自身、朋友、团队都被深度绑定,陷入漩涡。"
+
+        # chong = data["刑冲"][0]
+        # chong_shishen1 = Configs.get_value2(Configs.config_shishen, bazi.ri_gan.text, chong[0])
+        # chong_shishen2 = Configs.get_value2(Configs.config_shishen, bazi.ri_gan.text, chong[1])
+        # chong_data = Configs.get_value(Configs.config_gaoneng_chong, chong_shishen1 + chong_shishen2)
+        # for cd in chong_data:
+        #     jiedu = cd["解读"]
+        #     power1 = __get_power__(chong_shishen1, bazi)
+        #     power2 = __get_power__(chong_shishen2, bazi)
+        #     tag = "平"
+        #     if power1 > power2 * 2:
+        #         tag = "胜"
+        #     elif power1 * 2 < power2:
+        #         tag = "负"
+        #     jiedu += cd[tag]
+        #     content += jiedu
+
+        # zhu1 = __get_zhu_by_weizhi__(gn.wei_zhi1, bazi)
+        # other_text = __get_baohuzhe_in_zhu__(zhu1)
+        # if other_text is None:
+        #     zhu2 = __get_zhu_by_weizhi__(gn.wei_zhi2, bazi)
+        #     other_text = __get_baohuzhe_in_zhu__(zhu2)
+        # if other_text is not None:
+        #     other_wuxing = Configs.get_value(Configs.config_wuxing, other_text)
+        #     content += "(受" + other_text + other_wuxing + "的保护,负面影响会被削弱)"
+
+        item = ZhenDuanItem(0, content)
+        item.key = gn.text
+        item.set_selected(True)
+        jianyi.append(item)
+
+    else:
+        print("没找到匹配的关系在:", gn.text)
+
+
+def __get_zhu_by_weizhi__(weizhi: int, bazi: BaZi):
+    if weizhi == Configs.const_nian_gan:
+        return bazi.nian_gan
+    if weizhi == Configs.const_yue_gan:
+        return bazi.yue_gan
+    if weizhi == Configs.const_ri_gan:
+        return bazi.ri_gan
+    if weizhi == Configs.const_shi_gan:
+        return bazi.shi_gan
+    if weizhi == Configs.const_nian_zhi:
+        return bazi.nian_zhi
+    if weizhi == Configs.const_yue_zhi:
+        return bazi.yue_zhi
+    if weizhi == Configs.const_ri_zhi:
+        return bazi.ri_zhi
+    if weizhi == Configs.const_shi_zhi:
+        return bazi.shi_zhi
+
+
+def __get_baohuzhe_in_zhu__(zhu: SiZhu):
+    result = None
+    self_text = zhu.text
+    for gn in zhu.gaonengs:
+        if gn.guanxi == "合":
+            result = str(gn.text).replace("合", "").replace(self_text, "")
+            break
+        elif gn.guanxi == "暗合":
+            result = str(gn.text).replace("暗合", "").replace(self_text, "")
+            break
+    return result
+
+
+def __get_power__(shishen: str, bazi: BaZi):
+    step = bazi.power_steps[shishen]
+    amount = bazi.counter.power_raw[shishen]
+    return round(step * amount, 0)
+
+
+def __find_dayun_liunian__(year: int, bazi: BaZi, dayun_list: [DaYun], liunian_list: [LiuNian]):
+    target_dayun = None
+    target_dayun_index = -1
+    for index, dayun in enumerate(bazi.dayun):
+        if dayun.start_year <= year and year <= dayun.end_year:
+            target_dayun = dayun
+            target_dayun_index = index
+            break
+
+    if target_dayun is not None:
+        target_liunian_index = -1
+        target_liunian = None
+        for index, liunian in enumerate(target_dayun.liunian):
+            if liunian.year == year:
+                target_liunian = liunian
+                target_liunian_index = index
+                break
+        if target_liunian is not None:
+            dayun_list.append(target_dayun)
+            liunian_list.append(target_liunian)
+            while len(dayun_list) < 3:
+                if target_liunian_index < len(target_dayun.liunian) - 1:
+                    target_liunian_index += 1
+                    dayun_list.append(target_dayun)
+                    liunian_list.append(target_dayun.liunian[target_liunian_index])
+                else:
+                    if target_dayun_index < len(bazi.dayun) - 1:
+                        target_dayun_index += 1
+                        target_dayun = bazi.dayun[target_dayun_index]
+                        target_liunian_index = 0
+                        dayun_list.append(target_dayun)
+                        liunian_list.append(target_dayun.liunian[target_liunian_index])
+                    else:
+                        break
+        else:
+            print("未找到匹配的流年:", year)
+    else:
+        print("未找到匹配的大运:", year)
+
+
+def __get_shishen_full_name__(ss: str):
+    if ss == "官":
+        return "正官"
+    elif ss == "杀":
+        return "七杀"
+    elif ss == "财":
+        return "正财"
+    elif ss == "才":
+        return "偏财"
+    elif ss == "印":
+        return "正印"
+    elif ss == "枭":
+        return "偏印"
+    elif ss == "食":
+        return "食神"
+    elif ss == "伤":
+        return "伤官"
+    elif ss == "比":
+        return "比肩"
+    elif ss == "劫":
+        return "劫财"
+    return None

+ 310 - 0
yixue/zhenduan/AboutGaoNeng.py

@@ -0,0 +1,310 @@
+from yixue import Configs
+from yixue.Models import BaZi, GaoNeng, ZhenDuanItem, ZhenDuan, SiZhu
+
+
+# 看高能的逻辑:
+# 合,直接得到,通过什么得到了什么
+# 暗合,合的基础上,转暗中。
+# 冲:通过怎样的变动得到,能否得到,被什么化解(六合、半合、暗合)(保护没写,讲道理冲不一定是坏事,未必要化解)
+# 刑:会被什么拖住,产生什么冲突,被什么化解(六合、半合、暗合)(刑冲没写)
+# 穿:什么受伤严重,被什么化解(六合、半合、暗合)
+# 破:是否得到,没得到忽略,有得到的话得到的什么不完整,被什么化解(六合、半合、暗合)(暂时没写,更前面的重复度高)
+# 三会:什么的力量很强,但是要小心什么破局,破局后呈现什么后果,后果被什么化解(六合、半合、暗合)(暂时没写)
+
+
+def run(bazi: BaZi):
+    resolved_keys: [str] = []  # 避免14柱和41柱都被解读一次
+    __about_he__(bazi, resolved_keys)
+    __about_an_he__(bazi, resolved_keys)
+    __about_chong__(bazi, resolved_keys)
+    __about_xing__(bazi, resolved_keys)
+    __about_chuan__(bazi, resolved_keys)
+
+
+def __about_he__(bazi: BaZi, resolved_keys: [str]):
+    for sz in bazi.all_zhus():
+        ct_he = 0
+        more_shishen = ""
+        he_key = ""
+        for gn in sz.gaonengs:
+            if gn.guanxi == "合":
+                __do_check__(gn, bazi, resolved_keys, Configs.config_gaoneng_he)
+                ct_he += 1
+                more_shishen = gn.shi_shen2
+                he_key = __get_map_key__(gn)
+        if ct_he > 1:
+            __check_zheng_he__(sz.shi_shen, more_shishen, he_key, bazi.zhenduan.gaoneng)
+
+
+def __about_an_he__(bazi: BaZi, resolved_keys: [str]):
+    for sz in bazi.all_zhus():
+        for gn in sz.gaonengs:
+            if gn.guanxi == "暗合":
+                __do_check__(gn, bazi, resolved_keys, Configs.config_gaoneng_anhe)
+
+
+def __about_chong__(bazi: BaZi, resolved_keys: [str]):
+    for sz in bazi.all_zhus():
+        for gn in sz.gaonengs:
+            if gn.guanxi == "冲":
+                __do_check__(gn, bazi, resolved_keys, Configs.config_gaoneng_chong)
+
+
+def __about_xing__(bazi: BaZi, resolved_keys: [str]):
+    for sz in bazi.all_zhus():
+        for gn in sz.gaonengs:
+            if gn.guanxi == "刑":
+                __do_check_xing__(gn, bazi, resolved_keys)
+
+
+def __about_chuan__(bazi: BaZi, resolved_keys: [str]):
+    for sz in bazi.all_zhus():
+        for gn in sz.gaonengs:
+            if gn.guanxi == "穿":
+                __do_check__(gn, bazi, resolved_keys, Configs.config_gaoneng_chuan)
+
+
+def __do_check__(gn: GaoNeng, bazi: BaZi, resolved_keys: [str], data_src: {}):
+    resolved_key = __get_gongneng_key(gn)
+    if resolved_keys.__contains__(resolved_key):
+        return
+
+    data = Configs.get_value(data_src, gn.shi_shen1 + gn.shi_shen2)
+    if data is None:
+        data = Configs.get_value(data_src, gn.shi_shen2 + gn.shi_shen1)
+    if data is not None:
+        for dt in data:
+
+            jiedu = dt["解读"]
+            if gn.guanxi == "冲":
+                power1 = __get_power__(gn.shi_shen1, bazi)
+                power2 = __get_power__(gn.shi_shen2, bazi)
+                tag = "平"
+                if power1 > power2 * 2:
+                    tag = "胜"
+                elif power1 * 2 < power2:
+                    tag = "负"
+                jiedu += dt[tag]
+
+            full_name1 = __get_shishen_full_name__(gn.shi_shen1)
+            full_name2 = __get_shishen_full_name__(gn.shi_shen2)
+            content = full_name1 + gn.guanxi + full_name2 + "," + jiedu
+
+            if gn.guanxi in ["穿"]:
+                zhu1 = __get_zhu_by_weizhi__(gn.wei_zhi1, bazi)
+                other_text = __get_baohuzhe_in_zhu__(zhu1)
+                if other_text is None:
+                    zhu2 = __get_zhu_by_weizhi__(gn.wei_zhi2, bazi)
+                    other_text = __get_baohuzhe_in_zhu__(zhu2)
+                if other_text is not None:
+                    other_wuxing = Configs.get_value(Configs.config_wuxing, other_text)
+                    content += "(受" + other_text + other_wuxing + "的保护,负面的影响会被削弱)"
+
+            item = ZhenDuanItem(0, content)
+            item.key = gn.text
+
+            if dt["类别"] == "建议":
+                item.set_selected(True)
+            __add_gaoneng_zhenduan__(__get_map_key__(gn), item, bazi.zhenduan.gaoneng)
+    else:
+        print("没找到匹配的关系在:", gn.shi_shen1 + gn.shi_shen2, gn.guanxi)
+    resolved_keys.append(resolved_key)
+
+
+def __do_check_xing__(gn: GaoNeng, bazi: BaZi, resolved_keys: [str]):
+    resolved_key = __get_gongneng_key(gn)
+    if resolved_keys.__contains__(resolved_key):
+        return
+    data = Configs.get_value(Configs.config_gaoneng_xing, gn.text)
+    if data is not None:
+        content = ""
+        jie_fang = ""
+        for chu in data["刑出"]:
+            chu_shishen = Configs.get_value2(Configs.config_shishen, bazi.ri_gan.text, chu)
+            full_name = __get_shishen_full_name__(chu_shishen)
+            jie_fang += full_name
+            if chu_shishen in ["官", "杀"]:
+                content += full_name + "被刑,容易被目标吊着,总是差一点能够到。"
+            elif chu_shishen in ["印", "枭"]:
+                content += full_name + "被刑,得到的帮助都有代价,甚至与自身深度绑定。"
+            elif chu_shishen in ["财", "才"]:
+                content += full_name + "被刑,需要持续的投入财富、精力,持续的输血。"
+            elif chu_shishen in ["食", "伤"]:
+                content += full_name + "被刑,有力没处使,甚至感觉怀才不遇,情绪深陷其中。"
+            elif chu_shishen in ["比", "劫"]:
+                content += full_name + "被刑,自身、朋友、团队都被深度绑定,陷入漩涡。"
+
+        # chong = data["刑冲"][0]
+        # chong_shishen1 = Configs.get_value2(Configs.config_shishen, bazi.ri_gan.text, chong[0])
+        # chong_shishen2 = Configs.get_value2(Configs.config_shishen, bazi.ri_gan.text, chong[1])
+        # chong_data = Configs.get_value(Configs.config_gaoneng_chong, chong_shishen1 + chong_shishen2)
+        # for cd in chong_data:
+        #     jiedu = cd["解读"]
+        #     power1 = __get_power__(chong_shishen1, bazi)
+        #     power2 = __get_power__(chong_shishen2, bazi)
+        #     tag = "平"
+        #     if power1 > power2 * 2:
+        #         tag = "胜"
+        #     elif power1 * 2 < power2:
+        #         tag = "负"
+        #     jiedu += cd[tag]
+        #     content += jiedu
+
+        zhu1 = __get_zhu_by_weizhi__(gn.wei_zhi1, bazi)
+        other_text = __get_baohuzhe_in_zhu__(zhu1)
+        if other_text is None:
+            zhu2 = __get_zhu_by_weizhi__(gn.wei_zhi2, bazi)
+            other_text = __get_baohuzhe_in_zhu__(zhu2)
+        if other_text is not None:
+            other_wuxing = Configs.get_value(Configs.config_wuxing, other_text)
+            content += "(受" + other_text + other_wuxing + "的保护,负面影响会被削弱)"
+
+        item = ZhenDuanItem(0, content)
+        item.key = gn.text
+        item.set_selected(True)
+        __add_gaoneng_zhenduan__(__get_map_key__(gn), item, bazi.zhenduan.gaoneng)
+
+    else:
+        print("没找到匹配的关系在:", gn.text)
+    resolved_keys.append(resolved_key)
+
+
+def __get_baohuzhe_in_zhu__(zhu: SiZhu):
+    result = None
+    self_text = zhu.text
+    for gn in zhu.gaonengs:
+        if gn.guanxi == "合":
+            result = str(gn.text).replace("合", "").replace(self_text, "")
+            break
+        elif gn.guanxi == "暗合":
+            result = str(gn.text).replace("暗合", "").replace(self_text, "")
+            break
+    return result
+
+
+def __get_zhu_by_weizhi__(weizhi: int, bazi: BaZi):
+    if weizhi == Configs.const_nian_gan:
+        return bazi.nian_gan
+    if weizhi == Configs.const_yue_gan:
+        return bazi.yue_gan
+    if weizhi == Configs.const_ri_gan:
+        return bazi.ri_gan
+    if weizhi == Configs.const_shi_gan:
+        return bazi.shi_gan
+    if weizhi == Configs.const_nian_zhi:
+        return bazi.nian_zhi
+    if weizhi == Configs.const_yue_zhi:
+        return bazi.yue_zhi
+    if weizhi == Configs.const_ri_zhi:
+        return bazi.ri_zhi
+    if weizhi == Configs.const_shi_zhi:
+        return bazi.shi_zhi
+
+
+def __check_zheng_he__(single: str, more: str, he_key: str, map: {}):
+    tip = Configs.get_value2(Configs.config_zheng_he, single, more)
+    if tip is not None:
+        item = ZhenDuanItem(0, tip)
+        item.set_selected(True)
+        __add_gaoneng_zhenduan__(he_key, item, map)
+    else:
+        print("争合:", single, more, "找不到对一个的描述")
+
+
+def __add_gaoneng_zhenduan__(map_key: str, item: ZhenDuanItem, map: {}):
+    if not map.__contains__(map_key):
+        map[map_key] = ZhenDuan()
+
+    if item.defaultSelected:
+        found = False
+        for obj in map[map_key].jianyi:
+            if obj.key == item.key:
+                found = True
+                break
+        if not found:
+            map[map_key].jianyi.append(item)
+        else:
+            item.set_selected(False)
+            item.tip = "重复项"
+            map[map_key].cankao.append(item)
+    else:
+        map[map_key].cankao.append(item)
+
+
+def __get_shishen_full_name__(ss: str):
+    if ss == "官":
+        return "正官"
+    elif ss == "杀":
+        return "七杀"
+    elif ss == "财":
+        return "正财"
+    elif ss == "才":
+        return "偏财"
+    elif ss == "印":
+        return "正印"
+    elif ss == "枭":
+        return "偏印"
+    elif ss == "食":
+        return "食神"
+    elif ss == "伤":
+        return "伤官"
+    elif ss == "比":
+        return "比肩"
+    elif ss == "劫":
+        return "劫财"
+    return None
+
+
+def __get_power__(shishen: str, bazi: BaZi):
+    step = bazi.power_steps[shishen]
+    amount = bazi.counter.power_raw[shishen]
+    return round(step * amount, 0)
+
+
+def __get_gongneng_key(gn: GaoNeng):
+    key = gn.text + "_"
+    indexs = [gn.wei_zhi1, gn.wei_zhi2]
+    if gn.arg3 is not None:
+        indexs.append(gn.wei_zhi3)
+    indexs.sort()
+    for i in indexs:
+        key += str(i)
+    return key
+
+
+def __is_guanxi__(gn: GaoNeng, shishen1: str, shishen2: str, guanxi: str):
+    result = False
+    keys = [gn.shi_shen1, gn.shi_shen2]
+    if gn.arg3 is not None:
+        keys.append(gn.shi_shen3)
+    if shishen1 in keys and shishen2 in keys and gn.guanxi == guanxi:
+        result = True
+    return result
+
+
+def __get_map_key__(gn: GaoNeng):
+    key = gn.text[0] + gn.text[1]
+    if gn.arg3 is not None:
+        key += gn.text[2]
+    return key
+
+
+def __test_gaoneng__():
+    temp = {}
+    for tg in Configs.config_tiangan_list:
+        for key in Configs.config_gaoneng:
+            data = Configs.config_gaoneng[key]
+            guanxi = data["guanxi"]
+            args = key.replace(guanxi, "")
+            ss1 = Configs.get_value2(Configs.config_shishen, tg, args[0])
+            ss2 = Configs.get_value2(Configs.config_shishen, tg, args[1])
+            k = ss1 + ss2 + guanxi
+            if not temp.__contains__(guanxi):
+                temp[guanxi] = {}
+            if not temp[guanxi].__contains__(ss1):
+                temp[guanxi][ss1] = []
+            if not temp[guanxi][ss1].__contains__(k):
+                temp[guanxi][ss1].append(k)
+            if guanxi == "合" and ss1 == "官" and ss2 == "杀":
+                print(tg, data)
+    print(temp)

+ 289 - 0
yixue/zhenduan/AboutGeJu.py

@@ -0,0 +1,289 @@
+from yixue import Configs
+from yixue.Models import BaZi, ZhenDuanItem
+
+
+# 格局和力量无关,只和日元有关,格局是否触发看大运流年
+
+def run(bazi: BaZi, ss_per: {}):
+    jianyi = []
+    cankao = []
+    __check_guan__(bazi, ss_per, jianyi, cankao)
+    __check_sha__(bazi, ss_per, jianyi, cankao)
+    __check_yin__(bazi, ss_per, jianyi, cankao)
+    __check_xiao__(bazi, ss_per, jianyi, cankao)
+    __check_shi__(bazi, ss_per, jianyi, cankao)
+    __check_jie__(bazi, ss_per, jianyi, cankao)
+    __check_cai__(bazi, ss_per, jianyi, cankao)
+    bazi.zhenduan.geju.jianyi = jianyi
+    bazi.zhenduan.geju.cankao = cankao
+
+
+def __check_guan__(bazi: BaZi, ss_per: {}, jianyi: [], cankao: []):
+    key1 = "官"
+    name1 = "伤官冲官"
+    xj = __find_xiong_ji__(bazi, key1, name1)
+    if xj is not None:
+        p1 = ss_per["官"]
+        p2 = ss_per["伤"]
+        tip = xj.tip
+        name = name1
+        if p1 > p2 * 2:
+            tip += "但自身力量不足,可能无法冲破束缚,需要多实践,避免空谈。"
+        elif p2 > p1 * 2:
+            tip += "自身力量足够攻克困难或推翻权威,但要警惕因越界而导致不好的后果。"
+        item = ZhenDuanItem(0, name, ",", tip)
+        item.set_selected(True)
+        jianyi.append(item)
+
+    key2 = "官"
+    name2 = "劫财冲官"
+    xj2 = __find_xiong_ji__(bazi, key2, name2)
+    if xj2 is not None:
+        p1 = ss_per["官"]
+        p2 = ss_per["劫"]
+        tip = xj2.tip
+        name = name2
+        if p1 > p2 * 2:
+            tip += "务必重新审视合作的合规性,如果涉及动到他人利益,对方势大可徐徐图之,不好操之过急。"
+        elif p2 > p1 * 2:
+            tip += "多用合同、法律保护自己,如果涉及动到他人利益,要警惕对方反扑。"
+        item = ZhenDuanItem(0, name, ",", tip)
+        item.set_selected(True)
+        jianyi.append(item)
+
+    key3 = "官"
+    name3 = "暗合财星"
+    xj3 = __find_xiong_ji__(bazi, key3, name3)
+    if xj3 is not None:
+        tip = xj3.tip
+        name = name3
+        item = ZhenDuanItem(0, name, ",", tip)
+        item.set_selected(True)
+        jianyi.append(item)
+
+    key4 = "官"
+    name4 = "官印相生"
+    xj4 = __find_xiong_ji__(bazi, key4, name4)
+    if xj4 is not None:
+        tip = xj4.tip
+        name = name4
+        item = ZhenDuanItem(0, name, ",", tip)
+        item.set_selected(True)
+        jianyi.append(item)
+
+    key5 = "官"
+    name5 = "官制劫财"
+    xj5 = __find_xiong_ji__(bazi, key5, name5)
+    if xj5 is not None:
+        tip = xj5.tip
+        name = name5
+        p1 = ss_per["官"]
+        p2 = ss_per["劫"]
+        if p1 > p2 * 2:
+            tip += "八字中正官的力量很强,可以很好的保护自身财富,避开祸害。"
+        elif p2 > p1 * 2:
+            tip += "八字中正官的力量不足,无法完全保护自身财富,还是会遭受部分损失。"
+        item = ZhenDuanItem(0, name, ",", tip)
+        item.set_selected(True)
+        jianyi.append(item)
+
+
+def __check_sha__(bazi: BaZi, ss_per: {}, jianyi: [], cankao: []):
+    key1 = "杀"
+    name1 = "七杀攻身"
+    xj1 = __find_xiong_ji__(bazi, key1, name1)
+    if xj1 is not None:
+        tip = xj1.tip
+        name = name1
+        p1 = ss_per["杀"]
+        p2 = ss_per["比劫"]
+        p3 = ss_per["食伤"]
+        p4 = ss_per["印绶"]
+        if p1 > (p2 + p3 + p4):
+            tip += "自身力量不足,得到的帮助也少,应审视自身,做力所能及的事情。"
+        else:
+            if max(p2, p3, p4) == p2:
+                tip += "但可以得到同伴的帮助,和同伴协力能减轻自身压力负担。"
+            elif max(p2, p3, p4) == p3:
+                tip += "但自身能力不弱,交际圈广,可以充分发挥自身特长把压力转换为机会。"
+            elif max(p2, p3, p4) == p4:
+                tip += "但容易得贵人相助,化解压力,无法解决的问题不妨向外求助。"
+        item = ZhenDuanItem(0, name, ",", tip)
+        item.set_selected(True)
+        jianyi.append(item)
+
+    key2 = "杀"
+    name2 = "七杀劫财"
+    xj2 = __find_xiong_ji__(bazi, key2, name2)
+    if xj2 is not None:
+        tip = xj2.tip
+        name = name2
+        item = ZhenDuanItem(0, name, ",", tip)
+        item.set_selected(True)
+        jianyi.append(item)
+
+    key3 = "杀"
+    name3 = "七杀伤官"
+    xj3 = __find_xiong_ji__(bazi, key3, name3)
+    if xj3 is not None:
+        tip = xj3.tip
+        name = name3
+        p1 = ss_per["杀"]
+        p2 = ss_per["伤"]
+        if p1 > p2 * 2:
+            tip += "八字中伤官较弱,承接事务时应客观审视,能拒绝的应学会拒绝,无法拒绝的要学会找人帮忙。"
+        elif p2 > p1 * 2:
+            tip += "八字中伤官不弱,自身动力很强,可以承接的住,但是会比较累自己。"
+        item = ZhenDuanItem(0, name, ",", tip)
+        item.set_selected(True)
+        jianyi.append(item)
+
+    key4 = "杀"
+    name4 = "杀印相生"
+    xj4 = __find_xiong_ji__(bazi, key4, name4)
+    if xj4 is not None:
+        tip = xj4.tip
+        name = name4
+        item = ZhenDuanItem(0, name, ",", tip)
+        item.set_selected(True)
+        jianyi.append(item)
+
+
+def __check_yin__(bazi: BaZi, ss_per: {}, jianyi: [], cankao: []):
+    key1 = "印"
+    name1 = "食伤合印"
+    xj1 = __find_xiong_ji__(bazi, key1, name1)
+    if xj1 is not None:
+        tip = xj1.tip
+        name = name1
+        item = ZhenDuanItem(0, name, ",", tip)
+        item.set_selected(True)
+        jianyi.append(item)
+
+    key2 = "印"
+    name2 = "财小印大"
+    xj2 = __find_xiong_ji__(bazi, key2, name2)
+    if xj2 is not None:
+        tip = xj2.tip
+        name = name2
+        item = ZhenDuanItem(0, name, ",", tip)
+        item.set_selected(True)
+        jianyi.append(item)
+
+    key3 = "印"
+    name3 = "印禄相随"
+    xj3 = __find_xiong_ji__(bazi, key3, name3)
+    if xj3 is not None:
+        tip = xj3.tip
+        name = name3
+        item = ZhenDuanItem(0, name, ",", tip)
+        item.set_selected(True)
+        jianyi.append(item)
+
+
+def __check_xiao__(bazi: BaZi, ss_per: {}, jianyi: [], cankao: []):
+    key1 = "枭"
+    name1 = "枭神夺食"
+    xj1 = __find_xiong_ji__(bazi, key1, name1)
+    if xj1 is not None:
+        tip = xj1.tip
+        name = name1
+        item = ZhenDuanItem(0, name, ",", tip)
+        item.set_selected(True)
+        jianyi.append(item)
+
+
+def __check_shi__(bazi: BaZi, ss_per: {}, jianyi: [], cankao: []):
+    key1 = "食"
+    name1 = "食神制杀"
+    xj1 = __find_xiong_ji__(bazi, key1, name1)
+    if xj1 is not None:
+        tip = xj1.tip
+        name = name1
+        item = ZhenDuanItem(0, name, ",", tip)
+        item.set_selected(True)
+        jianyi.append(item)
+
+
+def __check_jie__(bazi: BaZi, ss_per: {}, jianyi: [], cankao: []):
+    key1 = "劫"
+    name1 = "劫财见财"
+    xj1 = __find_xiong_ji__(bazi, key1, name1)
+    if xj1 is not None:
+        tip = xj1.tip
+        name = name1
+        item = ZhenDuanItem(0, name, ",", tip)
+        if __check_exist__(jianyi, "官制劫财"):
+            cankao.append(item)
+        else:
+            item.set_selected(True)
+            jianyi.append(item)
+
+
+def __check_cai__(bazi: BaZi, ss_per: {}, jianyi: [], cankao: []):
+    keys = ["财", "才"]
+    src = {}
+    for ss in Configs.config_shishen_list:
+        src[ss] = 0
+
+    max_value = 0
+    for key in keys:
+        for xj in bazi.geju_xiongji[key]:
+            name = str(xj.name).replace("合", "")
+            src[name] += 1
+            if src[name] > max_value:
+                max_value = src[name]
+
+    if max_value > 1:  # 如果每种财富来源都只有1个,那没什么提的必要
+        for key in src:
+            if src[key] == max_value:
+                tip = Configs.get_value(Configs.config_zhenduan_cai, key)
+                tip += __check_more_info_of_cai__(key, bazi)
+                item = ZhenDuanItem(0, tip)
+                item.set_selected(True)
+                jianyi.append(item)
+
+
+def __check_more_info_of_cai__(key: str, bazi: BaZi):
+    result = ""
+    riyuan = bazi.ri_gan.text
+    gan_zhis = bazi.shishen_guanxi[key]
+    for gz in gan_zhis:
+        gns = Configs.get_value(Configs.config_gaoneng_key, gz)
+        if gns is None:
+            continue
+        for gn in gns:
+            guanxi_key = None
+            if gn["guanxi"] == "穿":
+                guanxi_key = "穿"
+            elif gn["guanxi"] == "刑":
+                guanxi_key = "刑"
+
+            if guanxi_key is not None:
+                name = str(gn["name"]).replace(gz, "").replace(guanxi_key, "")
+                shishen = Configs.get_value2(Configs.config_shishen, riyuan, name)
+                cai_key = guanxi_key + shishen
+                hanyi = Configs.get_value(Configs.config_gaoneng_hanyi_cai, cai_key)
+                if hanyi is not None:
+                    result += hanyi
+    if len(result) > 0:
+        return "但要小心" + result
+    return result
+
+
+def __find_xiong_ji__(bazi: BaZi, key: str, name: str):
+    item = None
+    for xj in bazi.geju_xiongji[key]:
+        if xj.name == name:
+            item = xj
+            break
+    return item
+
+
+def __check_exist__(items: [ZhenDuanItem], key: str):
+    result = False
+    for item in items:
+        if key in item.content:
+            result = True
+            break
+    return result

+ 105 - 0
yixue/zhenduan/AboutJianKang.py

@@ -0,0 +1,105 @@
+from yixue import Configs
+from yixue.Models import BaZi, ZhenDuanItem
+
+
+# 高能(冲引起的健康问题没写,暂时内容够了)
+# 五行平衡,
+# 门户(只写了金火,其他待补充),
+# 金木斗、水火斗
+# 自刑
+# 夺食(没写))
+
+def run(bazi: BaZi, wx_per: {}):
+    jianyi = []
+    cankao = []
+    __about_menhu__(bazi, jianyi, cankao)
+    __about_wuxing_dou__(bazi, jianyi, cankao, wx_per)
+    __about_wuxing_power__(bazi, jianyi, cankao, wx_per)
+    __about_zixing__(bazi, jianyi, cankao)
+    bazi.zhenduan.jiankang.jianyi = jianyi
+    bazi.zhenduan.jiankang.cankao = cankao
+
+
+def __about_menhu__(bazi: BaZi, jianyi: [], cankao: []):
+    # 金+火 = 皮肤过敏
+    zhu_ary = [bazi.nian_gan, bazi.yue_gan, bazi.ri_gan, bazi.shi_gan, bazi.shi_zhi]
+    has_jin = False
+    has_huo = False
+    for zhu in zhu_ary:
+        if zhu.wu_xing == "金":
+            has_jin = True
+        elif zhu.wu_xing == "火":
+            has_huo = True
+    if has_jin and has_huo:
+        item = ZhenDuanItem(0, "皮肤容易过敏。")
+        item.set_selected(True)
+        jianyi.append(item)
+
+
+def __about_wuxing_dou__(bazi: BaZi, jianyi: [], cankao: [], wx_per: {}):
+    # 金木斗、水火斗
+    wx_mu = wx_per["木"] >= 20
+    wx_jin = wx_per["金"] >= 20
+    wx_huo = wx_per["火"] >= 20
+    wx_shui = wx_per["水"] >= 20
+    zuozhi_wuxing = bazi.ri_zhi.wu_xing
+    if zuozhi_wuxing == "木":
+        wx_mu = True
+    elif zuozhi_wuxing == "金":
+        wx_jin = True
+    elif zuozhi_wuxing == "火":
+        wx_huo = True
+    elif zuozhi_wuxing == "水":
+        wx_shui = True
+
+    if wx_mu and wx_jin:
+        item = ZhenDuanItem(0, "金木相斗,容易受外伤。")
+        item.set_selected(True)
+        jianyi.append(item)
+    if wx_huo and wx_shui:
+        item = ZhenDuanItem(0, "水火相斗,容易生闷气,要注意心脑血管方面的健康。")
+        item.set_selected(True)
+        jianyi.append(item)
+
+
+def __about_wuxing_power__(bazi: BaZi, jianyi: [], cankao: [], wx_per: {}):
+    wx_max = ""
+    wx_min = []
+    wx_max_value = 0
+    values = []
+    for wx in wx_per:
+        if wx_per[wx] > wx_max_value:
+            wx_max_value = wx_per[wx]
+            wx_max = wx
+        if wx_per[wx] == 0:
+            wx_min.insert(0, wx)
+        elif wx_per[wx] < 10:
+            wx_min.append(wx)
+
+    # 一个旺,两个衰
+    content_wang = Configs.get_value(Configs.config_zhenduan_jiankang_wuxing, wx_max + "旺")
+    if content_wang is not None:
+        item = ZhenDuanItem(0, wx_max + "旺,容易", content_wang)
+        item.set_selected(True)
+        jianyi.append(item)
+
+    for wx in wx_min:
+        content = Configs.get_value(Configs.config_zhenduan_jiankang_wuxing, wx + "衰")
+        item = ZhenDuanItem(0, wx + "衰,容易", content)
+        item.set_selected(True)
+        jianyi.append(item)
+
+
+def __about_zixing__(bazi: BaZi, jianyi: [], cankao: []):
+    texts = []
+    for dz in bazi.all_di_zhis():
+        for gn in dz.gaonengs:
+            if gn.guanxi == "自刑":
+                if not texts.__contains__(gn.text):
+                    texts.append(gn.text)
+
+    for txt in texts:
+        content = Configs.get_value(Configs.config_zhenduan_jiankang_zixing, txt)
+        item = ZhenDuanItem(0, txt + ",", content)
+        item.set_selected(True)
+        jianyi.append(item)

+ 103 - 0
yixue/zhenduan/AboutMenHu.py

@@ -0,0 +1,103 @@
+from yixue import Configs
+from yixue.Models import BaZi, ZhenDuanItem, PowerQiangRuo
+
+
+def run(bazi: BaZi, qiang_ruo: PowerQiangRuo):
+    jianyi = []
+    cankao = []
+    __about_rizhu__(bazi, jianyi, cankao)
+    __about_men_hu__(bazi, jianyi, cankao)
+    __about_jue_duan_xing_dong__(bazi, jianyi, cankao, qiang_ruo)
+    __about_lu_shen__(bazi, jianyi, cankao)
+    bazi.zhenduan.menhu.jianyi = jianyi
+    bazi.zhenduan.menhu.cankao = cankao
+
+
+def __about_rizhu__(bazi: BaZi, jianyi: [], cankao: []):
+    rigan_wx = bazi.ri_gan.wu_xing
+    rizhi_wx = bazi.ri_zhi.wu_xing
+    v = Configs.get_value2(Configs.config_zhenduan_rizhu, rigan_wx, rizhi_wx)
+    item = ZhenDuanItem(0, bazi.ri_gan.text, v)
+    item.set_selected(True)
+    jianyi.append(item)
+
+
+def __about_men_hu__(bazi: BaZi, jianyi: [], cankao: []):
+    ss = [
+        bazi.nian_gan.shi_shen, bazi.yue_gan.shi_shen, bazi.shi_gan.shi_shen, bazi.shi_zhi.shi_shen
+    ]
+
+    if "财" in ss or "才" in ss:
+        item = ZhenDuanItem(0, "喜欢炫耀自己拥有的东西,需注意财不露白。")
+        item.tip = "要结合性格看是否成立"
+        cankao.append(item)
+
+    if "比" in ss or "劫" in ss:
+        item = ZhenDuanItem(0, "喜欢彰显社会关系,人脉资源。")
+        item.tip = "要结合性格看是否成立"
+        cankao.append(item)
+
+
+def __about_jue_duan_xing_dong__(bazi: BaZi, jianyi: [], cankao: [], qiang_ruo: PowerQiangRuo):
+    # 决断力、行动力、感性理性、情商、智商、学科
+    # 判断为弱的都要判断下坐支(前面计算强弱力量的时候都考虑了坐支,这里就不再一一判断了)
+
+    if qiang_ruo.huo_ruo and qiang_ruo.shi_shang_ruo:
+        item = ZhenDuanItem(0, "行动力不足,做事容易拖拉。")
+        item.set_selected(True)
+        jianyi.append(item)
+
+    if qiang_ruo.jin_ruo:
+        item = ZhenDuanItem(0, "决断力不足,容易踌躇不前。")
+        item.set_selected(True)
+        jianyi.append(item)
+
+    if qiang_ruo.huo_wang and qiang_ruo.mu_wang:
+        item = ZhenDuanItem(0, "思考问题比较感性,容易受情绪左右,文科较好。")
+        item.set_selected(True)
+        jianyi.append(item)
+    elif qiang_ruo.jin_wang and qiang_ruo.shui_wang:
+        item = ZhenDuanItem(0, "思考问题比较理性客观,有时候也容易让人觉得冷漠无情,理科较好。")
+        item.set_selected(True)
+        jianyi.append(item)
+    elif qiang_ruo.tu_wang:
+        item = ZhenDuanItem(0, "善于钻研,具有艺术天赋。")
+        item.set_selected(True)
+        jianyi.append(item)
+
+    if qiang_ruo.huo_wang and qiang_ruo.shi_shang_wang:
+        item = ZhenDuanItem(0, "情商高。")
+        item.set_selected(True)
+        jianyi.append(item)
+
+    if qiang_ruo.shui_wang:
+        item = ZhenDuanItem(0, "极具智慧。")
+        item.set_selected(True)
+        jianyi.append(item)
+
+
+def __about_lu_shen__(bazi: BaZi, jianyi: [], cankao: []):
+    for index, dz in enumerate(bazi.all_di_zhis()):
+        if "禄神" in dz.shenshas or "半禄" in dz.shenshas:
+            s = None
+            if index == 0:
+                s = "祖上有积累,物质基础不错。"
+                if dz.has_guanxi_in_gaonengs(["破", "穿"]):
+                    s += "但是有破败之相,无法完全得到。"
+                elif dz.has_guanxi_in_gaonengs(["冲", "刑"]):
+                    s += "但是纷争多,牵扯不断。"
+            elif index == 1:
+                s = "家境不错,父母提供了较好的物质基础。"
+                if dz.has_guanxi_in_gaonengs(["破", "穿"]):
+                    s += "但是有破败之相,无法完全得到。"
+                elif dz.has_guanxi_in_gaonengs(["冲", "刑"]):
+                    s += "但是纷争多,牵扯不断。"
+            elif index == 2:
+                s = "自身有很好的赚钱能力,也喜欢为自己花钱,爱自己更多一些。"
+            elif index == 3:
+                s = "子女孝顺,晚年不愁。"
+
+            if s is not None:
+                item = ZhenDuanItem(0, s)
+                item.set_selected(True)
+                jianyi.append(item)

+ 396 - 0
yixue/zhenduan/AboutQingGan.py

@@ -0,0 +1,396 @@
+from yixue import Configs
+from yixue.Models import BaZi, ZhenDuanItem, PowerQiangRuo, SiZhu, XiongJi
+
+
+def run(bazi: BaZi, qiang_ruo: PowerQiangRuo):
+    jianyi = []
+    cankao = []
+    __check_menhu_zuozhi__(bazi, jianyi, cankao, qiang_ruo)
+    __check_tao_hua__(bazi, jianyi, cankao)
+    __check_rizhi__(bazi, jianyi, cankao)
+    __check_others__(bazi, jianyi, cankao)
+    bazi.zhenduan.qinggan.jianyi = jianyi
+    bazi.zhenduan.qinggan.cankao = cankao
+
+
+def __check_menhu_zuozhi__(bazi: BaZi, jianyi: [], cankao: [], qiang_ruo: PowerQiangRuo):
+    menhu_wuxing = [
+        bazi.nian_gan.wu_xing, bazi.yue_gan.wu_xing, bazi.ri_gan.wu_xing, bazi.shi_gan.wu_xing, bazi.shi_zhi.wu_xing
+    ]
+    jiali_shishen = [
+        bazi.ri_gan.shi_shen, bazi.shi_gan.shi_shen, bazi.ri_zhi.shi_shen, bazi.shi_zhi.shi_shen
+    ]
+
+    if "金" in menhu_wuxing and "水" in menhu_wuxing:
+        item = ZhenDuanItem(0, "金水挂门户,长的好看,皮肤白皙。")
+        item.set_selected(True)
+        jianyi.append(item)
+
+    if bazi.shi_gan.shi_shen in ["官", "杀"]:
+        if not bazi.is_man:
+            item = ZhenDuanItem(0, "官杀星挂门外,不是太重视配偶。")
+            cankao.append(item)
+
+    if not bazi.is_man:
+
+        if __has_geju__(bazi.geju_xiongji["官"], "伤官冲官"):
+            item = ZhenDuanItem(0, "伤官冲官,容易与配偶争吵。")
+            item.set_selected(True)
+            jianyi.append(item)
+
+        if __has_geju__(bazi.geju_xiongji["杀"], "七杀攻身"):
+            item = ZhenDuanItem(0, "七杀攻身,容易遇到不合适的人,情路坎坷。")
+            item.set_selected(True)
+            jianyi.append(item)
+
+        if qiang_ruo.guan_sha_ruo:
+            item = ZhenDuanItem(0, "官杀弱,不太看得上男人,容易晚婚或单身。")
+            item.set_selected(True)
+            jianyi.append(item)
+        elif qiang_ruo.guan_sha_guo_wang:
+            item = ZhenDuanItem(0, "官杀旺,容易挑花眼,导致晚婚或单身。")
+            item.set_selected(True)
+            jianyi.append(item)
+
+        if bazi.ri_zhi.shi_shen == "杀":
+            item = ZhenDuanItem(0, "坐七杀,情路多坎坷,容易遇到不合适的人。")
+            item.set_selected(True)
+            jianyi.append(item)
+        elif bazi.ri_zhi.shi_shen in ["食", "伤"]:
+            item = ZhenDuanItem(0, "坐食伤,容易冲撞配偶,自身表达欲过于旺盛容易压制配偶的家庭地位,对夫妻感情不利。")
+            item.set_selected(True)
+            jianyi.append(item)
+        elif bazi.ri_zhi.shi_shen in ["印", "枭"]:
+            item = ZhenDuanItem(0, "坐印绶,容易招惹风言风语,对自身口碑不利。")
+            item.set_selected(True)
+            jianyi.append(item)
+    else:
+        if "官" in jiali_shishen or "杀" in jiali_shishen:
+            item = ZhenDuanItem(0, "官杀家中坐,容易大男子主义。")
+            item.set_selected(True)
+            jianyi.append(item)
+
+        if qiang_ruo.cai_xing_ruo:
+            item = ZhenDuanItem(0, "财星弱,组织家庭的意愿不强,容易晚婚或单身。")
+            item.set_selected(True)
+            jianyi.append(item)
+        elif qiang_ruo.cai_xing_guo_wang:
+            item = ZhenDuanItem(0, "财星旺,谈了很多个但定不下来,容易晚婚或单身。")
+            item.set_selected(True)
+            jianyi.append(item)
+
+        if bazi.ri_zhi.shi_shen in ["官", "杀"]:
+            item = ZhenDuanItem(0, "坐官杀,容易被配偶管着,家庭中配偶更强势。")
+            item.set_selected(True)
+            jianyi.append(item)
+        elif bazi.ri_zhi.shi_shen in ["食", "伤"]:
+            item = ZhenDuanItem(0,
+                                "坐食伤,喜欢照顾别人,容易找比自己年纪小的伴侣。容易把自身想法强加给别人,在子女教育上容易无意识的限制了子女的发展方向。")
+            item.set_selected(True)
+            jianyi.append(item)
+        elif bazi.ri_zhi.shi_shen in ["比", "劫"]:
+            item = ZhenDuanItem(0, "坐比劫,重视朋友多过重视配偶,容易引起配偶不满,对夫妻感情不利。")
+            item.set_selected(True)
+            jianyi.append(item)
+        elif bazi.ri_zhi.shi_shen in ["印", "枭"]:
+            item = ZhenDuanItem(0, "坐印绶,依赖性强,喜欢被照顾,容易找比自己年长的配偶。")
+            item.set_selected(True)
+            jianyi.append(item)
+        elif bazi.ri_zhi.shi_shen in ["财", "才"]:
+            item = ZhenDuanItem(0, "坐财星,重视配偶,对自己拥有的东西都看的很重。")
+            item.set_selected(True)
+            jianyi.append(item)
+
+
+def __check_tao_hua__(bazi: BaZi, jianyi: [], cankao: []):
+    sheng_wang = False
+    jian_shui = False
+    shi_zhi = False
+    shi_zhi_shang_guan = False
+    nian_yue_zhu = False
+    ri_zhu = False
+    qi_sha_tong_zhu = False
+    lu_shen_tong_zhu = False
+    yang_ren_tong_zhu = False
+    kong_wang_tong_zhu = False
+    bei_xing = False
+    zheng_guan_yin_tong_zhu = False
+    shi_shen_tong_zhu = False
+    shang_guan_tong_zhu = False
+    jie_cai_tong_zhu = False
+    pian_yin_tong_zhu = False
+    bi_jian_tong_zhu = False
+    for dz in bazi.all_di_zhis():
+        for sa in dz.shenshas:
+            if sa != "桃花":
+                continue
+            if dz.zhang_sheng_zhu in ["生", "沐", "冠", "临", "帝"]:
+                sheng_wang = True
+            if dz.wu_xing == "水":
+                jian_shui = True
+            if dz.wei_zhi == Configs.const_shi_zhi:
+                shi_zhi = True
+                if dz.shi_shen == "伤":
+                    shi_zhi_shang_guan = True
+            if dz.wei_zhi in [Configs.const_nian_zhi, Configs.const_yue_zhi]:
+                nian_yue_zhu = True
+            if dz.wei_zhi == Configs.const_ri_zhi:
+                ri_zhu = True
+            if dz.shi_shen == "杀":
+                qi_sha_tong_zhu = True
+            if __has_shensha__(dz, ["禄神", "半禄"]):
+                lu_shen_tong_zhu = True
+            if __has_shensha__(dz, ["羊刃"]):
+                yang_ren_tong_zhu = True
+            if __has_shensha__(dz, ["空亡"]):  # 神煞那边未判断空亡
+                kong_wang_tong_zhu = True
+            if __has_gaoneng__(dz, ["刑"]):
+                bei_xing = True
+            if dz.shi_shen in ["官", "印"]:
+                zheng_guan_yin_tong_zhu = True
+            if dz.shi_shen == "食":
+                shi_shen_tong_zhu = True
+            if dz.shi_shen == "伤":
+                shang_guan_tong_zhu = True
+            if dz.shi_shen == "劫":
+                jie_cai_tong_zhu = True
+            if dz.shi_shen == "枭":
+                pian_yin_tong_zhu = True
+            if dz.shi_shen == "比":
+                bi_jian_tong_zhu = True
+
+    if sheng_wang is True:
+        if bazi.is_man:
+            item = ZhenDuanItem(0, "桃花落生旺之地,姿容俊美,异性缘佳。")
+            item.set_selected(True)
+            jianyi.append(item)
+        else:
+            item = ZhenDuanItem(0, "桃花落生旺之地,风情万种,异性缘佳。")
+            item.set_selected(True)
+            jianyi.append(item)
+
+    if jian_shui:
+        item = ZhenDuanItem(0, "桃花见水,生理欲望强,容易两性关系混乱。")
+        cankao.append(item)
+
+    if shi_zhi:
+        item = ZhenDuanItem(0, "墙外桃花,易犯桃花劫。")
+        cankao.append(item)
+        if shi_zhi_shang_guan:
+            item = ZhenDuanItem(0, "容易多个配偶,婚姻不美满。")
+            cankao.append(item)
+    if nian_yue_zhu:
+        item = ZhenDuanItem(0, "内桃花,夫妻恩爱。")
+        item.set_selected(True)
+        jianyi.append(item)
+
+    if ri_zhu:
+        item = ZhenDuanItem(0, "日柱桃花,夫妻纠纷多,容易吵架。")
+        item.set_selected(True)
+        jianyi.append(item)
+
+    if qi_sha_tong_zhu:
+        content = "桃花遇七杀,情人多,欲望强。"
+        if bazi.is_man:
+            content += "易得女贵人相助,容易因欲望犯罪。"
+        else:
+            content += "易产生情色交易。"
+            if bazi.tong_dang * 2 < bazi.yi_dang:
+                content += "身弱,容易被迫堕入风尘。"
+        item = ZhenDuanItem(0, content)
+        cankao.append(item)
+
+    if lu_shen_tong_zhu:
+        item = ZhenDuanItem(0, "桃花遇禄神,异性缘极佳。")
+        item.set_selected(True)
+        jianyi.append(item)
+
+    if yang_ren_tong_zhu:
+        item = ZhenDuanItem(0, "桃花遇羊刃,情感上容易招惹风波。")
+        item.set_selected(True)
+        jianyi.append(item)
+
+    if kong_wang_tong_zhu:
+        item = ZhenDuanItem(0, "桃花遇空亡,人缘欠佳,一生多苦情。")
+        item.set_selected(True)
+        jianyi.append(item)
+
+    if bei_xing:
+        item = ZhenDuanItem(0, "桃花被刑,容易婚变。")
+        cankao.append(item)
+
+    if zheng_guan_yin_tong_zhu:
+        item = ZhenDuanItem(0, "正桃花,有自控力,约束力强,不滥情。")
+        item.set_selected(True)
+        jianyi.append(item)
+
+    if shi_shen_tong_zhu:
+        item = ZhenDuanItem(0, "桃花遇食神,会欲望转化为文学、艺术才华。")
+        item.set_selected(True)
+        jianyi.append(item)
+
+    if shang_guan_tong_zhu:
+        item = ZhenDuanItem(0, "桃花遇伤官,欲望强,容易喜新厌旧,自恃才貌,追求时髦,对感情不在乎。")
+        cankao.append(item)
+
+    if jie_cai_tong_zhu:
+        item = ZhenDuanItem(0, "桃花遇劫财,容易横刀夺爱,敢爱敢恨,争风吃醋。")
+        cankao.append(item)
+
+    if pian_yin_tong_zhu:
+        item = ZhenDuanItem(0, "桃花遇偏印,生理欲望强,不走寻常路。")
+        cankao.append(item)
+
+    if bi_jian_tong_zhu:
+        item = ZhenDuanItem(0, "桃花遇比肩,容易孤芳自赏,单身主义。")
+        item.set_selected(True)
+        jianyi.append(item)
+
+
+def __check_rizhi__(bazi: BaZi, jianyi: [], cankao: []):
+    if __has_gaoneng__(bazi.ri_zhi, ["穿", "破"]):
+        content = "配偶宫相害相破,夫妻情感容易破裂。"
+        if __has_gaoneng__(bazi.ri_zhi, ["合", "暗合"]):
+            content += "容易焦灼着,不一定会彻底分开。"
+        item = ZhenDuanItem(0, content)
+        cankao.append(item)
+
+    if __has_gaoneng__(bazi.ri_zhi, ["刑"]):
+        item = ZhenDuanItem(0, "配偶宫被刑,夫妻情感不好,容易互相伤害,但又不会分开,一直吊着。")
+        cankao.append(item)
+
+    an_he_list = __find_gaoneng__(bazi.ri_zhi, ["暗合"])
+    if len(an_he_list) > 0:
+        an_he = an_he_list[0]
+        if bazi.is_man:
+            if an_he.shi_shen2 in ["财", "才"]:
+                item = ZhenDuanItem(0, "配偶宫暗合财星,情感中可能存在第三者。")
+                cankao.append(item)
+            else:
+                zhi = __get_zhi_by_weizhi__(bazi, an_he.wei_zhi2)
+                if __has_shishen_in_canggan__(zhi, ["财", "才"]):
+                    item = ZhenDuanItem(0, "配偶宫暗合财星(藏干),情感中可能存在第三者。")
+                    cankao.append(item)
+
+        else:
+            if an_he.shi_shen2 in ["官", "杀"]:
+                item = ZhenDuanItem(0, "配偶宫暗合官杀,情感中可能存在第三者。")
+                cankao.append(item)
+            elif an_he.shi_shen2 in ["财", "才"]:
+                item = ZhenDuanItem(0, "配偶宫暗合财星,情感中可能存在第三者。")
+                cankao.append(item)
+            else:
+                zhi = __get_zhi_by_weizhi__(bazi, an_he.wei_zhi2)
+                if __has_shishen_in_canggan__(zhi, ["官", "杀"]):
+                    item = ZhenDuanItem(0, "配偶宫暗合官杀(藏干),情感中可能存在第三者。")
+                    cankao.append(item)
+                elif __has_shishen_in_canggan__(zhi, ["财", "才"]):
+                    item = ZhenDuanItem(0, "配偶宫暗合财星(藏干),情感中可能存在第三者。")
+                    cankao.append(item)
+
+
+def __check_others__(bazi: BaZi, jianyi: [], cankao: []):
+    # 本来应该是独官被穿,这里延伸为正官被穿,不考虑独官的情况
+    target_dayun = None
+    for dayun in bazi.dayun:
+        if dayun.start_age in range(10, 20):
+            target_dayun = dayun
+            break
+
+    if target_dayun is not None:
+        ct = 0
+        has_guan = __has_guan_in_dizhi__(bazi)
+        for liunian in target_dayun.liunian:
+            if has_guan:
+                chuan_gan = __count_chuan_guan__(liunian.gan_zhu)
+                chuan_zhi = __count_chuan_guan__(liunian.zhi_zhu)
+                ct += chuan_gan + chuan_zhi
+            else:
+                pass
+        if ct > 0:
+            per = 30 * ct
+            if per > 100:
+                per = 100
+            item = ZhenDuanItem(0, "正官被穿,三观容易被改变。")
+            item.tip = str(per) + "%"
+            cankao.append(item)
+
+
+def __has_shensha__(sz: SiZhu, names: [str]):
+    result = False
+    for sa in sz.shenshas:
+        if sa in names:
+            result = True
+            break
+    return result
+
+
+def __has_gaoneng__(sz: SiZhu, guanxis: [str]):
+    result = False
+    for gn in sz.gaonengs:
+        if gn.guanxi in guanxis:
+            result = True
+            break
+    return result
+
+
+def __find_gaoneng__(sz: SiZhu, guanxis: [str]):
+    result = []
+    for gn in sz.gaonengs:
+        if gn.guanxi in guanxis:
+            result.append(gn)
+    return result
+
+
+def __get_zhi_by_weizhi__(bazi: BaZi, weizhi: int):
+    result = None
+    if weizhi == Configs.const_nian_zhi:
+        result = bazi.nian_zhi
+    elif weizhi == Configs.const_yue_zhi:
+        result = bazi.yue_zhi
+    elif weizhi == Configs.const_ri_zhi:
+        result = bazi.ri_zhi
+    elif weizhi == Configs.const_shi_zhi:
+        result = bazi.shi_zhi
+    return result
+
+
+def __has_shishen_in_canggan__(zhi: SiZhu, shishens: [str]):
+    result = False
+    if zhi is None:
+        return result
+    ary = []
+    if zhi.gan1_shi_shen is not None:
+        ary.append(zhi.gan1_shi_shen)
+    if zhi.gan2_shi_shen is not None:
+        ary.append(zhi.gan2_shi_shen)
+    if zhi.gan3_shi_shen is not None:
+        ary.append(zhi.gan3_shi_shen)
+    for ss in shishens:
+        if ss in ary:
+            result = True
+            break
+    return result
+
+
+def __has_geju__(src: [XiongJi], key: str):
+    result = False
+    for dt in src:
+        if dt.name == key:
+            result = True
+            break
+    return result
+
+
+def __has_guan_in_dizhi__(bazi: BaZi):
+    ary = [bazi.nian_zhi.shi_shen, bazi.yue_zhi.shi_shen, bazi.ri_zhi.shi_shen, bazi.shi_zhi.shi_shen]
+    return "官" in ary
+
+
+def __count_chuan_guan__(sz: SiZhu):
+    ct = 0
+    for gn in sz.gaonengs:
+        if gn.guanxi == "穿":
+            if gn.shi_shen2 in ["官"] and gn.wei_zhi2 < 10:
+                ct += 1
+    return ct

+ 30 - 0
yixue/zhenduan/AboutShenSha.py

@@ -0,0 +1,30 @@
+from yixue.Models import BaZi, ZhenDuanItem
+
+
+def run(bazi: BaZi):
+    jianyi = []
+    cankao = []
+    # 会跟五行、十神性格冲突的放参考
+    __check_in_dizhi__(bazi, jianyi, "羊刃", "身负羊刃,易起争执,伤人伤己。", True)
+    __check_in_dizhi__(bazi, jianyi, "文昌", "文昌加持,头脑聪慧,过目不忘。", True)
+    __check_in_dizhi__(bazi, cankao, "魁罡", "魁罡坐镇,尊严性极强,原则大于一切,易掌权也易得罪人。", False,
+                       "印很弱的时候可能不成立")
+    __check_in_dizhi__(bazi, jianyi, "驿马", "驿马加身,多奔波走动,出差或出国。", True)
+    __check_in_dizhi__(bazi, cankao, "将星", "将星临身,杀伐果断,极具决断力。", False, "金很弱的时候可能不成立")
+    if bazi.is_man:
+        __check_in_dizhi__(bazi, jianyi, "天罗", "天罗缚身,人生多磨练,需要不断突破自己,不能安于现状。", True)
+    else:
+        __check_in_dizhi__(bazi, jianyi, "地网", "地网缚身,人生多磨练,需要不断突破自己,不能安于现状。", True)
+    bazi.zhenduan.shensha.jianyi = jianyi
+    bazi.zhenduan.shensha.cankao = cankao
+
+
+def __check_in_dizhi__(bazi: BaZi, lst: [], key: str, content: str, is_jianyi: bool, tip: str = None):
+    for dz in bazi.all_di_zhis():
+        if dz.has_shen_sha(key):
+            item = ZhenDuanItem(0, content)
+            item.tip = tip
+            if is_jianyi:
+                item.set_selected(True)
+            lst.append(item)
+            break

+ 225 - 0
yixue/zhenduan/AboutWuXingShiShenZuoZhi.py

@@ -0,0 +1,225 @@
+from yixue import Configs
+from yixue.Models import BaZi, ZhenDuanItem
+
+
+def about_wuxing(bazi: BaZi, wx_per: {}):
+    jianyi_wuxing = []
+    cankao_wuxing = []
+    __check_wuxing__(wx_per, jianyi_wuxing, cankao_wuxing, bazi.ri_zhi.wu_xing)
+    cankao_wuxing.sort(key=lambda item: item.order)
+    bazi.zhenduan.wuxing.jianyi = jianyi_wuxing
+    bazi.zhenduan.wuxing.cankao = cankao_wuxing
+
+
+def about_shi_shen(bazi: BaZi, ss_per: {}):
+    jianyi_shishen = []
+    cankao_shishen = []
+    __check_shi_shen__(ss_per, jianyi_shishen, cankao_shishen, bazi.ri_zhi.shi_shen, bazi.is_man)
+    # cankao_shishen.sort(key=lambda item: item.order)
+    bazi.zhenduan.shishen.jianyi = jianyi_shishen
+    bazi.zhenduan.shishen.cankao = cankao_shishen
+
+
+def about_zuozhi(bazi: BaZi):
+    jianyi = []
+    cankao = []
+    zuozhi_shishen = bazi.ri_zhi.shi_shen
+    full_zuozhi = __get_shishen_class_name__(zuozhi_shishen)
+
+    v_full = Configs.get_value(Configs.config_zhenduan_zuozhi, full_zuozhi)
+    item = ZhenDuanItem(0, "坐支", full_zuozhi, ",", v_full)
+    item.set_selected(True)
+    jianyi.append(item)
+
+    if zuozhi_shishen == "财":
+        item = ZhenDuanItem(0, "财富观念比较稳健,较少涉及风险领域。")
+        item.set_selected(True)
+        jianyi.append(item)
+    elif zuozhi_shishen == "才":
+        item = ZhenDuanItem(0, "财富观念上比较激进,有风险投资倾向,喜欢赚块钱,容易离开家乡发展。")
+        item.set_selected(True)
+        jianyi.append(item)
+    elif zuozhi_shishen == "印":
+        item = ZhenDuanItem(0, "重视口碑,自身内核强,稳重,遇事不慌,学习的东西容易转化为成果。")
+        item.set_selected(True)
+        jianyi.append(item)
+    elif zuozhi_shishen == "枭":
+        item = ZhenDuanItem(0, "对信息、氛围敏感,容易沉迷一些事物,喜欢探索研究。")
+        item.set_selected(True)
+        jianyi.append(item)
+    elif zuozhi_shishen == "食":
+        item = ZhenDuanItem(0,
+                            "想的多做的少,喜欢自由不喜欢被束缚。看破不说破,大智若愚,具有战略思维,有格局。喜欢钻牛角尖,容易想太多而精神衰弱。")
+        item.set_selected(True)
+        jianyi.append(item)
+    elif zuozhi_shishen == "伤":
+        item = ZhenDuanItem(0, "做的多想的少,功利性强,胜负欲旺,社交能力强,容易冲撞长辈、领导。")
+        item.set_selected(True)
+        jianyi.append(item)
+    elif zuozhi_shishen == "比":
+        item = ZhenDuanItem(0, "主观性强,果断冷静。具备个人魅力,领导力强,与人合作多以自身为主导,多亲力亲为。")
+        item.set_selected(True)
+        jianyi.append(item)
+    elif zuozhi_shishen == "劫":
+        item = ZhenDuanItem(0, "喜欢投机冒险,点子很多,重视人脉关系,多与人合作分享利益,较多依赖他人的资源和能力。")
+        item.set_selected(True)
+        jianyi.append(item)
+
+    bazi.zhenduan.zuozhi.jianyi = jianyi
+    bazi.zhenduan.zuozhi.cankao = cankao
+
+
+def __check_shi_shen__(percentages: [], jianyi: [], cankao: [], zuozhi_shishen: str, is_man: bool):
+    keys = ["官杀", "财星", "印绶", "食伤", "比劫"]
+    for key in keys:
+        if percentages[key] >= 50:
+            item = ZhenDuanItem(0, key, "过旺,", __desc__shishen__(key, "旺"),
+                                "但容易", __desc__shishen__(key, "过旺"))
+            item.set_selected(True)
+            jianyi.append(item)
+            __check_single_shishen__(key, jianyi, cankao, percentages, zuozhi_shishen)
+
+        elif 37.5 < percentages[key] < 50:
+            item = ZhenDuanItem(1, key, "偏旺,", __desc__shishen__(key, "旺"),
+                                "但容易", __desc__shishen__(key, "过旺"))
+            cankao.append(item)
+            __check_single_shishen__(key, jianyi, cankao, percentages, zuozhi_shishen, True)
+        elif 18 < percentages[key] <= 37.5:
+            item = ZhenDuanItem(0, key, "旺,", __desc__shishen__(key, "旺"))
+            cankao.append(item)
+            __check_single_shishen__(key, jianyi, cankao, percentages, zuozhi_shishen, True)
+        elif 10 < percentages[key] <= 18:
+            if __get_shishen_class_name__(zuozhi_shishen) != key:  # 坐支不算弱
+                item = ZhenDuanItem(2, key, "偏弱,", __desc__shishen__(key, "衰"))
+                cankao.append(item)
+                __check_single_shishen__(key, jianyi, cankao, percentages, zuozhi_shishen, True)
+        elif 0 <= percentages[key] <= 10:
+            if __get_shishen_class_name__(zuozhi_shishen) != key:  # 坐支不算弱
+                item = ZhenDuanItem(0, key, "弱,", __desc__shishen__(key, "衰"))
+                item.set_selected(True)
+                jianyi.append(item)
+
+
+def __check_single_shishen__(key: str, jianyi: [], cankao: [], percentages: [], zuozhi_shishen: str,
+                             all_cankao: bool = False):
+    names = __get_single_shishens__(key)
+    if names is None:
+        return
+    for key in names:
+        desc_name = __get_shishen_full_name__(key)
+        if percentages[key] >= 50:
+            item = ZhenDuanItem(0, "以", desc_name, "力量为主,", __desc__shishen__(key, "旺"),
+                                "但容易", __desc__shishen__(key, "过旺"))
+            if all_cankao:
+                cankao.append(item)
+            else:
+                item.set_selected(True)
+                jianyi.append(item)
+        elif 37.5 < percentages[key] < 50:
+            item = ZhenDuanItem(0, "以", desc_name, "力量为主,", __desc__shishen__(key, "旺"),
+                                "但容易", __desc__shishen__(key, "过旺"))
+            if all_cankao:
+                cankao.append(item)
+            else:
+                item.set_selected(True)
+                jianyi.append(item)
+        elif 18 < percentages[key] <= 37.5:
+            item = ZhenDuanItem(1, "以", desc_name, "力量为主,", __desc__shishen__(key, "旺"))
+            cankao.append(item)
+        elif 10 < percentages[key] <= 18:
+            if zuozhi_shishen != key:  # 坐支不算弱
+                item = ZhenDuanItem(2, desc_name, "偏弱,", __desc__shishen__(key, "衰"))
+                cankao.append(item)
+        elif 0 <= percentages[key] <= 10:
+            if zuozhi_shishen != key:  # 坐支不算弱
+                item = ZhenDuanItem(0, desc_name, "弱,", __desc__shishen__(key, "衰"))
+                if all_cankao:
+                    cankao.append(item)
+                else:
+                    item.set_selected(True)
+                    jianyi.append(item)
+
+
+def __check_wuxing__(percentages: [], jianyi: [], cankao: [], zuozhi_wuxing: str):
+    for wx in Configs.config_wuxing_list:
+        if percentages[wx] >= 50:
+            item = ZhenDuanItem(0, wx, "过旺,性格", __desc__wuxing__(wx, "旺"),
+                                "但容易", __desc__wuxing__(wx, "过旺"))
+            item.set_selected(True)
+            jianyi.append(item)
+        elif 37.5 < percentages[wx] < 50:
+            item = ZhenDuanItem(1, wx, "偏旺,性格", __desc__wuxing__(wx, "旺"),
+                                "但容易", __desc__wuxing__(wx, "过旺"))
+            cankao.append(item)
+        elif 18 < percentages[wx] <= 37.5:
+            item = ZhenDuanItem(0, wx, "旺,性格", __desc__wuxing__(wx, "旺"))
+            cankao.append(item)
+        elif 10 < percentages[wx] <= 18:
+            if zuozhi_wuxing != wx:  # 坐支不算弱
+                item = ZhenDuanItem(2, wx, "偏弱,容易", __desc__wuxing__(wx, "衰"))
+                cankao.append(item)
+        elif 0 <= percentages[wx] <= 10:
+            if zuozhi_wuxing != wx:  # 坐支不算弱
+                item = ZhenDuanItem(0, wx, "弱,容易", __desc__wuxing__(wx, "衰"))
+                item.set_selected(True)
+                jianyi.append(item)
+
+
+def __get_shishen_full_name__(ss: str):
+    if ss == "官":
+        return "正官"
+    elif ss == "杀":
+        return "七杀"
+    elif ss == "财":
+        return "正财"
+    elif ss == "才":
+        return "偏财"
+    elif ss == "印":
+        return "正印"
+    elif ss == "枭":
+        return "偏印"
+    elif ss == "食":
+        return "食神"
+    elif ss == "伤":
+        return "伤官"
+    elif ss == "比":
+        return "比肩"
+    elif ss == "劫":
+        return "劫财"
+    return None
+
+
+def __get_single_shishens__(full_name: str):
+    if full_name == "官杀":
+        return ["官", "杀"]
+    elif full_name == "财星":
+        return ["财", "才"]
+    elif full_name == "印绶":
+        return ["印", "枭"]
+    elif full_name == "食伤":
+        return ["食", "伤"]
+    elif full_name == "比劫":
+        return ["比", "劫"]
+    return None
+
+
+def __get_shishen_class_name__(ss: str):
+    if ss in ["官", "杀"]:
+        return "官杀"
+    if ss in ["财", "才"]:
+        return "财星"
+    if ss in ["印", "枭"]:
+        return "印绶"
+    if ss in ["食", "伤"]:
+        return "食伤"
+    if ss in ["比", "劫"]:
+        return "比劫"
+    return ""
+
+
+def __desc__wuxing__(wx: str, state: str):
+    return Configs.get_value2(Configs.config_zhenduan_wuxing, wx, state)
+
+
+def __desc__shishen__(ss: str, state: str):
+    return Configs.get_value2(Configs.config_zhenduan_shishen, ss, state)

+ 103 - 0
yixue/zhenduan/AboutYinYuan.py

@@ -0,0 +1,103 @@
+import datetime
+
+from yixue.Models import BaZi, ZhenDuanItem
+
+
+def run(bazi: BaZi, wx_per: {}, ss_per: {}):
+    jianyi = []
+    cankao = []
+    __about_wan_hun__(bazi, ss_per, jianyi, cankao)
+    __about_duo_hun__(bazi, jianyi, cankao)
+    __about_others__(bazi, wx_per, jianyi, cankao)
+    bazi.zhenduan.yinyuan.jianyi = jianyi
+    bazi.zhenduan.yinyuan.cankao = cankao
+
+
+def __about_wan_hun__(bazi: BaZi, ss_per: {}, jianyi: [], cankao: []):
+    if bazi.is_man:
+        if ss_per["劫"] >= 37.5:
+            item = ZhenDuanItem(0, "劫财过旺,容易晚婚。")
+            item.set_selected(True)
+            jianyi.append(item)
+    else:
+        if ss_per["伤"] >= 37.5:
+            item = ZhenDuanItem(0, "伤官过旺,容易晚婚。")
+            item.set_selected(True)
+            jianyi.append(item)
+
+    if bazi.ri_zhi.is_muku is True and bazi.ri_zhi.is_muku_open is False:
+        item = ZhenDuanItem(0, "婚姻宫坐库不开,容易晚婚。")
+        item.set_selected(True)
+        jianyi.append(item)
+
+    for dayun in bazi.dayun:
+        if dayun.start_age in range(20, 30):
+            if dayun.gan_zhu.shi_shen in ["食", "伤"] or dayun.zhi_zhu.shi_shen in ["食", "伤"]:
+                item = ZhenDuanItem(0, "在适婚年龄追求自由,容易晚婚。")
+                item.set_selected(True)
+                jianyi.append(item)
+            break
+
+
+def __about_duo_hun__(bazi: BaZi, jianyi: [], cankao: []):
+    if __is_fuyin__(bazi):
+        item = ZhenDuanItem(0, "婚姻宫伏吟,容易多婚。")
+        cankao.append(item)
+
+    if bazi.is_man:
+        if "羊刃" in bazi.ri_zhi.shenshas:
+            item = ZhenDuanItem(0, "坐支羊刃,容易多婚。")
+            cankao.append(item)
+    else:
+        if bazi.ri_zhi.shi_shen == "伤":
+            item = ZhenDuanItem(0, "坐支伤官,容易多婚。")
+            cankao.append(item)
+
+
+def __about_others__(bazi: BaZi, wx_per: {}, jianyi: [], cankao: []):
+    if bazi.is_man:
+        shishen_list = [bazi.nian_gan.shi_shen, bazi.nian_zhi.shi_shen, bazi.yue_gan.shi_shen, bazi.yue_zhi.shi_shen,
+                        bazi.ri_gan.shi_shen, bazi.ri_zhi.shi_shen, bazi.shi_gan.shi_shen, bazi.shi_zhi.shi_shen]
+
+        if "劫" in shishen_list:
+            if "财" in shishen_list or "才" in shishen_list:
+                # 男命,劫财见财,配偶容易被劫走,被朋友抢夺。因此,金木旺就会家暴,水火旺就吵架。
+                content = "容易因第三者引发情感问题,"
+                if wx_per["火"] >= 25 and wx_per["水"] >= 25:
+                    content += "陷入无休止的争吵置气。"
+                elif wx_per["金"] >= 25 and wx_per["木"] >= 25:
+                    content += "严重的可能引起家暴。"
+                item = ZhenDuanItem(0, content)
+                cankao.append(item)
+    else:
+        if bazi.ri_zhi.shi_shen == "杀":
+            content = "容易遇渣男,情感不顺。"
+            if wx_per["金"] >= 25 and wx_per["木"] >= 25:
+                content += "婚姻不好,甚至遭受家暴。"
+            item = ZhenDuanItem(0, content)
+            cankao.append(item)
+
+    year = datetime.datetime.now().year
+    found = False
+    for dayun in bazi.dayun:
+        if dayun.is_dayun:
+            if dayun.start_year <= year and year <= dayun.end_year:
+                for liunian in dayun.liunian:
+                    if liunian.yinyuan_level > 0:
+                        item = ZhenDuanItem(0, "最近的姻缘在", str(liunian.year), ",好好把握机会。")
+                        cankao.append(item)
+                        found = True
+                        break
+                if found:
+                    break
+
+
+def __is_fuyin__(bazi: BaZi):
+    result = False
+    if bazi.yue_gan.text == bazi.ri_gan.text:
+        if bazi.yue_zhi.text == bazi.ri_zhi.text:
+            result = True
+    if bazi.shi_gan.text == bazi.ri_gan.text:
+        if bazi.shi_zhi.text == bazi.ri_zhi.text:
+            result = True
+    return result

+ 0 - 0
yixue_gzh_dj/__init__.py


+ 16 - 0
yixue_gzh_dj/asgi.py

@@ -0,0 +1,16 @@
+"""
+ASGI config for yixue_gzh_dj project.
+
+It exposes the ASGI callable as a module-level variable named ``application``.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/
+"""
+
+import os
+
+from django.core.asgi import get_asgi_application
+
+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'yixue_gzh_dj.settings')
+
+application = get_asgi_application()

+ 153 - 0
yixue_gzh_dj/settings.py

@@ -0,0 +1,153 @@
+"""
+Django settings for yixue_gzh_dj project.
+
+Generated by 'django-admin startproject' using Django 4.2.13.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/4.2/topics/settings/
+
+For the full list of settings and their values, see
+https://docs.djangoproject.com/en/4.2/ref/settings/
+"""
+import os
+from pathlib import Path
+
+# Build paths inside the project like this: BASE_DIR / 'subdir'.
+BASE_DIR = Path(__file__).resolve().parent.parent
+
+# Quick-start development settings - unsuitable for production
+# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/
+
+# SECURITY WARNING: keep the secret key used in production secret!
+SECRET_KEY = 'django-insecure-^4e6ckh5$&=%y1%)d0sbr^y3_m8g+zr2(cgl)lv9vx@s^31gig'
+
+# SECURITY WARNING: don't run with debug turned on in production!
+DEBUG = True
+
+ALLOWED_HOSTS = [
+    "*",
+]
+
+# 允许所有来源
+CORS_ALLOW_ALL_ORIGINS = True
+
+# Application definition
+
+INSTALLED_APPS = [
+    'corsheaders',
+    'django.contrib.admin',
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    'django.contrib.messages',
+    'django.contrib.staticfiles',
+    'wx',
+
+]
+
+MIDDLEWARE = [
+
+    'django.middleware.security.SecurityMiddleware',
+    'django.contrib.sessions.middleware.SessionMiddleware',
+    'django.middleware.common.CommonMiddleware',
+    # 'django.middleware.csrf.CsrfViewMiddleware',
+    'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.contrib.messages.middleware.MessageMiddleware',
+    'django.middleware.clickjacking.XFrameOptionsMiddleware',
+    'corsheaders.middleware.CorsMiddleware',
+]
+
+ROOT_URLCONF = 'yixue_gzh_dj.urls'
+
+TEMPLATES = [
+    {
+        'BACKEND': 'django.template.backends.django.DjangoTemplates',
+        'DIRS': [BASE_DIR / 'templates']
+        ,
+        'APP_DIRS': True,
+        'OPTIONS': {
+            'context_processors': [
+                'django.template.context_processors.debug',
+                'django.template.context_processors.request',
+                'django.contrib.auth.context_processors.auth',
+                'django.contrib.messages.context_processors.messages',
+            ],
+        },
+    },
+]
+
+WSGI_APPLICATION = 'yixue_gzh_dj.wsgi.application'
+
+# Database
+# https://docs.djangoproject.com/en/4.2/ref/settings/#databases
+
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.sqlite3',
+        'NAME': BASE_DIR / 'db.sqlite3',
+    }
+}
+
+# Password validation
+# https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators
+
+AUTH_PASSWORD_VALIDATORS = [
+    {
+        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
+    },
+    {
+        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
+    },
+    {
+        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
+    },
+    {
+        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
+    },
+]
+
+# Internationalization
+# https://docs.djangoproject.com/en/4.2/topics/i18n/
+
+
+LANGUAGE_CODE = 'zh-hans'
+
+TIME_ZONE = 'Asia/Shanghai'
+
+USE_I18N = True
+
+USE_TZ = True
+
+# Static files (CSS, JavaScript, Images)
+# https://docs.djangoproject.com/en/4.2/howto/static-files/
+
+STATIC_URL = 'static/'
+STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]
+# MEDIA_URL = '/media/'
+# MEDIA_ROOT = os.path.join(BASE_DIR, "media")
+
+# Default primary key field type
+# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field
+
+DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
+
+# # 如果你需要允许所有来源的某些 HTTP 方法,可以使用
+# CORS_ALLOW_METHODS = [
+#     "*"
+#     # 你可以在这里添加更多的允许方法
+# ]
+
+# # 或者,允许特定的来源
+# CORS_ALLOWED_ORIGINS = [
+#     "http://localhost:5173",
+#     # 你可以在这里添加更多的允许来源
+# ]
+#
+# # 如果你需要允许所有来源的某些 HTTP 头,可以使用
+# CORS_ALLOW_HEADERS = [
+#     'authorization',
+#     'content-type',
+#     'x-csrftoken',
+#     # 你可以在这里添加更多的允许头
+# ]
+#

+ 27 - 0
yixue_gzh_dj/urls.py

@@ -0,0 +1,27 @@
+"""
+URL configuration for yixue_gzh_dj project.
+
+The `urlpatterns` list routes URLs to views. For more information please see:
+    https://docs.djangoproject.com/en/4.2/topics/http/urls/
+Examples:
+Function views
+    1. Add an import:  from my_app import views
+    2. Add a URL to urlpatterns:  path('', views.home, name='home')
+Class-based views
+    1. Add an import:  from other_app.views import Home
+    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
+Including another URLconf
+    1. Import the include() function: from django.urls import include, path
+    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
+"""
+from django.conf import settings
+from django.conf.urls.static import static
+from django.urls import path, include
+
+urlpatterns = [
+    # path('admin/', admin.site.urls),
+    path("wx/", include("wx.urls")),
+]
+
+if settings.DEBUG:
+    urlpatterns += static("/", document_root=settings.STATICFILES_DIRS[0])

+ 1 - 0
yixue_gzh_dj/views.py

@@ -0,0 +1 @@
+

+ 16 - 0
yixue_gzh_dj/wsgi.py

@@ -0,0 +1,16 @@
+"""
+WSGI config for yixue_gzh_dj project.
+
+It exposes the WSGI callable as a module-level variable named ``application``.
+
+For more information on this file, see
+https://docs.djangoproject.com/en/4.2/howto/deployment/wsgi/
+"""
+
+import os
+
+from django.core.wsgi import get_wsgi_application
+
+os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'yixue_gzh_dj.settings')
+
+application = get_wsgi_application()