|
|
|
@ -5,6 +5,7 @@ import com.hfkj.common.Base64Util; |
|
|
|
|
import com.hfkj.common.exception.ErrorCode; |
|
|
|
|
import com.hfkj.common.exception.ErrorHelp; |
|
|
|
|
import com.hfkj.common.exception.SysCode; |
|
|
|
|
import com.hfkj.common.utils.RedisUtil; |
|
|
|
|
import com.hfkj.config.CommonSysConst; |
|
|
|
|
import com.hfkj.dao.BsStoreCidMapper; |
|
|
|
|
import com.hfkj.dao.BsStorePushRecordMapper; |
|
|
|
@ -41,6 +42,9 @@ public class BsStoreCidServiceImpl implements BsStoreCidService { |
|
|
|
|
@Resource |
|
|
|
|
private BsStorePushRecordMapper storePushRecordMapper; |
|
|
|
|
|
|
|
|
|
@Resource |
|
|
|
|
private RedisUtil redisUtil; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void insertStoreCid(BsStoreCid storeCid) { |
|
|
|
|
bsStoreCidMapper.insert(storeCid); |
|
|
|
@ -82,9 +86,12 @@ public class BsStoreCidServiceImpl implements BsStoreCidService { |
|
|
|
|
public void storePush(JSONObject object) { |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
if (object == null || |
|
|
|
|
object.getBigDecimal("price") == null || |
|
|
|
|
object.getLong("storeId") == null) { |
|
|
|
|
|
|
|
|
|
String key = "APP_PUSH" + object.getLong("storeId"); |
|
|
|
|
|
|
|
|
|
if (redisUtil.get(key) == null) { |
|
|
|
|
redisUtil.set(key,object.getLong("storeId"), 5); |
|
|
|
|
if (object.getBigDecimal("price") == null || object.getLong("storeId") == null) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -118,8 +125,9 @@ public class BsStoreCidServiceImpl implements BsStoreCidService { |
|
|
|
|
storePushRecord.setVoiceUrl(msg); |
|
|
|
|
insertStorePushRecord(storePushRecord); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
storePush(object); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.info("请求超时:" + e); |
|
|
|
@ -167,6 +175,8 @@ public class BsStoreCidServiceImpl implements BsStoreCidService { |
|
|
|
|
if (storePushRecord != null) { |
|
|
|
|
storePushRecord.setStatus(1); |
|
|
|
|
storePushRecordMapper.updateByPrimaryKey(storePushRecord); |
|
|
|
|
|
|
|
|
|
redisUtil.del("APP_PUSH" + storePushRecord.getStoreId()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
getPushRecord(storeId); |
|
|
|
|