diff --git a/cweb/src/main/java/com/cweb/controller/BsStoreCidController.java b/cweb/src/main/java/com/cweb/controller/BsStoreCidController.java new file mode 100644 index 0000000..d6e9f01 --- /dev/null +++ b/cweb/src/main/java/com/cweb/controller/BsStoreCidController.java @@ -0,0 +1,108 @@ +package com.cweb.controller; + +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.entity.BsStore; +import com.hfkj.entity.BsStoreCid; +import com.hfkj.model.ResponseData; +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.*; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * @author sum1dream + */ +@Controller +@RequestMapping(value = "/storeCid") +@Api(value = "门店CID") +public class BsStoreCidController { + + private static Logger log = LoggerFactory.getLogger(BsStoreCidController.class); + + @Resource + private BsStoreCidService bsStoreCidService; + + @Resource + private BsStoreService bsStoreService; + + @RequestMapping(value="/connectStoreCid",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "连接门店和CID") + public ResponseData connectStoreCid(@RequestBody BsStoreCid storeCid) { + try { + + if (storeCid == null + || StringUtils.isBlank(storeCid.getCid()) + || storeCid.getStoreId() == null + ) { + log.error("configStore error!","参数错误"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + + BsStore store = bsStoreService.getStoreById(storeCid.getStoreId()); + + if (store == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "当前门店不存在!"); + } + + Map map = new HashMap<>(); + map.put("storeId" , storeCid.getStoreId()); + + BsStoreCid bsStoreCid = bsStoreCidService.findByMap(map); + + if (bsStoreCid == null) { + bsStoreCid = new BsStoreCid(); + bsStoreCid.setCid(storeCid.getCid()); + bsStoreCid.setStoreId(store.getId()); + bsStoreCid.setStoreNo(store.getStoreNo()); + bsStoreCid.setStoreName(store.getName()); + bsStoreCid.setCreateTime(new Date()); + bsStoreCid.setUpdateTime(new Date()); + bsStoreCidService.insertStoreCid(bsStoreCid); + } else { + bsStoreCid.setCid(storeCid.getCid()); + bsStoreCid.setUpdateTime(new Date()); + bsStoreCidService.editStoreCid(bsStoreCid); + } + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/voiceSucceed",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "语音播报成功") + public ResponseData voiceSucceed(@RequestParam(value = "storeId", required = true) Long storeId, + @RequestParam(value = "taskNo", required = true) String taskNo) { + try { + + bsStoreCidService.voiceSucceed(storeId , taskNo); + + return ResponseMsgUtil.success("操作成功"); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + +} diff --git a/cweb/src/main/java/com/cweb/controller/TestController.java b/cweb/src/main/java/com/cweb/controller/TestController.java index e433d18..503dcd1 100644 --- a/cweb/src/main/java/com/cweb/controller/TestController.java +++ b/cweb/src/main/java/com/cweb/controller/TestController.java @@ -2,60 +2,47 @@ package com.cweb.controller; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.alipay.api.AlipayClient; -import com.alipay.api.DefaultAlipayClient; -import com.alipay.api.request.AlipaySystemOauthTokenRequest; -import com.alipay.api.response.AlipaySystemOauthTokenResponse; import com.hfkj.channel.alipay.utils.AlipayRequest; -import com.hfkj.channel.alipay.utils.AlipayUtils; -import com.hfkj.channel.lakala.*; +import com.hfkj.channel.lakala.LaKaLaLedgerService; +import com.hfkj.channel.lakala.LaKaLaWalletService; import com.hfkj.channel.lakala.config.LaKaLaConfig; import com.hfkj.channel.saas.SaasActivityService; import com.hfkj.channel.saas.SaasMerService; -import com.hfkj.channel.saas.config.SaasConfig; -import com.hfkj.channel.saas.utils.GenerateAgreementUtil; import com.hfkj.channel.saas.utils.SaasCommon; -import com.hfkj.channel.saas.saasenum.FileImgType; import com.hfkj.channel.saas.utils.SaasMerRequest; import com.hfkj.channel.weixin.WeiXinMerService; import com.hfkj.channel.weixin.utils.WxUtils; import com.hfkj.channel.weixin.utils.sdk.WXPayConstants; import com.hfkj.common.utils.DateUtil; import com.hfkj.common.utils.HttpsUtils; -import com.hfkj.common.utils.ImageUtils; import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.config.CommonSysConst; import com.hfkj.config.device.SoundService; import com.hfkj.config.mqtt.MqttProviderService; -import com.hfkj.dao.BsStoreMapper; -import com.hfkj.dao.BsStoreMapperExt; import com.hfkj.entity.*; import com.hfkj.model.MerBasisModel; import com.hfkj.model.ResponseData; import com.hfkj.service.*; -import com.hfkj.sysenum.*; -import freemarker.template.Configuration; -import freemarker.template.Template; -import freemarker.template.TemplateException; +import com.hfkj.sysenum.MerStatusEnum; +import com.hfkj.sysenum.PlatformTypeEnum; +import com.hfkj.sysenum.StoreCreateTypeEnum; +import com.hfkj.sysenum.StoreStatusEnum; +import com.hfkj.tts.HWYunSisService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import net.coobird.thumbnailator.Thumbnails; -import org.apache.commons.collections4.ListUtils; import org.apache.commons.collections4.MapUtils; -import org.apache.commons.lang3.ArrayUtils; -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.*; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; -import java.io.*; +import java.io.File; import java.math.BigDecimal; import java.util.*; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.function.Consumer; @Controller @RequestMapping(value = "/test") @@ -108,6 +95,9 @@ public class TestController { @Resource private LaKaLaWalletService laKaLaWalletService; + @Resource + private BsStoreCidService bsStoreCidService; + @RequestMapping(value="/refreshMerStatus",method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "refreshMerStatus") @@ -649,4 +639,46 @@ public class TestController { } } + + @RequestMapping(value="/ttsCustomDemo",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "ttsCustomDemo") + public ResponseData ttsCustomDemo() { + try { + + JSONObject object = new JSONObject(); + object.put("price" , "374.87"); + + return ResponseMsgUtil.success(HWYunSisService.ttsCustomDemo(object)); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value="/uniPush",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "uniPush") + public ResponseData uniPush(@RequestParam(name = "storeId", required = true) Long storeId,@RequestParam(name = "price", required = true) BigDecimal price) { + try { + + + + JSONObject object = new JSONObject(); + + object.put("price", price); + object.put("storeId", storeId); + bsStoreCidService.storePush(object); + + + return ResponseMsgUtil.success("成功"); + + } catch (Exception e) { + log.error(e.getMessage(), e); + return ResponseMsgUtil.exception(e); + } + } + } diff --git a/cweb/src/main/resources/dev/logback.xml b/cweb/src/main/resources/dev/logback.xml index 6011524..1e005b3 100644 --- a/cweb/src/main/resources/dev/logback.xml +++ b/cweb/src/main/resources/dev/logback.xml @@ -112,4 +112,28 @@ + + log/PushLog.log + + log/PushLog/PushLog.log.%d.%i + + + 64 MB + + + + + %d %p (%file:%line\)- %m%n + + UTF-8 + + + + + + + + + diff --git a/service/pom.xml b/service/pom.xml index 6de9480..395fc6e 100644 --- a/service/pom.xml +++ b/service/pom.xml @@ -373,6 +373,16 @@ freemarker 2.3.23 + + com.huawei.sis + huaweicloud-java-sdk-sis + 1.8.1 + + + com.getui.push + restful-sdk + 1.0.0.13 +