|
@@ -1,15 +1,15 @@
|
|
package com.miaxis.gan.service.impl;
|
|
package com.miaxis.gan.service.impl;
|
|
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
-import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.miaxis.common.config.ShiShenConfig;
|
|
import com.miaxis.common.config.ShiShenConfig;
|
|
import com.miaxis.gan.dto.GanZhiDto;
|
|
import com.miaxis.gan.dto.GanZhiDto;
|
|
-import com.miaxis.gan.vo.GanZhiFiveVo;
|
|
|
|
import com.miaxis.gan.vo.GanZhiKongWangVo;
|
|
import com.miaxis.gan.vo.GanZhiKongWangVo;
|
|
import com.miaxis.gan.vo.GanZhiNaYinVo;
|
|
import com.miaxis.gan.vo.GanZhiNaYinVo;
|
|
import com.miaxis.gan.vo.GanZhiRowVo;
|
|
import com.miaxis.gan.vo.GanZhiRowVo;
|
|
|
|
+import com.miaxis.number.domain.NumberYun;
|
|
|
|
+import com.miaxis.number.mapper.NumberYunMapper;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -28,6 +28,9 @@ public class GanZhiServiceImpl extends ServiceImpl<GanZhiMapper, GanZhi> impleme
|
|
@Autowired
|
|
@Autowired
|
|
private GanZhiMapper ganZhiMapper;
|
|
private GanZhiMapper ganZhiMapper;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private NumberYunMapper numberYunMapper;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
private ShiShenConfig shiShenConfig;
|
|
private ShiShenConfig shiShenConfig;
|
|
|
|
|
|
@@ -268,7 +271,6 @@ public class GanZhiServiceImpl extends ServiceImpl<GanZhiMapper, GanZhi> impleme
|
|
}
|
|
}
|
|
/*-----------------------十神 结束-------------------*/
|
|
/*-----------------------十神 结束-------------------*/
|
|
|
|
|
|
-
|
|
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -343,7 +345,7 @@ public class GanZhiServiceImpl extends ServiceImpl<GanZhiMapper, GanZhi> impleme
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Integer getRiYuanQr(GanZhiDto ganZhiDto) {
|
|
|
|
|
|
+ public Map<String,Object> getRiYuanQr(GanZhiDto ganZhiDto) {
|
|
/*-------------------日元身强身弱---------------------*/
|
|
/*-------------------日元身强身弱---------------------*/
|
|
List<GanZhiRowVo> list = this.getGanZhiRowVoList(ganZhiDto);
|
|
List<GanZhiRowVo> list = this.getGanZhiRowVoList(ganZhiDto);
|
|
int yearGanQR = ShiShenConfig.generateRelationship(list.get(4).getFive(), list.get(0).getFive());
|
|
int yearGanQR = ShiShenConfig.generateRelationship(list.get(4).getFive(), list.get(0).getFive());
|
|
@@ -379,17 +381,17 @@ public class GanZhiServiceImpl extends ServiceImpl<GanZhiMapper, GanZhi> impleme
|
|
}
|
|
}
|
|
|
|
|
|
List<String> xiYong = null;
|
|
List<String> xiYong = null;
|
|
|
|
+ String fiveQr = null;
|
|
if (score > 50) {
|
|
if (score > 50) {
|
|
- String fiveQr = list.get(4).getFive() + "强";
|
|
|
|
|
|
+ fiveQr = list.get(4).getFive() + "强";
|
|
xiYong = shiShenConfig.getXiYong().get(fiveQr);
|
|
xiYong = shiShenConfig.getXiYong().get(fiveQr);
|
|
} else {
|
|
} else {
|
|
- String fiveQr = list.get(4).getFive() + "弱";
|
|
|
|
|
|
+ fiveQr = list.get(4).getFive() + "弱";
|
|
xiYong = shiShenConfig.getXiYong().get(fiveQr);
|
|
xiYong = shiShenConfig.getXiYong().get(fiveQr);
|
|
}
|
|
}
|
|
String xi1 = xiYong.get(0);
|
|
String xi1 = xiYong.get(0);
|
|
String xi2 = xiYong.get(1);
|
|
String xi2 = xiYong.get(1);
|
|
|
|
|
|
-
|
|
|
|
Map<String,Integer> fiveCountMap = this.getGanZhiRowVoCount(ganZhiDto);
|
|
Map<String,Integer> fiveCountMap = this.getGanZhiRowVoCount(ganZhiDto);
|
|
int xi1Count = fiveCountMap.get(xi1);
|
|
int xi1Count = fiveCountMap.get(xi1);
|
|
int xi2Count = fiveCountMap.get(xi2);
|
|
int xi2Count = fiveCountMap.get(xi2);
|
|
@@ -403,13 +405,73 @@ public class GanZhiServiceImpl extends ServiceImpl<GanZhiMapper, GanZhi> impleme
|
|
|
|
|
|
System.out.println("喜用:" + xiYong);
|
|
System.out.println("喜用:" + xiYong);
|
|
|
|
|
|
|
|
+ Map<String,Object> qr = new TreeMap<String,Object>();
|
|
|
|
+ qr.put("score",score);
|
|
|
|
+ qr.put("qr",fiveQr);
|
|
|
|
+ qr.put("xiYong",xiYong);
|
|
|
|
+
|
|
|
|
+ return qr;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Map<String, Object> getBinZheng(GanZhiDto ganZhiDto){
|
|
|
|
+ List<GanZhiRowVo> ganZhiRowVoList = this.selectGanZhiRowVoList(ganZhiDto);
|
|
|
|
+ String sex = ganZhiRowVoList.get(4).getShiShen1();
|
|
|
|
+
|
|
|
|
+ if("元男".equals(sex)){ //男性疾病
|
|
|
|
+
|
|
|
|
+ } else if ("元女".equals(sex)){ //女性疾病
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ ganZhiRowVoList.get(0); //头
|
|
|
|
+ ganZhiRowVoList.get(1); //脖子
|
|
|
|
+ ganZhiRowVoList.get(2); //胸部
|
|
|
|
+ ganZhiRowVoList.get(3); //腹部
|
|
|
|
+ ganZhiRowVoList.get(4); //小腹
|
|
|
|
+ ganZhiRowVoList.get(5); //屁股
|
|
|
|
+ ganZhiRowVoList.get(6); //大腿
|
|
|
|
+ ganZhiRowVoList.get(7); //小腿脚部
|
|
|
|
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Map<String, Object> getNumberYun(Map<String, Object> qr) {
|
|
|
|
+
|
|
|
|
+ List<String> numberList = new ArrayList<String>();
|
|
|
|
+ List<String> xiYong = (List<String>) qr.get("xiYong");
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < xiYong.size() ; i++) {
|
|
|
|
+ List<String> numList = shiShenConfig.getXiNumber().get(xiYong.get(i));
|
|
|
|
+ numberList.addAll(numList);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<NumberYun> numberYunList = numberYunMapper.getNumberYunByIds(numberList);
|
|
|
|
|
|
|
|
|
|
- return score;
|
|
|
|
|
|
+ //转字符串
|
|
|
|
+ StringJoiner joiner = new StringJoiner(",");
|
|
|
|
+ for (String number : numberList) {
|
|
|
|
+ joiner.add(number);
|
|
|
|
+ }
|
|
|
|
+ String numbers = joiner.toString();
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ Map<String,Object> resultMap = new TreeMap<String,Object>();
|
|
|
|
+ resultMap.put("numberYuns",numbers);
|
|
|
|
+ resultMap.put("numberYunList",numberYunList);
|
|
|
|
+
|
|
|
|
+ return resultMap;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 干支组装
|
|
* 干支组装
|
|
*
|
|
*
|