zhangbin před 1 rokem
rodič
revize
9992946e72

+ 20 - 18
xpgx-admin/src/main/java/com/miaxis/app/controller/birthday/BirthdayLogController.java

@@ -22,8 +22,8 @@ import java.util.List;
  */
 @RestController
 @RequestMapping(Constants.OPEN_PREFIX + "/birthday/log")
-@Api(tags={"【app-查询记录】"})
-public class BirthdayLogController extends BaseController{
+@Api(tags = {"【app-查询记录】"})
+public class BirthdayLogController extends BaseController {
     @Autowired
     private IBirthdayLogService birthdayLogService;
 
@@ -32,12 +32,16 @@ public class BirthdayLogController extends BaseController{
      */
     @GetMapping("/list")
     @ApiOperation("查询查询记录列表")
-        @ApiImplicitParams({
-            @ApiImplicitParam(name = "pageNum",value = "当前页码" ,dataType = "int", paramType = "query", required = false),
-            @ApiImplicitParam(name = "pageSize",value = "每页数据量" , dataType = "int", paramType = "query", required = false),
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "pageNum", value = "当前页码", dataType = "int", paramType = "query", required = false),
+            @ApiImplicitParam(name = "pageSize", value = "每页数据量", dataType = "int", paramType = "query", required = false),
     })
-    public ResponsePageInfo<BirthdayLog> list(@ModelAttribute BirthdayLog birthdayLog){
+    public ResponsePageInfo<BirthdayLog> list(@ModelAttribute BirthdayLog birthdayLog) {
         startPage();
+        Long bbq = SecurityUtils.getLoginUser().getStudent().getId();
+        Long bbq2 = SecurityUtils.getLoginUser().getUser().getUserId();
+        System.out.println(bbq);
+        System.out.println(bbq2);
         birthdayLog.setUserId(SecurityUtils.getLoginUser().getStudent().getId());
         List<BirthdayLog> list = birthdayLogService.selectBirthdayLogList(birthdayLog);
         return toResponsePageInfo(list);
@@ -51,18 +55,17 @@ public class BirthdayLogController extends BaseController{
     public Response<BirthdayLog> getInfo(
             @ApiParam(name = "id", value = "查询记录参数", required = true)
             @PathVariable("id") Long id
-    ){
+    ) {
         return Response.success(birthdayLogService.getById(id));
     }
 
     /**
      * 新增查询记录
 
-    @PostMapping
-    @ApiOperation("新增查询记录")
-    public Response<Integer> add(@RequestBody BirthdayLog birthdayLog){
-        return toResponse(birthdayLogService.save(birthdayLog) ? 1 : 0);
-    }
+     @PostMapping
+     @ApiOperation("新增查询记录") public Response<Integer> add(@RequestBody BirthdayLog birthdayLog){
+     return toResponse(birthdayLogService.save(birthdayLog) ? 1 : 0);
+     }
      */
 
     /**
@@ -70,31 +73,30 @@ public class BirthdayLogController extends BaseController{
      */
     @PostMapping
     @ApiOperation("新增查询记录")
-    public Response<Integer> add(@RequestBody BirthdayLog birthdayLog){
+    public Response<Integer> add(@RequestBody BirthdayLog birthdayLog) {
         birthdayLog.setUserId(SecurityUtils.getLoginUser().getStudent().getId());
         return toResponse(birthdayLogService.saveBirthdayLog(birthdayLog) ? 1 : 0);
     }
 
 
-
     /**
      * 修改查询记录
      */
     @PutMapping
     @ApiOperation("修改查询记录")
-    public Response<Integer> edit(@RequestBody BirthdayLog birthdayLog){
+    public Response<Integer> edit(@RequestBody BirthdayLog birthdayLog) {
         return toResponse(birthdayLogService.updateById(birthdayLog) ? 1 : 0);
     }
 
     /**
      * 删除查询记录
      */
-	@DeleteMapping("/{ids}")
+    @DeleteMapping("/{ids}")
     @ApiOperation("删除查询记录")
-    public  Response<Integer> remove(
+    public Response<Integer> remove(
             @ApiParam(name = "ids", value = "查询记录ids参数", required = true)
             @PathVariable Long[] ids
-    ){
+    ) {
         return toResponse(birthdayLogService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
     }
 }

+ 33 - 27
xpgx-admin/src/test/java/com/miaxis/test/TestYear.java

@@ -15,38 +15,34 @@ public class TestYear {
     private ShiShenConfig shiShenConfig;
 
 
-
     public static void main(String[] args) {
-            // 假设输入的是阳历日期
-            int year = 2023;
-            int month = 10; // 注意:月份从1开始,即1代表一月
-            int day = 30;
+        // 假设输入的是阳历日期
+        int year = 2023;
+        int month = 10; // 注意:月份从1开始,即1代表一月
+        int day = 30;
 
         // 假设使用 cn.6tail 的 lunar 库来转换日期
-        Date d1 = DateUtils.parseDate("2023-03-01 00:00:00");
+        Date d1 = DateUtils.parseDate("1996-11-10 11:47:00");
         Lunar lunar = Lunar.fromDate(d1);
         //      System.out.println(lunar.toFullString());
-       // System.out.println(lunar.getSolar().toFullString());
-
-//        String str = lunar.toFullString();
-//        String[] s = str.split(" ");
-//        for (int i = 0; i < s.length; i++) {
-//            System.out.println(s[i]);
-//        }
-
-//        System.out.println(ShiShenConfig.fangWei(s[14]));
-//        System.out.println(ShiShenConfig.fangWei(s[15]));
-//        System.out.println(ShiShenConfig.fangWei(s[16]));
-//        System.out.println(ShiShenConfig.fangWei(s[17]));
-//        System.out.println(ShiShenConfig.fangWei(s[18]));
-//        System.out.println(ShiShenConfig.fangWei(s[20]));
-
+        // System.out.println(lunar.getSolar().toFullString());
 
+        String str = lunar.toFullString();
+        String[] s = str.split(" ");
+        for (int i = 0; i < s.length; i++) {
+            System.out.println(s[i]);
+        }
 
+        System.out.println(ShiShenConfig.fangWei(s[14]));
+        System.out.println(ShiShenConfig.fangWei(s[15]));
+        System.out.println(ShiShenConfig.fangWei(s[16]));
+        System.out.println(ShiShenConfig.fangWei(s[17]));
+        System.out.println(ShiShenConfig.fangWei(s[18]));
+        System.out.println(ShiShenConfig.fangWei(s[20]));
 
 
-        if(lunar.getJieQi()!=null && !"".equals(lunar.getJieQi()) ) {
-            System.out.println("节气:"+lunar.getJieQi());
+        if (lunar.getJieQi() != null && !"".equals(lunar.getJieQi())) {
+            System.out.println("节气:" + lunar.getJieQi());
             //存在节气,判断是否在节气点前
 
         } else {
@@ -54,10 +50,9 @@ public class TestYear {
         }
 
 
+        //    System.out.println("公历:"+lunar.getSolar().getYear()+","+lunar.getSolar().getMonth()+","+lunar.getSolar().getDay()+","+lunar.getSolar().getHour());
 
-    //    System.out.println("公历:"+lunar.getSolar().getYear()+","+lunar.getSolar().getMonth()+","+lunar.getSolar().getDay()+","+lunar.getSolar().getHour());
-
-     //   System.out.println("农历:"+lunar.getYear()+","+lunar.getMonth()+","+lunar.getDay()+","+lunar.getTime());
+        //   System.out.println("农历:"+lunar.getYear()+","+lunar.getMonth()+","+lunar.getDay()+","+lunar.getTime());
 
         // 获取干支纪年
         String ganYear = lunar.getYearGan();
@@ -74,7 +69,18 @@ public class TestYear {
 
 
         // 输出结果
-        System.out.println(ganYear+","+zhiYear+","+ganMonth+","+zhiMonth+","+ganDay+","+zhiDay+","+timeGan+","+timeZhi);
+        System.out.println(ganYear + "," + zhiYear + "," + ganMonth + "," + zhiMonth + "," + ganDay + "," + zhiDay + "," + timeGan + "," + timeZhi);
+
+
+        Lunar lunar1 = Lunar.fromYmdHms(1996, 8, 5, 12, 12, 33);
+
+
+        System.out.println(lunar1.getMonth());
+        System.out.println(lunar.getMonth());
+
+        Lunar lunar2 = new Lunar();
+
+
 
 
     }

+ 2 - 10
xpgx-common/src/main/java/com/miaxis/common/core/domain/model/LoginUser.java

@@ -285,23 +285,15 @@ public class LoginUser implements UserDetails
     {
         this.student = student;
     }
+
     @Override
     public Collection<? extends GrantedAuthority> getAuthorities()
     {
         if (this.getStudent() != null){
-            List<SimpleGrantedAuthority> roleList = new ArrayList<SimpleGrantedAuthority>();
-            roleList.add(new SimpleGrantedAuthority("ROLE_STUDENT"));
-            //如果已激活,是vip的话
-            Date now = new Date();
-            if (this.getStudent().getExpireTime() != null && now.compareTo(this.getStudent().getExpireTime())<0){
-                roleList.add(new SimpleGrantedAuthority("ROLE_VIP"));
-            }
-            return roleList;
+            return null;
         }else {
             return null;
         }
-
-
     }
     public void setAuthorities(Collection<? extends GrantedAuthority> collection){
 

+ 7 - 1
xpgx-service/src/main/java/com/miaxis/gan/service/impl/GanZhiServiceImpl.java

@@ -14,6 +14,7 @@ import com.miaxis.gan.vo.GanZhiKongWangVo;
 import com.miaxis.gan.vo.GanZhiNaYinVo;
 import com.miaxis.gan.vo.GanZhiRowVo;
 import com.miaxis.ge.domain.GeJu;
+import com.miaxis.ge.mapper.GeJuMapper;
 import com.miaxis.jie.mapper.JieQiMapper;
 import com.miaxis.jie.vo.JieQiVo;
 import com.miaxis.number.domain.NumberYun;
@@ -49,6 +50,10 @@ public class GanZhiServiceImpl extends ServiceImpl<GanZhiMapper, GanZhi> impleme
     @Autowired
     private JieQiMapper jieQiMapper;
 
+    @Autowired
+    private GeJuMapper geJuMapper;
+
+
 
     /**
      * 查询天干地支列表
@@ -1143,7 +1148,8 @@ public class GanZhiServiceImpl extends ServiceImpl<GanZhiMapper, GanZhi> impleme
             geJu.setSex("2,3");
         }
 
-
+        List<GeJu> list2 = geJuMapper.selectGeJuList2(geJu);
+        System.out.println(list2);
         return null;
     }
 

+ 0 - 45
xpgx-service/src/main/java/com/miaxis/ge/domain/GeJu.java

@@ -51,50 +51,5 @@ public class GeJu extends BaseBusinessEntity{
     @ApiModelProperty(value = "身强 身弱")
     private String qr;
 
-    public void setId(Long id){
-        this.id = id;
-    }
 
-    public Long getId(){
-        return id;
-    }
-    public void setShiShen(String shiShen){
-        this.shiShen = shiShen;
-    }
-
-    public String getShiShen(){
-        return shiShen;
-    }
-    public void setSex(String sex){
-        this.sex = sex;
-    }
-
-    public String getSex(){
-        return sex;
-    }
-    public void setContent(String content){
-        this.content = content;
-    }
-
-    public String getContent(){
-        return content;
-    }
-    public void setQr(String qr){
-        this.qr = qr;
-    }
-
-    public String getQr(){
-        return qr;
-    }
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("shiShen", getShiShen())
-            .append("sex", getSex())
-            .append("content", getContent())
-            .append("qr", getQr())
-            .toString();
-    }
 }

+ 3 - 0
xpgx-service/src/main/java/com/miaxis/ge/mapper/GeJuMapper.java

@@ -19,4 +19,7 @@ public interface GeJuMapper extends BaseMapper<GeJu> {
      */
     public List<GeJu> selectGeJuList(GeJu geJu);
 
+
+    public List<GeJu> selectGeJuList2(GeJu geJu);
+
 }

+ 7 - 6
xpgx-service/src/main/resources/mapper/ge/GeJuMapper.xml

@@ -16,7 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select * from ge_ju
     </sql>
 
-    <select id="selectGeJuList" parameterType="GeJu" resultMap="GeJuResult">
+    <select id="selectGeJuList" parameterType="com.miaxis.ge.domain.GeJu" resultMap="GeJuResult">
         <include refid="selectGeJuVo"/>
         <where>
             <if test="shiShen != null  and shiShen != ''"> and shi_shen = #{shiShen}</if>
@@ -27,12 +27,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
 
 
-    <select id="selectGeJuList2" parameterType="com.miaxis.disease.dto.DiseasePartDto" resultMap="GeJuResult">
+    <select id="selectGeJuList2" parameterType="com.miaxis.ge.domain.GeJu" resultMap="GeJuResult">
         <include refid="selectGeJuVo"/>
         <where>
-            <if test="qrs != null"> and part in
-                <foreach item="qr" index="index" collection="qrs" open="(" separator="," close=")">
-                    #{qr}
+            <if test="shiShen != null  and shiShen != ''"> and shi_shen = #{shiShen}</if>
+            <if test="qr != null"> and qr in
+                <foreach item="q" index="index" collection="qr.split(',')" open="(" separator="," close=")">
+                    #{q}
                 </foreach>
             </if>
 
@@ -41,8 +42,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     #{s}
                 </foreach>
             </if>
-            <if test="degree != null  and degree != ''"> and degree = #{degree}</if>
         </where>
+        order by id
     </select>