Browse Source

天干地支

zhangbin 1 year ago
parent
commit
a520df63be

+ 3 - 1
xpgx-admin/src/main/java/com/miaxis/app/controller/gan/GanZhiController.java

@@ -10,6 +10,7 @@ import com.miaxis.common.utils.poi.ExcelUtil;
 import com.miaxis.gan.domain.GanZhi;
 import com.miaxis.gan.dto.GanZhiDto;
 import com.miaxis.gan.service.IGanZhiService;
+import com.miaxis.gan.vo.GanZhiFiveVo;
 import com.miaxis.gan.vo.GanZhiRowVo;
 import com.miaxis.gan.vo.GanZhiVo;
 import com.nlf.calendar.Lunar;
@@ -78,13 +79,14 @@ public class GanZhiController extends BaseController{
         ganZhiDto.setTimeZhi(lunar.getTimeZhi());
 
         List<GanZhiRowVo> ganZhiRowVoList = ganZhiService.selectGanZhiRowVoList(ganZhiDto);
-        List<GanZhiRowVo> ganZhiRowVoCountList = ganZhiService.selectGanZhiRowVoList(ganZhiDto);
+        List<GanZhiFiveVo> ganZhiFiveVoList = ganZhiService.selectGanZhiFiveVoCount(ganZhiDto);
 
 
         GanZhiVo ganZhiVo = new GanZhiVo();
         ganZhiVo.setNongDay(lunar.getYear()+"年(生肖"+lunar.getYearShengXiao()+")"+lunar.getMonth()+"月"+lunar.getDay()+"日"+lunar.getTime()+"时");
         ganZhiVo.setBirthDay(ganZhiDto.getBirthDay());
         ganZhiVo.setGanZhiRowVoList(ganZhiRowVoList);
+        ganZhiVo.setGanZhiFiveVoList(ganZhiFiveVoList);
         ganZhiVo.setUsername(ganZhiDto.getUsename());
         ganZhiVo.setSex(ganZhiDto.getSex());
 

+ 0 - 32
xpgx-admin/src/main/java/com/miaxis/system/controller/system/SysLoginController.java

@@ -81,9 +81,6 @@ public class SysLoginController
     @Value("${gzh.appSecret}")
     private String gzhAppSecret;
 
-    private String appid;
-
-    private String appSecret;
 
     @Value("${xcx.appId}")
     private String xcxAppid;
@@ -129,35 +126,6 @@ public class SysLoginController
         return Response.success(tokenDTO);
     }
 
-    /**
-     *
-     */
-    @PostMapping("/login/code")
-    @ApiOperation("app微信用户授权码模式登录")
-    public Response<TokenDTO> loginByWxAuthorizationCode(String authorizationCode ){
-        String wxResultStr = wxService.getWxToken(appid, appSecret, authorizationCode, "authorization_code");
-        logger.info("微信授权码登录返回值:"+wxResultStr);
-        WxResult wxResult = JSONObject.parseObject(wxResultStr,WxResult.class);
-
-        // 生成令牌
-        if (wxResult.getErrcode() != null){
-            throw new CustomException("微信授权无效,请重新授权");
-        }
-
-        String userInfoStr = wxService.getUserInfo("zh_CN", wxResult.getAccess_token(), wxResult.getOpenid());
-        WxUserInfo wxUserInfo = JSONObject.parseObject(userInfoStr,WxUserInfo.class);
-        ServletUtils.getRequest().setAttribute("headImage",wxUserInfo.getHeadimgurl());
-        ServletUtils.getRequest().setAttribute("nickName",wxUserInfo.getNickname());
-        ServletUtils.getRequest().setAttribute("openid",wxUserInfo.getOpenid());
-        String token = loginService.login(wxUserInfo.getUnionid(),null, StudentLoginTypeEnum.AUTHORIZATION_CODE_LOGIN.getCode());
-        TokenDTO tokenDTO = new TokenDTO();
-        tokenDTO.setToken(token);
-        tokenDTO.setThirdResult(wxUserInfo);
-        return Response.success(tokenDTO) ;
-
-
-
-    }
 
     /**
      * 用户 openid登录

+ 2 - 2
xpgx-admin/src/main/resources/application-dev.yml

@@ -110,8 +110,8 @@ gzh:
 
 # 小程序
 xcx:
-    appId: wx97bbc22daac9362a
-    appSecret: e67435002c220ef2f69a1b43508c61ec
+    appId: wxd14b31479ff7bfbc
+    appSecret: cd76422cbe9892505f78469dd08958b6
 
 
 # 微信支付

+ 2 - 2
xpgx-admin/src/main/resources/application-local.yml

@@ -104,8 +104,8 @@ gzh:
 
 # 小程序
 xcx:
-    appId: wx97bbc22daac9362a
-    appSecret: e67435002c220ef2f69a1b43508c61ec
+    appId: wxd14b31479ff7bfbc
+    appSecret: cd76422cbe9892505f78469dd08958b6
 
 # 微信支付
 wxpay:

+ 2 - 2
xpgx-admin/src/main/resources/application-prod.yml

@@ -106,8 +106,8 @@ gzh:
 
 # 小程序
 xcx:
-    appId: wx97bbc22daac9362a
-    appSecret: e67435002c220ef2f69a1b43508c61ec
+    appId: wxd14b31479ff7bfbc
+    appSecret: cd76422cbe9892505f78469dd08958b6
 
 # 微信支付
 wxpay:

+ 3 - 0
xpgx-service/src/main/java/com/miaxis/gan/mapper/GanZhiMapper.java

@@ -4,6 +4,7 @@ import java.util.List;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.miaxis.gan.domain.GanZhi;
 import com.miaxis.gan.dto.GanZhiDto;
+import com.miaxis.gan.vo.GanZhiFiveVo;
 import com.miaxis.gan.vo.GanZhiRowVo;
 
 /**
@@ -22,4 +23,6 @@ public interface GanZhiMapper extends BaseMapper<GanZhi> {
     List<GanZhi> selectGanZhiList(GanZhi ganZhi);
 
     List<GanZhiRowVo> selectGanZhiRowVoList(GanZhiDto ganZhiDto);
+
+    List<GanZhiFiveVo> selectGanZhiFiveVoCount(GanZhiDto ganZhiDto);
 }

+ 4 - 0
xpgx-service/src/main/java/com/miaxis/gan/service/IGanZhiService.java

@@ -4,6 +4,7 @@ import java.util.List;
 import com.miaxis.gan.domain.GanZhi;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.miaxis.gan.dto.GanZhiDto;
+import com.miaxis.gan.vo.GanZhiFiveVo;
 import com.miaxis.gan.vo.GanZhiRowVo;
 
 /**
@@ -23,4 +24,7 @@ public interface IGanZhiService extends IService<GanZhi>{
 
 
     public List<GanZhiRowVo> selectGanZhiRowVoList(GanZhiDto ganZhiDto);
+
+
+    public List<GanZhiFiveVo> selectGanZhiFiveVoCount(GanZhiDto ganZhiDto);
 }

+ 6 - 0
xpgx-service/src/main/java/com/miaxis/gan/service/impl/GanZhiServiceImpl.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.miaxis.common.utils.DateUtils;
 import com.miaxis.gan.dto.GanZhiDto;
+import com.miaxis.gan.vo.GanZhiFiveVo;
 import com.miaxis.gan.vo.GanZhiRowVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -40,4 +41,9 @@ public class GanZhiServiceImpl extends ServiceImpl<GanZhiMapper, GanZhi> impleme
     public List<GanZhiRowVo> selectGanZhiRowVoList(GanZhiDto ganZhiDto) {
         return ganZhiMapper.selectGanZhiRowVoList(ganZhiDto);
     }
+
+    @Override
+    public List<GanZhiFiveVo> selectGanZhiFiveVoCount(GanZhiDto ganZhiDto) {
+        return ganZhiMapper.selectGanZhiFiveVoCount(ganZhiDto);
+    }
 }

+ 1 - 1
xpgx-service/src/main/java/com/miaxis/gan/vo/GanZhiFiveVo.java

@@ -10,7 +10,7 @@ public class GanZhiFiveVo {
     @ApiModelProperty(value = "五行")
     private String five;
     @ApiModelProperty(value = "数量")
-    private Integer xi;
+    private Integer count;
 
 
 

+ 5 - 1
xpgx-service/src/main/java/com/miaxis/gan/vo/GanZhiVo.java

@@ -26,12 +26,16 @@ public class GanZhiVo {
     private Integer sex;
 
     @ApiModelProperty(value = "(公历)出生日期")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss.SSS")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date birthDay;
 
     @ApiModelProperty(value = "(农历)出生日期")
     private String nongDay;
 
+    @ApiModelProperty(value = "八字五行集合")
     private List<GanZhiRowVo> ganZhiRowVoList;
 
+    @ApiModelProperty(value = "八字五行个数集合")
+    private List<GanZhiFiveVo> ganZhiFiveVoList;
+
 }

+ 9 - 3
xpgx-service/src/main/resources/mapper/gan/GanZhiMapper.xml

@@ -25,6 +25,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
 
+    <resultMap type="com.miaxis.gan.vo.GanZhiFiveVo" id="GanZhiFiveVoResult">
+        <result property="five"    column="five"    />
+        <result property="count"    column="count"    />
+    </resultMap>
+
+
     <sql id="selectGanZhiVo">
         select * from gan_zhi
     </sql>
@@ -51,12 +57,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
 
-    <select id="selectGanZhiRowVoCount" parameterType="com.miaxis.gan.dto.GanZhiDto" resultMap="GanZhiRowVoResult">
-        SELECT five,count(1) FROM gan_zhi g
+    <select id="selectGanZhiFiveVoCount" parameterType="com.miaxis.gan.dto.GanZhiDto" resultMap="GanZhiFiveVoResult">
+        SELECT five,count(1) as count FROM gan_zhi g
         <where>
             g.name IN (#{yearGan}, #{yearZhi}, #{monthGan}, #{monthZhi}, #{dayGan}, #{dayZhi}, #{timeGan}, #{timeZhi})
-            ORDER BY FIELD(g.name, #{yearGan}, #{yearZhi}, #{monthGan}, #{monthZhi}, #{dayGan}, #{dayZhi}, #{timeGan}, #{timeZhi})
         </where>
+        group by five
     </select>