puzhibing
2024-02-05 640ff18d2d7f4be02ddb7f8f75e899f05545eb98
cloud-server-other/src/main/java/com/dsh/other/controller/SystemNoticeController.java
@@ -8,13 +8,11 @@
import com.dsh.other.service.NoticeService;
import com.dsh.other.service.PhoneService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
@@ -28,17 +26,17 @@
    @Autowired
    private PhoneService phoneService;
    private final SimpleDateFormat format  = new SimpleDateFormat("yyyy-MM-dd HH:mm");
    private final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm");
    @PostMapping("/base/notice/queryNoticeDetails")
    public List<SysNotice> getSysNoticeDetails(){
    public List<SysNotice> getSysNoticeDetails() {
        List<SysNotice> notices = new ArrayList<>();
        List<Notice> list = noticeSers.list(new QueryWrapper<Notice>()
                .eq("state", 1)
                .eq("upOrDown", 1)
                .orderByDesc("insertTime"));
        if (list.size() > 0 ){
        if (list.size() > 0) {
            list.forEach(noList -> {
                SysNotice notice = new SysNotice();
                notice.setNoticeId(noList.getId());
@@ -53,10 +51,10 @@
    @PostMapping("/base/notice/queryNotice")
    public SysNotice getSysNoticeBuId(@RequestBody Integer noticeId){
    public SysNotice getSysNoticeBuId(@RequestParam("noticeId") Integer noticeId) {
        SysNotice sysNotice = new SysNotice();
        Notice notice = noticeSers.getById(noticeId);
        if (null != notice){
        if (null != notice) {
            sysNotice.setNoticeId(notice.getId());
            sysNotice.setNoticeTitle(notice.getName());
            sysNotice.setNoticeContents(notice.getContent());
@@ -67,11 +65,13 @@
    @PostMapping("/base/notice/sysTell")
    public List<String> queryCustomerTel(){
    public List<String> queryCustomerTel() {
        List<String> tellS = new ArrayList<>();
        List<Phone> list = phoneService.list();
        if (list.size() > 0 ){
            tellS = list.stream().map(Phone::getPhone).collect(Collectors.toList());
        if (list.size() > 0) {
            String phone = list.get(0).getPhone();
            String[] split = phone.split(",");
            tellS = Arrays.asList(split);
        }
        return tellS;