From 923e3291b84df039fc6d5ce9f62362f2b89907d0 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Thu, 15 Jun 2023 11:22:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=9F=A5=E8=AF=A2=E9=97=A8?= =?UTF-8?q?=E5=BA=97=E5=92=8C=E7=A7=AF=E5=88=86=E8=BF=94=E5=88=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cweb/controller/BsStoreCidController.java | 25 +++++++++++++++---- .../com/hfkj/service/BsStoreCidService.java | 1 + .../service/impl/BsStoreCidServiceImpl.java | 11 ++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/cweb/src/main/java/com/cweb/controller/BsStoreCidController.java b/cweb/src/main/java/com/cweb/controller/BsStoreCidController.java index 379c600..7ccc1a0 100644 --- a/cweb/src/main/java/com/cweb/controller/BsStoreCidController.java +++ b/cweb/src/main/java/com/cweb/controller/BsStoreCidController.java @@ -11,13 +11,11 @@ import com.hfkj.service.BsStoreCidService; import com.hfkj.service.BsStoreService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import java.util.Date; @@ -47,7 +45,7 @@ public class BsStoreCidController { try { if (storeCid == null - || storeCid.getCid() == null + || StringUtils.isBlank(storeCid.getCid()) || storeCid.getStoreId() == null ) { log.error("configStore error!","参数错误"); @@ -91,4 +89,21 @@ public class BsStoreCidController { } } + @RequestMapping(value="/voiceSucceed",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "语音播报成功") + public ResponseData voiceSucceed(@RequestParam(value = "storeId", required = true) Long storeId) { + try { + + bsStoreCidService.voiceSucceed(storeId); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + } diff --git a/service/src/main/java/com/hfkj/service/BsStoreCidService.java b/service/src/main/java/com/hfkj/service/BsStoreCidService.java index 2db539a..e766c83 100644 --- a/service/src/main/java/com/hfkj/service/BsStoreCidService.java +++ b/service/src/main/java/com/hfkj/service/BsStoreCidService.java @@ -63,6 +63,7 @@ public interface BsStoreCidService { */ void getPushRecord(Long storeId); + void voiceSucceed(Long storeId); /** * @Author Sum1Dream diff --git a/service/src/main/java/com/hfkj/service/impl/BsStoreCidServiceImpl.java b/service/src/main/java/com/hfkj/service/impl/BsStoreCidServiceImpl.java index 47059e3..5f6f5c1 100644 --- a/service/src/main/java/com/hfkj/service/impl/BsStoreCidServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/impl/BsStoreCidServiceImpl.java @@ -144,6 +144,17 @@ public class BsStoreCidServiceImpl implements BsStoreCidService { } + @Override + public void voiceSucceed(Long storeId) { + Map pushMap = new HashMap<>(); + pushMap.put("storeId" , storeId); + pushMap.put("status" , 2); + BsStorePushRecord storePushRecord = findPushRecordByMap(pushMap); + + storePushRecord.setStatus(1); + storePushRecordMapper.updateByPrimaryKey(storePushRecord); + } + @Override public void insertStorePushRecord(BsStorePushRecord storePushRecord) { storePushRecordMapper.insert(storePushRecord);