refactor: 接口调整

This commit is contained in:
裴浩宇 2024-04-11 16:20:06 +08:00
parent a078896306
commit 9bc028e89f
2 changed files with 19 additions and 3 deletions

View File

@ -12,7 +12,9 @@ import com.pnkx.domain.vo.PxCardRecordVo;
import com.pnkx.service.*;
import com.pnkx.system.domain.SysNotice;
import com.pnkx.system.domain.SysNoticeRead;
import com.pnkx.system.service.ISysConfigService;
import com.pnkx.system.service.ISysNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@ -51,6 +53,10 @@ public class PxAdminController extends BaseController {
private ISysNoticeService noticeService;
@Resource
private IPxCommemorationDayService pxCommemorationDayService;
@Resource
private IPxMenstruationRecordService pxMenstruationRecordService;
@Resource
private ISysConfigService configService;
/**
* 全文检索
*/
@ -146,6 +152,16 @@ public class PxAdminController extends BaseController {
// 纪念日
List<PxCommemorationDay> commemorationDayList = pxCommemorationDayService.getCommemorationDayList(null);
result.put("commemoration", commemorationDayList);
// 姨妈助手
List<PxMenstruationRecord> pxMenstruationRecords = pxMenstruationRecordService.selectMenstruationRecordList(null);
result.put("menstruation", pxMenstruationRecords);
// 姨妈助手设置
JSONObject menstruationAssistantSetting = new JSONObject();
menstruationAssistantSetting.put("cycle", configService.selectConfigByKey("ymzq"));
menstruationAssistantSetting.put("duration", configService.selectConfigByKey("ymsc"));
menstruationAssistantSetting.put("state", configService.selectConfigByKey("ymdqzt"));
result.put("menstruationAssistantSetting", menstruationAssistantSetting);
return AjaxResult.success(result);
}
}

View File

@ -50,12 +50,12 @@
icon, date, `repeat`, order_num, del_flag, version, create_by, create_time, update_by, update_time, remark
from px_commemoration_day
where
( `repeat` = 1 AND TIMESTAMPDIFF( DAY, now(), CONCAT( LEFT ( now(), 4 ), RIGHT ( date, 15 ))) &lt; 5
AND TIMESTAMPDIFF( DAY, now(), CONCAT( LEFT ( now(), 4 ), RIGHT ( date, 15 ))) &gt; 0
( `repeat` = 1 AND TIMESTAMPDIFF( DAY, now(), CONCAT( LEFT ( now(), 4 ), RIGHT ( date, 15 ))) &lt; 30
AND TIMESTAMPDIFF( DAY, now(), CONCAT( LEFT ( now(), 4 ), RIGHT ( date, 15 ))) &gt; -1
)
OR (
`repeat` = 0
AND TIMESTAMPDIFF( DAY, now(), date ) &lt; 5 AND TIMESTAMPDIFF( DAY, now(), date ) &gt; 0)
AND TIMESTAMPDIFF( DAY, now(), date ) &lt; 30 AND TIMESTAMPDIFF( DAY, now(), date ) &gt; -1)
and del_flag = '0'
</select>